From: Andy Shevchenko Date: Thu, 3 Feb 2022 15:59:20 +0000 (+0200) Subject: iio: imu: inv_mpu6050: Make use of device properties X-Git-Tag: v6.6.17~7878^2~55^2~163 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=889bdfc336392b904f7da441908d833556eaf438;p=platform%2Fkernel%2Flinux-rpi.git 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 Link: https://lore.kernel.org/r/20220203155920.18586-3-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c index ccb06d9..55cffb5 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c @@ -9,8 +9,8 @@ #include #include #include -#include #include + #include "inv_mpu_iio.h" static const struct regmap_config inv_mpu_regmap_config = { @@ -51,7 +51,7 @@ static int inv_mpu_i2c_aux_setup(struct iio_dev *indio_dev) { struct inv_mpu6050_state *st = iio_priv(indio_dev); struct device *dev = indio_dev->dev.parent; - struct device_node *mux_node; + struct fwnode_handle *mux_node; int ret; /* @@ -65,12 +65,12 @@ static int inv_mpu_i2c_aux_setup(struct iio_dev *indio_dev) case INV_MPU9150: case INV_MPU9250: case INV_MPU9255: - mux_node = of_get_child_by_name(dev->of_node, "i2c-gate"); + mux_node = device_get_named_child_node(dev, "i2c-gate"); if (mux_node != NULL) { st->magn_disabled = true; dev_warn(dev, "disable internal use of magnetometer\n"); } - of_node_put(mux_node); + fwnode_handle_put(mux_node); break; default: break; diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c index 44b4f74..26a7c25 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c @@ -4,7 +4,6 @@ */ #include #include -#include #include #include #include