linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lizhe <sensor1010@163.com>
To: broonie@kernel.org, heiko@sntech.de
Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	Lizhe <sensor1010@163.com>
Subject: [PATCH v1] drivers/spi-rockchip.c : Use devm_platform_get_and_ioremap_resource makes code better
Date: Sun, 26 Feb 2023 14:51:25 +0800	[thread overview]
Message-ID: <20230226065125.14086-1-sensor1010@163.com> (raw)

use devm_platform_get_and_ioremap replace platform_get_resource()
and devm_ioremap_resource()

Signed-off-by: Lizhe <sensor1010@163.com>
---
 drivers/spi/spi-rockchip.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 79242dc5272d..4f69c38d5a67 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -775,8 +775,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
 	ctlr->slave = slave_mode;
 
 	/* Get basic io resource and map it */
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	rs->regs = devm_ioremap_resource(&pdev->dev, mem);
+	rs->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
 	if (IS_ERR(rs->regs)) {
 		ret =  PTR_ERR(rs->regs);
 		goto err_put_ctlr;
-- 
2.34.1


             reply	other threads:[~2023-02-26  6:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-26  6:51 Lizhe [this message]
2023-03-06 13:05 ` [PATCH v1] drivers/spi-rockchip.c : Use devm_platform_get_and_ioremap_resource makes code better Mark Brown

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=20230226065125.14086-1-sensor1010@163.com \
    --to=sensor1010@163.com \
    --cc=broonie@kernel.org \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).