linux/drivers/iio/potentiometer
Julia Lawall ce7c637a83 iio: potentiometer: merge calls to of_match_device and of_device_get_match_data
Drop call to of_match_device, which is subsumed by the subsequent
call to of_device_get_match_data.  The code becomes simpler, and a
temporary variable can be dropped.

The semantic match that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
local idexpression match;
identifier i;
expression x, dev, e, e1;
@@
-        match@i = of_match_device(x, dev);
-        if (match) e = of_device_get_match_data(dev);
-        else e = e1;
+        e = of_device_get_match_data(dev);
+        if (!e) e = e1;

@@
identifier r.i;
@@
- const struct of_device_id *i;
... when != i
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-08-19 20:16:39 +01:00
..
ad5272.c iio: ad5272: Add support for Analog Devices digital potentiometers 2018-02-10 15:48:08 +00:00
ds1803.c iio: potentiometer: ds1803: Remove VLA usage 2018-03-10 15:02:41 +00:00
Kconfig iio: potentiometer: mcp4018: driver for Microchip digital potentiometers 2018-03-10 16:03:25 +00:00
Makefile iio: potentiometer: mcp4018: driver for Microchip digital potentiometers 2018-03-10 16:03:25 +00:00
max5481.c iio: potentiometer: merge calls to of_match_device and of_device_get_match_data 2018-08-19 20:16:39 +01:00
max5487.c iio:potentiometer:max5487: Drop explicit setting of module owner 2017-09-03 18:10:27 +01:00
mcp4018.c iio: potentiometer: merge calls to of_match_device and of_device_get_match_data 2018-08-19 20:16:39 +01:00
mcp4131.c iio:dpot: drop assign iio_info.driver_module 2017-08-22 21:34:10 +01:00
mcp4531.c iio: potentiometer: merge calls to of_match_device and of_device_get_match_data 2018-08-19 20:16:39 +01:00
tpl0102.c iio: add SPDX identifier for various drivers 2018-02-18 11:55:19 +00:00