[PATCH v1 2/2] iio: imu: st_lsm9ds0: Replace device.h with what is needed

Andy Shevchenko posted 2 patches 1 year ago
[PATCH v1 2/2] iio: imu: st_lsm9ds0: Replace device.h with what is needed
Posted by Andy Shevchenko 1 year ago
Instead of including a huge device.h with tons of dependencies
include only what driver actually uses.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 2 +-
 drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
index d03cec3b24fe..2b1b57761688 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
@@ -7,7 +7,7 @@
  * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  */
 
-#include <linux/device.h>
+#include <linux/device/devres.h>
 #include <linux/err.h>
 #include <linux/gfp_types.h>
 #include <linux/i2c.h>
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
index 69e9135795a3..d3bfd74a69ab 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
@@ -7,7 +7,7 @@
  * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  */
 
-#include <linux/device.h>
+#include <linux/device/devres.h>
 #include <linux/err.h>
 #include <linux/gfp_types.h>
 #include <linux/module.h>
-- 
2.43.0.rc1.1336.g36b5255a03ac
Re: [PATCH v1 2/2] iio: imu: st_lsm9ds0: Replace device.h with what is needed
Posted by Raag Jadav 11 months ago
On Tue, Dec 03, 2024 at 09:48:52PM +0200, Andy Shevchenko wrote:
> Instead of including a huge device.h with tons of dependencies
> include only what driver actually uses.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 2 +-
>  drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
> index d03cec3b24fe..2b1b57761688 100644
> --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
> +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
> @@ -7,7 +7,7 @@
>   * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>   */
>  
> -#include <linux/device.h>
> +#include <linux/device/devres.h>
>  #include <linux/err.h>
>  #include <linux/gfp_types.h>
>  #include <linux/i2c.h>
> diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
> index 69e9135795a3..d3bfd74a69ab 100644
> --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
> +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
> @@ -7,7 +7,7 @@
>   * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>   */
>  
> -#include <linux/device.h>
> +#include <linux/device/devres.h>
>  #include <linux/err.h>
>  #include <linux/gfp_types.h>
>  #include <linux/module.h>

Isn't struct device still used in these files?

Raag
Re: [PATCH v1 2/2] iio: imu: st_lsm9ds0: Replace device.h with what is needed
Posted by Andy Shevchenko 11 months ago
On Tue, Jan 21, 2025 at 08:01:55AM +0200, Raag Jadav wrote:
> On Tue, Dec 03, 2024 at 09:48:52PM +0200, Andy Shevchenko wrote:

...

> Isn't struct device still used in these files?

Nope. The opaque pointer is used.

-- 
With Best Regards,
Andy Shevchenko