From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: [PATCH 1/2] input: touchscreen: mxs-lradc: Checking for ERR_PTR instead of NULL in probe Date: Thu, 27 Apr 2017 00:04:10 +0300 Message-ID: <20170426210410.k2pe5ov2nkxtuf54@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline Sender: linux-iio-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Dmitry Torokhov , Ksenija Stanojevic Cc: Marek Vasut , Lee Jones , linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-input@vger.kernel.org devm_ioremap() returns NULL on error. It never returns error pointers. Fixes: d81ca730e3e4 ("input: touchscreen: mxs-lradc: Add support for touchscreen") Signed-off-by: Dan Carpenter diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c index 4b4aebfe3e7f..ff9cda29d9a0 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);