History

iio: st_sensors: Drop redundant parameter from st_sensors_of_name_probe()

Since we have access to the struct device_driver and thus to the ID table, there is no need to supply special parameters to st_sensors_of_name_probe(). Besides that we have a common API to get driver match data, there is no need to do matching separately for OF and ACPI. Taking into consideration above, simplify the ST sensors code.

Andy Shevchenko committed 6 years ago

Commit efc78981 parent e82507011 files · +25 −88Browse files

Showing the changes to include/linux (2 of 11 files). Show all

Unified · Split

2 files
  1. include/linux/iio/common/st_sensors.h +1 −11
  2. include/linux/iio/common/st_sensors_i2c.h +0 −10
include/linux/iio/common/st_sensors.h+1−11
@@ -315,16 +315,6 @@ ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev, · 314 unmodified lines
315315 ssize_t st_sensors_sysfs_scale_avail(struct device *dev,
316316 struct device_attribute *attr, char *buf);
317317
318−#ifdef CONFIG_OF
319−void st_sensors_of_name_probe(struct device *dev,
320− const struct of_device_id *match,
321− char *name, int len);
322−#else
323−static inline void st_sensors_of_name_probe(struct device *dev,
324− const struct of_device_id *match,
325− char *name, int len)
326−{
327−}
328−#endif
318+void st_sensors_dev_name_probe(struct device *dev, char *name, int len);
329319
330320 #endif /* ST_SENSORS_H */
include/linux/iio/common/st_sensors_i2c.h+0−10
@@ -12,18 +12,8 @@ · 11 unmodified lines
1212
1313 #include <linux/i2c.h>
1414 #include <linux/iio/common/st_sensors.h>
15−#include <linux/of.h>
1615
1716 int st_sensors_i2c_configure(struct iio_dev *indio_dev,
1817 struct i2c_client *client);
1918
20−#ifdef CONFIG_ACPI
21−int st_sensors_match_acpi_device(struct device *dev);
22−#else
23−static inline int st_sensors_match_acpi_device(struct device *dev)
24−{
25− return -ENODEV;
26−}
27−#endif
28−
2919 #endif /* ST_SENSORS_I2C_H */