diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-04-26 17:04:31 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2017-04-27 06:54:50 -0400 |
commit | ab6241ae07c3c698543b565e4ea41995a29a3f62 (patch) | |
tree | 3ba95ec19445e58b3e83659b62672ff1e895d1e1 | |
parent | d096ae4bb0fa3116fdd4941c65fc577f76ad453c (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>
-rw-r--r-- | drivers/input/touchscreen/mxs-lradc-ts.c | 6 |
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) | |||
642 | if (of_property_read_u32(node, "fsl,ave-ctrl", &adapt)) { | 642 | if (of_property_read_u32(node, "fsl,ave-ctrl", &adapt)) { |
643 | ts->over_sample_cnt = 4; | 643 | ts->over_sample_cnt = 4; |
644 | } else { | 644 | } else { |
645 | if (adapt >= 1 || adapt <= 32) { | 645 | if (adapt >= 1 && adapt <= 32) { |
646 | ts->over_sample_cnt = adapt; | 646 | ts->over_sample_cnt = adapt; |
647 | } else { | 647 | } else { |
648 | dev_err(ts->dev, "Invalid sample count (%u)\n", | 648 | dev_err(ts->dev, "Invalid sample count (%u)\n", |
@@ -654,7 +654,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev) | |||
654 | if (of_property_read_u32(node, "fsl,ave-delay", &adapt)) { | 654 | if (of_property_read_u32(node, "fsl,ave-delay", &adapt)) { |
655 | ts->over_sample_delay = 2; | 655 | ts->over_sample_delay = 2; |
656 | } else { | 656 | } else { |
657 | if (adapt >= 2 || adapt <= LRADC_DELAY_DELAY_MASK + 1) { | 657 | if (adapt >= 2 && adapt <= LRADC_DELAY_DELAY_MASK + 1) { |
658 | ts->over_sample_delay = adapt; | 658 | ts->over_sample_delay = adapt; |
659 | } else { | 659 | } else { |
660 | dev_err(ts->dev, "Invalid sample delay (%u)\n", | 660 | dev_err(ts->dev, "Invalid sample delay (%u)\n", |
@@ -666,7 +666,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev) | |||
666 | if (of_property_read_u32(node, "fsl,settling", &adapt)) { | 666 | if (of_property_read_u32(node, "fsl,settling", &adapt)) { |
667 | ts->settling_delay = 10; | 667 | ts->settling_delay = 10; |
668 | } else { | 668 | } else { |
669 | if (adapt >= 1 || adapt <= LRADC_DELAY_DELAY_MASK) { | 669 | if (adapt >= 1 && adapt <= LRADC_DELAY_DELAY_MASK) { |
670 | ts->settling_delay = adapt; | 670 | ts->settling_delay = adapt; |
671 | } else { | 671 | } else { |
672 | dev_err(ts->dev, "Invalid settling delay (%u)\n", | 672 | dev_err(ts->dev, "Invalid settling delay (%u)\n", |