Re: [PATCH v3 2/3] hwmon: (emc1403) Convert to use OF bindings

Uwe Kleine-König <[email protected]>
Newsgroups org.kernel.vger.linux-hwmon,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <amGz2YZogakb5XAv@monoceros>
Hello,

On Tue, Jul 21, 2026 at 12:59:34PM +0300, Svyatoslav Ryhel wrote:
> From: Jonas Schwöbel <[email protected]>
> 
> Add OF match compatible table to be able to use this driver with Device
> Trees.
> 
> Signed-off-by: Jonas Schwöbel <[email protected]>
> Signed-off-by: Svyatoslav Ryhel <[email protected]>
> Reviewed-by: Guenter Roeck <[email protected]>

Please put your S-o-b line last.

> ---
>  drivers/hwmon/emc1403.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/emc1403.c b/drivers/hwmon/emc1403.c
> index cd753b38709f2..b7ab6069ec7b1 100644
> --- a/drivers/hwmon/emc1403.c
> +++ b/drivers/hwmon/emc1403.c
> @@ -16,6 +16,7 @@
>  #include <linux/hwmon.h>
>  #include <linux/hwmon-sysfs.h>
>  #include <linux/err.h>
> +#include <linux/mod_devicetable.h>

Don't add <linux/mod_devicetable.h> please. struct of_device_id is also
provided by <linux/i2c.h> so adding <linux/mod_devicetable.h> isn't
needed.

>  #include <linux/sysfs.h>
>  #include <linux/regmap.h>
>  #include <linux/util_macros.h>
> [...]
> @@ -682,10 +683,21 @@ static const unsigned short emc1403_address_list[] = {
>  	0x18, 0x1c, 0x29, 0x3c, 0x4c, 0x4d, 0x5c, I2C_CLIENT_END
>  };
>  
> +static const struct of_device_id emc1403_of_match[] = {
> +	{ .compatible = "smsc,emc1402", .data = (void *)emc1402 },
> +	{ .compatible = "smsc,emc1403", .data = (void *)emc1403 },
> +	{ .compatible = "smsc,emc1404", .data = (void *)emc1404 },
> +	{ .compatible = "smsc,emc1428", .data = (void *)emc1428 },
> +	{ }
> +

Unusual empty line here.

> +};
> +MODULE_DEVICE_TABLE(of, emc1403_of_match);
> +

Best regards
Uwe
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmphtHEACgkQj4D7WH0S
/k4H9Qf/eIS4Qz8jNjTZB5EcrdJYqD0cdgZY44kCeDGMBB625M8vmpG7qAv2xnqF
0lGgOTpDoCEs+IgmNz8ISciUqEeY7PWmCge3u6jKZteesuUBX1tMrtnR5DPjVNUv
jV6gAM1O287rIzQjp59TZ6tcQe670H3YK+tZAZOIOgpCg5C8FNUOanj9B/sGgnn8
lF3XTCng+Kh6FacdHSPIEwi/FURNxIwy0aKXjPsxEse7EcC4fsTnmjHubUsWdtOm
r8cBcczstoZwosFPOMzSGgft070Ay2Xq2J18y7uYgjpK22gqxuxI6tXe4fucREy9
YSZUBJ9ebV0SVa8smQjX8NPHHGxKJA==
=n8hC
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.