summaryrefslogtreecommitdiff
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2024-02-06 15:30:13 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2024-02-16 11:46:32 +0100
commit619200d5fe14f5a6f28e36106ca9d9d5aae8a070 (patch)
treeb6f4e6f19ec998fbcdb7197a9f6b666f634df352 /drivers/media/platform
parent76f623d2d4283cc36a9c8a5b585df74638f1efa5 (diff)
media: ti: Use devm_platform_ioremap_resource() in ti_csi2rx_probe()
A wrapper function is available since the commit 7945f929f1a7 ("drivers: provide devm_platform_ioremap_resource()"). * Thus reuse existing functionality instead of keeping duplicate source code. * Delete a local variable which became unnecessary with this refactoring. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Jai Luthra <j-luthra@ti.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
index 2b078c5d7f5d..54aba055c96b 100644
--- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
+++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
@@ -1089,7 +1089,6 @@ static void ti_csi2rx_cleanup_vb2q(struct ti_csi2rx_dev *csi)
static int ti_csi2rx_probe(struct platform_device *pdev)
{
struct ti_csi2rx_dev *csi;
- struct resource *res;
int ret;
csi = devm_kzalloc(&pdev->dev, sizeof(*csi), GFP_KERNEL);
@@ -1100,9 +1099,7 @@ static int ti_csi2rx_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, csi);
mutex_init(&csi->mutex);
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- csi->shim = devm_ioremap_resource(&pdev->dev, res);
+ csi->shim = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(csi->shim)) {
ret = PTR_ERR(csi->shim);
goto err_mutex;