From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Lee Jones <lee.jones@linaro.org>, Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 2/2] mfd: syscon: Switch to use devm_ioremap_resource()
Date: Fri, 15 Nov 2019 10:49:31 +0200 [thread overview]
Message-ID: <20191115084931.77161-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20191115084931.77161-1-andriy.shevchenko@linux.intel.com>
Instead of checking resource pointer for being NULL and
report some not very standard error codes in this case,
switch to devm_ioremap_resource() API.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/mfd/syscon.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index 13626bb2d432..fad961b2e4a5 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -238,12 +238,9 @@ static int syscon_probe(struct platform_device *pdev)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -ENOENT;
-
- base = devm_ioremap(dev, res->start, resource_size(res));
- if (!base)
- return -ENOMEM;
+ base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
syscon_config.max_register = resource_size(res) - 4;
if (pdata)
--
2.24.0
next prev parent reply other threads:[~2019-11-15 8:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-15 8:49 [PATCH v1 1/2] mfd: syscon: Re-use resource_size() to count max_register Andy Shevchenko
2019-11-15 8:49 ` Andy Shevchenko [this message]
2019-11-15 9:12 ` [PATCH v1 2/2] mfd: syscon: Switch to use devm_ioremap_resource() Arnd Bergmann
2019-11-15 10:20 ` Andy Shevchenko
2019-11-15 9:10 ` [PATCH v1 1/2] mfd: syscon: Re-use resource_size() to count max_register Arnd Bergmann
2019-12-09 8:45 ` Lee Jones
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=20191115084931.77161-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@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).