All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-omap@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Tony Lindgren <tony@atomide.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] bus: omap-ocp2scp: Use devm_platform_get_and_ioremap_resource() in omap_ocp2scp_probe()
Date: Mon, 5 Feb 2024 07:57:53 +0100	[thread overview]
Message-ID: <5c56f149-baa7-4907-b7d4-7a7bf6bd74db@web.de> (raw)

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 5 Feb 2024 07:51:37 +0100

A wrapper function is available since the commit 890cc39a879906b63912482dfc41944579df2dc6
("drivers: provide devm_platform_get_and_ioremap_resource()").
Thus reuse existing functionality instead of keeping duplicate source code.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/bus/omap-ocp2scp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/bus/omap-ocp2scp.c b/drivers/bus/omap-ocp2scp.c
index 7d7479ba0a75..16d3c1807e1c 100644
--- a/drivers/bus/omap-ocp2scp.c
+++ b/drivers/bus/omap-ocp2scp.c
@@ -58,8 +58,7 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
 	 * of SYNC2 parameter in OCP2SCP. Suggested reset value is 0x6 or more.
 	 */
 	if (!of_device_is_compatible(np, "ti,am437x-ocp2scp")) {
-		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		regs = devm_ioremap_resource(&pdev->dev, res);
+		regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 		if (IS_ERR(regs)) {
 			ret = PTR_ERR(regs);
 			goto err1;
--
2.43.0


                 reply	other threads:[~2024-02-05  6:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c56f149-baa7-4907-b7d4-7a7bf6bd74db@web.de \
    --to=markus.elfring@web.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.