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

iio: imu: inv_mpu6050: Make use of device properties

Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220203155920.18586-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
889bdfc3 1ef6ff6e

+4 -5
+4 -4
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
··· 9 9 #include <linux/iio/iio.h> 10 10 #include <linux/mod_devicetable.h> 11 11 #include <linux/module.h> 12 - #include <linux/of_device.h> 13 12 #include <linux/property.h> 13 + 14 14 #include "inv_mpu_iio.h" 15 15 16 16 static const struct regmap_config inv_mpu_regmap_config = { ··· 51 51 { 52 52 struct inv_mpu6050_state *st = iio_priv(indio_dev); 53 53 struct device *dev = indio_dev->dev.parent; 54 - struct device_node *mux_node; 54 + struct fwnode_handle *mux_node; 55 55 int ret; 56 56 57 57 /* ··· 65 65 case INV_MPU9150: 66 66 case INV_MPU9250: 67 67 case INV_MPU9255: 68 - mux_node = of_get_child_by_name(dev->of_node, "i2c-gate"); 68 + mux_node = device_get_named_child_node(dev, "i2c-gate"); 69 69 if (mux_node != NULL) { 70 70 st->magn_disabled = true; 71 71 dev_warn(dev, "disable internal use of magnetometer\n"); 72 72 } 73 - of_node_put(mux_node); 73 + fwnode_handle_put(mux_node); 74 74 break; 75 75 default: 76 76 break;
-1
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
··· 4 4 */ 5 5 #include <linux/mod_devicetable.h> 6 6 #include <linux/module.h> 7 - #include <linux/of.h> 8 7 #include <linux/property.h> 9 8 #include <linux/spi/spi.h> 10 9 #include <linux/regmap.h>