public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	linux-kernel@vger.kernel.org
Cc: john.garry@huawei.com,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 2/4] bus: hisi_lpc: Use devm_platform_ioremap_resource
Date: Tue,  5 Jul 2022 14:43:10 +0300	[thread overview]
Message-ID: <20220705114312.86164-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220705114312.86164-1-andriy.shevchenko@linux.intel.com>

The struct resource is not used for anything else, so we can simplify
the code a bit by using the helper function.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/bus/hisi_lpc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c
index 6d432a07cbba..03d4d96ff794 100644
--- a/drivers/bus/hisi_lpc.c
+++ b/drivers/bus/hisi_lpc.c
@@ -618,7 +618,6 @@ static int hisi_lpc_probe(struct platform_device *pdev)
 	struct logic_pio_hwaddr *range;
 	struct hisi_lpc_dev *lpcdev;
 	resource_size_t io_end;
-	struct resource *res;
 	int ret;
 
 	lpcdev = devm_kzalloc(dev, sizeof(*lpcdev), GFP_KERNEL);
@@ -627,8 +626,7 @@ static int hisi_lpc_probe(struct platform_device *pdev)
 
 	spin_lock_init(&lpcdev->cycle_lock);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	lpcdev->membase = devm_ioremap_resource(dev, res);
+	lpcdev->membase = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(lpcdev->membase))
 		return PTR_ERR(lpcdev->membase);
 
-- 
2.35.1


  reply	other threads:[~2022-07-05 11:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 11:43 [PATCH v1 1/4] bus: hisi_lpc: Don't dereference fwnode handle Andy Shevchenko
2022-07-05 11:43 ` Andy Shevchenko [this message]
2022-07-05 14:38   ` [PATCH v1 2/4] bus: hisi_lpc: Use devm_platform_ioremap_resource Rafael J. Wysocki
2022-07-05 14:41   ` John Garry
2022-07-05 11:43 ` [PATCH v1 3/4] bus: hisi_lpc: Correct error code for timeout Andy Shevchenko
2022-07-05 14:39   ` Rafael J. Wysocki
2022-07-05 14:53   ` John Garry
2022-07-05 11:43 ` [PATCH v1 4/4] bus: hisi_lpc: Don't guard ACPI IDs with ACPI_PTR() Andy Shevchenko
2022-07-05 14:22   ` Rafael J. Wysocki
2022-07-05 14:51   ` John Garry
2022-07-05 15:15     ` Andy Shevchenko
2022-07-05 15:27       ` John Garry
2022-07-05 15:33         ` Andy Shevchenko
2022-07-05 14:17 ` [PATCH v1 1/4] bus: hisi_lpc: Don't dereference fwnode handle Rafael J. Wysocki
2022-07-05 15:02 ` John Garry
2022-07-05 15:23   ` Andy Shevchenko
2022-07-05 15:38     ` John Garry

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=20220705114312.86164-2-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=john.garry@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox