diff mbox series

[2/2] hwmon: Use struct definitions from header files

Message ID 20220825214341.2743-3-W_Armin@gmx.de (mailing list archive)
State Rejected
Headers show
Series hwmon: Add include stubs | expand

Commit Message

Armin Wolf Aug. 25, 2022, 9:43 p.m. UTC
The structs attribute_group and device are provided
by linux/sysfs.h and linux/device.h.
Use those definitions.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
 include/linux/hwmon.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--
2.30.2

Comments

Guenter Roeck Aug. 26, 2022, 12:23 p.m. UTC | #1
On Thu, Aug 25, 2022 at 11:43:41PM +0200, Armin Wolf wrote:
> The structs attribute_group and device are provided
> by linux/sysfs.h and linux/device.h.
> Use those definitions.
> 

No. The limited definitions are on purpose, meaning the details
are not needed in this header file and that drivers using the
structures must include the necessary files directly. That is what
struct declarations without details are to be used for in C, and
there is neither a desire nor need to change that code.

Guenter

> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
> ---
>  include/linux/hwmon.h | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h
> index 281387ee03bc..e8acc35af12d 100644
> --- a/include/linux/hwmon.h
> +++ b/include/linux/hwmon.h
> @@ -13,12 +13,11 @@
>  #define _HWMON_H_
> 
>  #include <linux/bitops.h>
> +#include <linux/device.h>
>  #include <linux/err.h>
>  #include <linux/errno.h>
>  #include <linux/kconfig.h>
> -
> -struct device;
> -struct attribute_group;
> +#include <linux/sysfs.h>
> 
>  enum hwmon_sensor_types {
>  	hwmon_chip,
> --
> 2.30.2
>
diff mbox series

Patch

diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h
index 281387ee03bc..e8acc35af12d 100644
--- a/include/linux/hwmon.h
+++ b/include/linux/hwmon.h
@@ -13,12 +13,11 @@ 
 #define _HWMON_H_

 #include <linux/bitops.h>
+#include <linux/device.h>
 #include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/kconfig.h>
-
-struct device;
-struct attribute_group;
+#include <linux/sysfs.h>

 enum hwmon_sensor_types {
 	hwmon_chip,