diff mbox series

[02/12] iio:accel:bma180: Use generic device properties.

Message ID 20210611171355.202903-3-jic23@kernel.org (mailing list archive)
State New
Headers show
Series iio:accel: Header Cleanups. | expand

Commit Message

Jonathan Cameron June 11, 2021, 5:13 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Whilst doing header cleanup I noticed this driver makes very superficial
use of of_* interfaces.  Hence move to the generic firmware forms.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jonathan Bakker <xc-racer2@live.ca>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/iio/accel/bma180.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Linus Walleij June 11, 2021, 9:48 p.m. UTC | #1
On Fri, Jun 11, 2021 at 7:12 PM Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Whilst doing header cleanup I noticed this driver makes very superficial
> use of of_* interfaces.  Hence move to the generic firmware forms.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Jonathan Bakker <xc-racer2@live.ca>
> Cc: Linus Walleij <linus.walleij@linaro.org>

Looks correct!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
index 4a07e60c0e21..0e0d9317c084 100644
--- a/drivers/iio/accel/bma180.c
+++ b/drivers/iio/accel/bma180.c
@@ -17,8 +17,7 @@ 
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
-#include <linux/of_device.h>
-#include <linux/of.h>
+#include <linux/property.h>
 #include <linux/bitops.h>
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
@@ -995,8 +994,8 @@  static int bma180_probe(struct i2c_client *client,
 	data = iio_priv(indio_dev);
 	i2c_set_clientdata(client, indio_dev);
 	data->client = client;
-	if (client->dev.of_node)
-		chip = (enum chip_ids)of_device_get_match_data(dev);
+	if (dev_fwnode(dev))
+		chip = (enum chip_ids)device_get_match_data(dev);
 	else
 		chip = id->driver_data;
 	data->part_info = &bma180_part_info[chip];