Re: [PATCH] hwmon: (ltc2947) Make ltc2947.h self-contained
From: Guenter Roeck
Date: Mon Nov 16 2026 - 14:27:20 EST
On Mon, Nov 16, 2026 at 07:09:50PM +0100, Uwe Kleine-König wrote:
> When ltc2947.h is included without a previous definition of
> of_device_id, the compiler wails:
>
> drivers/hwmon/ltc2947.h:11:34: error: array type has incomplete element type ‘struct of_device_id’
> 11 | extern const struct of_device_id ltc2947_of_match[];
> | ^~~~~~~~~~~~~~~~
>
> A forward declaration is not enough to fix that, so include the header
> providing `struct of_device_id`.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>
Applied.
Thanks,
Guenter
> ---
> drivers/hwmon/ltc2947.h | 2 ++
> 1 file changed, 2 insertions(+)
>
>
> base-commit: 84abb955b1015477aa11a96e2f3ac1b938b77f48
>
> diff --git a/drivers/hwmon/ltc2947.h b/drivers/hwmon/ltc2947.h
> index 5b8ff81a3dba..eb3613f4d4cd 100644
> --- a/drivers/hwmon/ltc2947.h
> +++ b/drivers/hwmon/ltc2947.h
> @@ -2,6 +2,8 @@
> #ifndef _LINUX_LTC2947_H
> #define _LINUX_LTC2947_H
>
> +#include <linux/device-id/of.h>
> +
> struct regmap;
>
> extern const struct of_device_id ltc2947_of_match[];