diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-07-06 20:36:08 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-07-19 09:27:47 +0200 |
commit | 214f995c20938fc19375c0806b48f0ea2dec17f3 (patch) | |
tree | 29a51ef88b53e462331ac3aa805fe0981402d2fc /drivers/media | |
parent | 6963e46ce61388c05ae26918ce3afc138ac5c9f8 (diff) | |
download | linux-214f995c20938fc19375c0806b48f0ea2dec17f3.tar.gz |
media: ti-vpe: cal: Add comments to cal_probe() to delimitate sections
The cal_probe() function is a bit long, add comments to delimitate
sections in order to improve readability. The platform_set_drvdata()
call is moved to a more logical place as a result.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/ti-vpe/cal.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c index aecded3cad16..738fd7a46399 100644 --- a/drivers/media/platform/ti-vpe/cal.c +++ b/drivers/media/platform/ti-vpe/cal.c @@ -2309,9 +2309,10 @@ static int cal_probe(struct platform_device *pdev) return -ENODEV; } - /* save pdev pointer */ cal->pdev = pdev; + platform_set_drvdata(pdev, cal); + /* Acquire resources: clocks, CAMERARX regmap, I/O memory and IRQ. */ cal->fclk = devm_clk_get(&pdev->dev, "fck"); if (IS_ERR(cal->fclk)) { dev_err(&pdev->dev, "cannot get CAL fclk\n"); @@ -2338,14 +2339,14 @@ static int cal_probe(struct platform_device *pdev) if (ret) return ret; - platform_set_drvdata(pdev, cal); - + /* Create CAMERARX PHYs. */ for (i = 0; i < cal->data->num_csi2_phy; ++i) { cal->phy[i] = cal_camerarx_create(cal, i); if (IS_ERR(cal->phy[i])) return PTR_ERR(cal->phy[i]); } + /* Create contexts. */ for (i = 0; i < cal->data->num_csi2_phy; ++i) cal->ctx[i] = cal_create_instance(cal, i); @@ -2356,15 +2357,13 @@ static int cal_probe(struct platform_device *pdev) vb2_dma_contig_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); + /* Read the revision and hardware info to verify hardware access. */ pm_runtime_enable(&pdev->dev); - ret = pm_runtime_get_sync(&pdev->dev); if (ret) goto runtime_disable; - /* Just check we can actually access the module */ cal_get_hwinfo(cal); - pm_runtime_put_sync(&pdev->dev); return 0; |