* [PATCH v1 0/3] iio: st_sensors: lsm9ds0: Miscellaneous cleanups
@ 2024-02-11 20:14 andy.shevchenko
2024-02-11 20:14 ` [PATCH v1 1/3] iio: st_sensors: lsm9ds0: Use dev_err_probe() everywhere andy.shevchenko
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: andy.shevchenko @ 2024-02-11 20:14 UTC (permalink / raw)
To: Andy Shevchenko, Marius Hoch, linux-iio, linux-kernel
Cc: Jonathan Cameron, Lars-Peter Clausen
Just a few ad-hoc cleanups. No functional changes intended.
Andy Shevchenko (3):
iio: st_sensors: lsm9ds0: Use dev_err_probe() everywhere
iio: st_sensors: lsm9ds0: Don't use "proxy" headers
iio: st_sensors: lsm9ds0: Use common style for terminator in ID tables
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h | 5 ++++-
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 21 +++++++++-----------
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 6 ++++--
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 4 +++-
4 files changed, 20 insertions(+), 16 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1 1/3] iio: st_sensors: lsm9ds0: Use dev_err_probe() everywhere
2024-02-11 20:14 [PATCH v1 0/3] iio: st_sensors: lsm9ds0: Miscellaneous cleanups andy.shevchenko
@ 2024-02-11 20:14 ` andy.shevchenko
2024-02-11 20:14 ` [PATCH v1 2/3] iio: st_sensors: lsm9ds0: Don't use "proxy" headers andy.shevchenko
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: andy.shevchenko @ 2024-02-11 20:14 UTC (permalink / raw)
To: Andy Shevchenko, Marius Hoch, linux-iio, linux-kernel
Cc: Jonathan Cameron, Lars-Peter Clausen
Use dev_err_probe() everywhere where it is appropriate.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
index e887b45cdbcd..7b9dc849f010 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
@@ -25,10 +25,9 @@ static int st_lsm9ds0_probe_accel(struct st_lsm9ds0 *lsm9ds0, struct regmap *reg
struct st_sensor_data *data;
settings = st_accel_get_settings(lsm9ds0->name);
- if (!settings) {
- dev_err(dev, "device name %s not recognized.\n", lsm9ds0->name);
- return -ENODEV;
- }
+ if (!settings)
+ return dev_err_probe(dev, -ENODEV, "device name %s not recognized.\n",
+ lsm9ds0->name);
lsm9ds0->accel = devm_iio_device_alloc(dev, sizeof(*data));
if (!lsm9ds0->accel)
@@ -51,10 +50,9 @@ static int st_lsm9ds0_probe_magn(struct st_lsm9ds0 *lsm9ds0, struct regmap *regm
struct st_sensor_data *data;
settings = st_magn_get_settings(lsm9ds0->name);
- if (!settings) {
- dev_err(dev, "device name %s not recognized.\n", lsm9ds0->name);
- return -ENODEV;
- }
+ if (!settings)
+ return dev_err_probe(dev, -ENODEV, "device name %s not recognized.\n",
+ lsm9ds0->name);
lsm9ds0->magn = devm_iio_device_alloc(dev, sizeof(*data));
if (!lsm9ds0->magn)
@@ -80,8 +78,7 @@ int st_lsm9ds0_probe(struct st_lsm9ds0 *lsm9ds0, struct regmap *regmap)
ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(regulator_names),
regulator_names);
if (ret)
- return dev_err_probe(dev, ret,
- "unable to enable Vdd supply\n");
+ return dev_err_probe(dev, ret, "unable to enable Vdd supply\n");
/* Setup accelerometer device */
ret = st_lsm9ds0_probe_accel(lsm9ds0, regmap);
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v1 2/3] iio: st_sensors: lsm9ds0: Don't use "proxy" headers
2024-02-11 20:14 [PATCH v1 0/3] iio: st_sensors: lsm9ds0: Miscellaneous cleanups andy.shevchenko
2024-02-11 20:14 ` [PATCH v1 1/3] iio: st_sensors: lsm9ds0: Use dev_err_probe() everywhere andy.shevchenko
@ 2024-02-11 20:14 ` andy.shevchenko
2024-02-11 20:14 ` [PATCH v1 3/3] iio: st_sensors: lsm9ds0: Use common style for terminator in ID tables andy.shevchenko
2024-02-16 14:51 ` [PATCH v1 0/3] iio: st_sensors: lsm9ds0: Miscellaneous cleanups Jonathan Cameron
3 siblings, 0 replies; 5+ messages in thread
From: andy.shevchenko @ 2024-02-11 20:14 UTC (permalink / raw)
To: Andy Shevchenko, Marius Hoch, linux-iio, linux-kernel
Cc: Jonathan Cameron, Lars-Peter Clausen
Update header inclusions to follow IWYU (Include What You Use)
principle.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h | 5 ++++-
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 4 ++--
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 4 +++-
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 4 +++-
4 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h
index 76678cdefb07..e67d31b48441 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h
@@ -4,9 +4,12 @@
#ifndef ST_LSM9DS0_H
#define ST_LSM9DS0_H
-struct iio_dev;
+struct device;
+struct regmap;
struct regulator;
+struct iio_dev;
+
struct st_lsm9ds0 {
struct device *dev;
const char *name;
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
index 7b9dc849f010..10c1b2ba7a3d 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
@@ -7,10 +7,10 @@
* Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
*/
-#include <linux/device.h>
+#include <linux/array_size.h>
+#include <linux/dev_printk.h>
#include <linux/err.h>
#include <linux/module.h>
-#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/iio/common/st_sensors.h>
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
index 61d855083aa0..ab8504286ba4 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
@@ -7,8 +7,10 @@
* Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
*/
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/gfp_types.h>
#include <linux/i2c.h>
-#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/regmap.h>
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
index 8cc041d56cf7..69e9135795a3 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
@@ -7,7 +7,9 @@
* Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
*/
-#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/gfp_types.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/regmap.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v1 3/3] iio: st_sensors: lsm9ds0: Use common style for terminator in ID tables
2024-02-11 20:14 [PATCH v1 0/3] iio: st_sensors: lsm9ds0: Miscellaneous cleanups andy.shevchenko
2024-02-11 20:14 ` [PATCH v1 1/3] iio: st_sensors: lsm9ds0: Use dev_err_probe() everywhere andy.shevchenko
2024-02-11 20:14 ` [PATCH v1 2/3] iio: st_sensors: lsm9ds0: Don't use "proxy" headers andy.shevchenko
@ 2024-02-11 20:14 ` andy.shevchenko
2024-02-16 14:51 ` [PATCH v1 0/3] iio: st_sensors: lsm9ds0: Miscellaneous cleanups Jonathan Cameron
3 siblings, 0 replies; 5+ messages in thread
From: andy.shevchenko @ 2024-02-11 20:14 UTC (permalink / raw)
To: Andy Shevchenko, Marius Hoch, linux-iio, linux-kernel
Cc: Jonathan Cameron, Lars-Peter Clausen
Use common style for a terminator entry in the ID tables.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
index ab8504286ba4..d03cec3b24fe 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
@@ -41,7 +41,7 @@ MODULE_DEVICE_TABLE(i2c, st_lsm9ds0_id_table);
static const struct acpi_device_id st_lsm9ds0_acpi_match[] = {
{"ACCL0001", (kernel_ulong_t)LSM303D_IMU_DEV_NAME},
- { },
+ {}
};
MODULE_DEVICE_TABLE(acpi, st_lsm9ds0_acpi_match);
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1 0/3] iio: st_sensors: lsm9ds0: Miscellaneous cleanups
2024-02-11 20:14 [PATCH v1 0/3] iio: st_sensors: lsm9ds0: Miscellaneous cleanups andy.shevchenko
` (2 preceding siblings ...)
2024-02-11 20:14 ` [PATCH v1 3/3] iio: st_sensors: lsm9ds0: Use common style for terminator in ID tables andy.shevchenko
@ 2024-02-16 14:51 ` Jonathan Cameron
3 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2024-02-16 14:51 UTC (permalink / raw)
To: andy.shevchenko; +Cc: Marius Hoch, linux-iio, linux-kernel, Lars-Peter Clausen
On Sun, 11 Feb 2024 22:14:31 +0200
andy.shevchenko@gmail.com wrote:
> Just a few ad-hoc cleanups. No functional changes intended.
All look good to me so applied.
Thanks,
Jonathan
>
> Andy Shevchenko (3):
> iio: st_sensors: lsm9ds0: Use dev_err_probe() everywhere
> iio: st_sensors: lsm9ds0: Don't use "proxy" headers
> iio: st_sensors: lsm9ds0: Use common style for terminator in ID tables
>
> drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h | 5 ++++-
> drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 21 +++++++++-----------
> drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 6 ++++--
> drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 4 +++-
> 4 files changed, 20 insertions(+), 16 deletions(-)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-02-16 14:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-11 20:14 [PATCH v1 0/3] iio: st_sensors: lsm9ds0: Miscellaneous cleanups andy.shevchenko
2024-02-11 20:14 ` [PATCH v1 1/3] iio: st_sensors: lsm9ds0: Use dev_err_probe() everywhere andy.shevchenko
2024-02-11 20:14 ` [PATCH v1 2/3] iio: st_sensors: lsm9ds0: Don't use "proxy" headers andy.shevchenko
2024-02-11 20:14 ` [PATCH v1 3/3] iio: st_sensors: lsm9ds0: Use common style for terminator in ID tables andy.shevchenko
2024-02-16 14:51 ` [PATCH v1 0/3] iio: st_sensors: lsm9ds0: Miscellaneous cleanups Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox