Re: [PATCH v3 2/3] hwmon: (emc1403) Convert to use OF bindings
From: Uwe Kleine-König
Date: Thu Jul 23 2026 - 02:28:18 EST
Hello,
On Tue, Jul 21, 2026 at 12:59:34PM +0300, Svyatoslav Ryhel wrote:
> From: Jonas Schwöbel <jonasschwoebel@xxxxxxxx>
>
> Add OF match compatible table to be able to use this driver with Device
> Trees.
>
> Signed-off-by: Jonas Schwöbel <jonasschwoebel@xxxxxxxx>
> Signed-off-by: Svyatoslav Ryhel <clamor95@xxxxxxxxx>
> Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
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
Attachment:
signature.asc
Description: PGP signature