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
315ssize_t st_sensors_sysfs_scale_avail(struct device *dev,315ssize_t st_sensors_sysfs_scale_avail(struct device *dev,
316 struct device_attribute *attr, char *buf);316 struct device_attribute *attr, char *buf);
317 317
318#ifdef CONFIG_OF318void st_sensors_dev_name_probe(struct device *dev, char *name, int len);
319void st_sensors_of_name_probe(struct device *dev,
320 const struct of_device_id *match,
321 char *name, int len);
322#else
323static 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
329 319
330#endif /* ST_SENSORS_H */320#endif /* ST_SENSORS_H */
include/linux/iio/common/st_sensors_i2c.h+0−10
@@ -12,18 +12,8 @@ · 11 unmodified lines
12 12
13#include <linux/i2c.h>13#include <linux/i2c.h>
14#include <linux/iio/common/st_sensors.h>14#include <linux/iio/common/st_sensors.h>
15#include <linux/of.h>
16 15
17int st_sensors_i2c_configure(struct iio_dev *indio_dev,16int st_sensors_i2c_configure(struct iio_dev *indio_dev,
18 struct i2c_client *client);17 struct i2c_client *client);
19 18
20#ifdef CONFIG_ACPI
21int st_sensors_match_acpi_device(struct device *dev);
22#else
23static inline int st_sensors_match_acpi_device(struct device *dev)
24{
25 return -ENODEV;
26}
27#endif
28
29#endif /* ST_SENSORS_I2C_H */19#endif /* ST_SENSORS_I2C_H */