From: Guenter Roeck <linux@roeck-us.net>
To: Armin Wolf <W_Armin@gmx.de>
Cc: jdelvare@suse.com, linux-hwmon@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] hwmon: Use struct definitions from header files
Date: Fri, 26 Aug 2022 05:23:29 -0700 [thread overview]
Message-ID: <20220826122329.GC2897306@roeck-us.net> (raw)
In-Reply-To: <20220825214341.2743-3-W_Armin@gmx.de>
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
>
prev parent reply other threads:[~2022-08-26 12:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 21:43 [PATCH 0/2] hwmon: Add include stubs Armin Wolf
2022-08-25 21:43 ` [PATCH 1/2] " Armin Wolf
2022-08-26 12:47 ` Guenter Roeck
2022-08-26 18:07 ` Armin Wolf
2022-08-25 21:43 ` [PATCH 2/2] hwmon: Use struct definitions from header files Armin Wolf
2022-08-26 12:23 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220826122329.GC2897306@roeck-us.net \
--to=linux@roeck-us.net \
--cc=W_Armin@gmx.de \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox