Skip to content

Commit

Permalink
drm/msm: Create separate funcs for adding display/gpu components
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Archit Taneja authored and Rob Clark committed Jul 16, 2016
1 parent 7c8f023 commit 7d526fc
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions drivers/gpu/drm/msm/msm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 7d526fc

Please sign in to comment.