summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArchit Taneja <architt@codeaurora.org>2016-05-19 10:33:57 +0530
committerRob Clark <robdclark@gmail.com>2016-07-16 10:08:59 -0400
commit7d526fcf205ad011c6e5bce819b2b8a1698f7152 (patch)
tree7a10c848f0441d90cb15617b650ab4af168d1aa3
parent7c8f023565f56ccb11167e5aac6466b211977dcb (diff)
downloadlinux-7d526fcf205ad011c6e5bce819b2b8a1698f7152.tar.bz2
drm/msm: Create separate funcs for adding display/gpu components
Simplifies some of the code that we'll add later. Signed-off-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Rob Clark <robdclark@gmail.com>
-rw-r--r--drivers/gpu/drm/msm/msm_drv.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 1c1869011092..132c81333491 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -823,6 +823,18 @@ static int add_components(struct device *dev, struct component_match **matchptr,
return 0;
}
+static int add_display_components(struct device *dev,
+ struct component_match **matchptr)
+{
+ return add_components(dev, matchptr, "connectors");
+}
+
+static int add_gpu_components(struct device *dev,
+ struct component_match **matchptr)
+{
+ return add_components(dev, matchptr, "gpus");
+}
+
static int msm_drm_bind(struct device *dev)
{
return msm_drm_init(dev, &msm_driver);
@@ -845,9 +857,15 @@ static const struct component_master_ops msm_drm_ops = {
static int msm_pdev_probe(struct platform_device *pdev)
{
struct component_match *match = NULL;
+ int ret;
+
+ ret = add_display_components(&pdev->dev, &match);
+ if (ret)
+ return ret;
- add_components(&pdev->dev, &match, "connectors");
- add_components(&pdev->dev, &match, "gpus");
+ ret = add_gpu_components(&pdev->dev, &match);
+ if (ret)
+ return ret;
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
return component_master_add_with_match(&pdev->dev, &msm_drm_ops, match);