summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-04-27 00:04:31 +0300
committerLee Jones <lee.jones@linaro.org>2017-04-27 11:54:50 +0100
commitab6241ae07c3c698543b565e4ea41995a29a3f62 (patch)
tree3ba95ec19445e58b3e83659b62672ff1e895d1e1 /drivers/input
parentd096ae4bb0fa3116fdd4941c65fc577f76ad453c (diff)
input: touchscreen: mxs-lradc: || vs && typos
These tests are meaningless as is because "adapt" can't possibly be both less than 1 and greater than 32. Fixes: d81ca730e3e4 ("input: touchscreen: mxs-lradc: Add support for touchscreen") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/mxs-lradc-ts.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
index 4b4aebfe3e7f..58c016cd6809 100644
--- a/drivers/input/touchscreen/mxs-lradc-ts.c
+++ b/drivers/input/touchscreen/mxs-lradc-ts.c
@@ -642,7 +642,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
if (of_property_read_u32(node, "fsl,ave-ctrl", &adapt)) {
ts->over_sample_cnt = 4;
} else {
- if (adapt >= 1 || adapt <= 32) {
+ if (adapt >= 1 && adapt <= 32) {
ts->over_sample_cnt = adapt;
} else {
dev_err(ts->dev, "Invalid sample count (%u)\n",
@@ -654,7 +654,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
if (of_property_read_u32(node, "fsl,ave-delay", &adapt)) {
ts->over_sample_delay = 2;
} else {
- if (adapt >= 2 || adapt <= LRADC_DELAY_DELAY_MASK + 1) {
+ if (adapt >= 2 && adapt <= LRADC_DELAY_DELAY_MASK + 1) {
ts->over_sample_delay = adapt;
} else {
dev_err(ts->dev, "Invalid sample delay (%u)\n",
@@ -666,7 +666,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
if (of_property_read_u32(node, "fsl,settling", &adapt)) {
ts->settling_delay = 10;
} else {
- if (adapt >= 1 || adapt <= LRADC_DELAY_DELAY_MASK) {
+ if (adapt >= 1 && adapt <= LRADC_DELAY_DELAY_MASK) {
ts->settling_delay = adapt;
} else {
dev_err(ts->dev, "Invalid settling delay (%u)\n",