Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio:health:max30102: Drop of_match_ptr and use generic fw accessors

This enables use of the driver with ACPI PRP0001 and also removes
an antipattern that I am trying to clear out of IIO to avoid
it being copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200910173242.621168-39-jic23@kernel.org

+5 -6
+5 -6
drivers/iio/health/max30102.c
··· 19 19 #include <linux/irq.h> 20 20 #include <linux/i2c.h> 21 21 #include <linux/mutex.h> 22 - #include <linux/of.h> 22 + #include <linux/mod_devicetable.h> 23 23 #include <linux/regmap.h> 24 24 #include <linux/iio/iio.h> 25 25 #include <linux/iio/buffer.h> ··· 323 323 static int max30102_led_init(struct max30102_data *data) 324 324 { 325 325 struct device *dev = &data->client->dev; 326 - struct device_node *np = dev->of_node; 327 326 unsigned int val; 328 327 int reg, ret; 329 328 330 - ret = of_property_read_u32(np, "maxim,red-led-current-microamp", &val); 329 + ret = device_property_read_u32(dev, "maxim,red-led-current-microamp", &val); 331 330 if (ret) { 332 331 dev_info(dev, "no red-led-current-microamp set\n"); 333 332 ··· 345 346 return ret; 346 347 347 348 if (data->chip_id == max30105) { 348 - ret = of_property_read_u32(np, 349 + ret = device_property_read_u32(dev, 349 350 "maxim,green-led-current-microamp", &val); 350 351 if (ret) { 351 352 dev_info(dev, "no green-led-current-microamp set\n"); ··· 367 368 return ret; 368 369 } 369 370 370 - ret = of_property_read_u32(np, "maxim,ir-led-current-microamp", &val); 371 + ret = device_property_read_u32(dev, "maxim,ir-led-current-microamp", &val); 371 372 if (ret) { 372 373 dev_info(dev, "no ir-led-current-microamp set\n"); 373 374 ··· 623 624 static struct i2c_driver max30102_driver = { 624 625 .driver = { 625 626 .name = MAX30102_DRV_NAME, 626 - .of_match_table = of_match_ptr(max30102_dt_ids), 627 + .of_match_table = max30102_dt_ids, 627 628 }, 628 629 .probe = max30102_probe, 629 630 .remove = max30102_remove,