linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] input: touchscreen: mxs-lradc: Fix return value check in mxs_lradc_ts_probe()
@ 2017-04-25  6:26 Wei Yongjun
  2017-04-25  7:09 ` Dmitry Torokhov
  2017-04-27 15:13 ` [PATCH -next v2] " Wei Yongjun
  0 siblings, 2 replies; 5+ messages in thread
From: Wei Yongjun @ 2017-04-25  6:26 UTC (permalink / raw)
  To: Dmitry Torokhov, Ksenija Stanojevic, Lee Jones, Marek Vasut
  Cc: Wei Yongjun, linux-input

From: Wei Yongjun <weiyongjun1@huawei.com>

In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/input/touchscreen/mxs-lradc-ts.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
index 4b4aebf..ff9cda2 100644
--- a/drivers/input/touchscreen/mxs-lradc-ts.c
+++ b/drivers/input/touchscreen/mxs-lradc-ts.c
@@ -631,8 +631,8 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
-	if (IS_ERR(ts->base))
-		return PTR_ERR(ts->base);
+	if (!ts->base)
+		return -ENOMEM;
 
 	ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
 				   &ts_wires);


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-28  7:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-25  6:26 [PATCH -next] input: touchscreen: mxs-lradc: Fix return value check in mxs_lradc_ts_probe() Wei Yongjun
2017-04-25  7:09 ` Dmitry Torokhov
2017-04-27 15:13 ` [PATCH -next v2] " Wei Yongjun
2017-04-27 16:52   ` Dmitry Torokhov
2017-04-28  7:43     ` Lee Jones

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).