From patchwork Tue Feb 6 14:37:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 770734 Received: from mout.web.de (mout.web.de [212.227.17.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4E4A1E500; Tue, 6 Feb 2024 14:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707230275; cv=none; b=WAlXJ90XbOa8iZow6Uaw64Eu8LkR43FDvZVwDH7KNhdraNDUiojnjpTueOGM5yM9ezlc7avAI5Lz8tQfyA7IW8L4T5aDpndUFx352syZZ0OYRQS4e7JytoIJPcmP4TcPPWjC6v8q46lRdEApPRGvcZzF46EOKoReJKE2vmb+S2A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707230275; c=relaxed/simple; bh=dACWXeLInRzV10diT38UakiAC6q/ddZegipCKPgaSIM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=j6hf06dYTBro6/9SJy3x71K9oxr9emE0W9y4I9s4ArGlQYtpRJpbbKDVFkB4+R0KEwqmTuBCHPQOXHKdXGKoteGFI/usfSPfe0xSNxoddE8M4WczpvnMu7lhm57uNF3vvWx4Bz7pJCbUDqusDjF+MrcUHNSQYJZ1w2vDBbU43F8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=hBlS9meR; arc=none smtp.client-ip=212.227.17.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="hBlS9meR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1707230251; x=1707835051; i=markus.elfring@web.de; bh=dACWXeLInRzV10diT38UakiAC6q/ddZegipCKPgaSIM=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=hBlS9meRQMiujP0vn1fKOzs+e3SDvGJ6a8t6BNXdCHr8t2ofXCN89fEyOG07itUb GHbpvXr4KZaFlFC/NmWxrIT41/rbmTEkbgYD+Rlypi3MHPigQZZDxWdCzf0sEd8ba xzkpl0sI9p44e7ambb5vf/MtgoozrX2DrdrOUuUAs03kq7xrII2HNdzXvQRMm+7JS l7oxVPKW/Zfl+4DGCeB+7gjOD8N76Vc0+fHQU4Y5nW+xEggDJsYCD7lwOA1+bnrl+ K3siz+uqqcXd6hvRSI0n/POYXsetNxv+tPSqKIuVy9dSKJfaHZT+U2bytCeE3Aguc wjacLHgpySh/NczJLw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M59jC-1rYSVS3tkS-0016bv; Tue, 06 Feb 2024 15:37:30 +0100 Message-ID: Date: Tue, 6 Feb 2024 15:37:30 +0100 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2] media: ti: Use devm_platform_ioremap_resource() in ti_csi2rx_probe() Content-Language: en-GB To: Jai Luthra , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org, Mauro Carvalho Chehab Cc: LKML References: <66d7218d-ed57-4dec-b6ac-630b01056b5e@web.de> <5m4zr6d3geqdyxtr5ow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RxBf7Vqs7QEiW3Z15fMn2bR TMihaq6m2f2TV9ca3cSF/GOF0GmSfCc8oWRWealgmGMejXBdD2MLGWiVBbnszmaSYlagzzeiL jAc69qqdkVFS8gJfFEqYGuzsdBZZTDnnc7sOZb3wOk50emCFr9M1mUwZnL4IJ18b8IuylYVsS QC8v7evRBf5SFeUWzsu6DCyjKY9VLbVrCtdsmfWObfCfc= From: Markus Elfring Date: Tue, 6 Feb 2024 15:30:13 +0100 A wrapper function is available since the commit 7945f929f1a77a1c8887a97ca07f87626858ff42 ("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 --- v2: The transformation pattern was adjusted based on advices by known contributors. Examples: * Doug Anderson * Geert Uytterhoeven * Robin Murphy drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.43.0 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;