From: Fabio Estevam <fabio.estevam@nxp.com>
To: dmitry.torokhov@gmail.com
Cc: festevam@gmail.com, marex@denx.de, ksenija.stanojevic@gmail.com,
linux-input@vger.kernel.org,
Fabio Estevam <fabio.estevam@nxp.com>
Subject: [PATCH] input: touchscreen: mxs-lradc: Use devm_ioremap_resource()
Date: Wed, 21 Jun 2017 11:03:24 -0300 [thread overview]
Message-ID: <1498053804-11297-1-git-send-email-fabio.estevam@nxp.com> (raw)
In case of error devm_ioremap() returns NULL pointer not ERR_PTR().
The iores NULL check is also missing.
Fix both problems by using devm_ioremap_resource() variant instead.
Fixes: d81ca730e3e4 ("input: touchscreen: mxs-lradc: Add support for touchscreen")
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
drivers/input/touchscreen/mxs-lradc-ts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
index 58c016c..0f8c9e7 100644
--- a/drivers/input/touchscreen/mxs-lradc-ts.c
+++ b/drivers/input/touchscreen/mxs-lradc-ts.c
@@ -630,7 +630,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
spin_lock_init(&ts->lock);
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
+ ts->base = devm_ioremap_resource(dev, iores);
if (IS_ERR(ts->base))
return PTR_ERR(ts->base);
--
2.7.4
next reply other threads:[~2017-06-21 14:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 14:03 Fabio Estevam [this message]
2017-06-22 2:44 ` [PATCH] input: touchscreen: mxs-lradc: Use devm_ioremap_resource() Fabio Estevam
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=1498053804-11297-1-git-send-email-fabio.estevam@nxp.com \
--to=fabio.estevam@nxp.com \
--cc=dmitry.torokhov@gmail.com \
--cc=festevam@gmail.com \
--cc=ksenija.stanojevic@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=marex@denx.de \
/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).