summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2017-08-14 10:29:13 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-08-14 20:23:47 -0700
commit6ecd36d732886ecb07768432212efce9cfb6ac2f (patch)
tree9515ec2a4d8b5e5303e83e760530086eb457d6ac /drivers/input/touchscreen
parente48060ce2c7f73e424272bd6f5d9f996f1853064 (diff)
downloadop-kernel-dev-6ecd36d732886ecb07768432212efce9cfb6ac2f.zip
op-kernel-dev-6ecd36d732886ecb07768432212efce9cfb6ac2f.tar.gz
Input: mxs-lradc - use correct error check
Function devm_ioremap() will return a NULL pointer on failure. However, in function mxs_lradc_ts_probe(), its return value is checked with IS_ERR(), which cannot detect the exceptional case. Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/mxs-lradc-ts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
index 71bf493..816f5c8 100644
--- a/drivers/input/touchscreen/mxs-lradc-ts.c
+++ b/drivers/input/touchscreen/mxs-lradc-ts.c
@@ -633,8 +633,8 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
if (!iores)
return -EINVAL;
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);
OpenPOWER on IntegriCloud