From: Guenter Roeck <linux@roeck-us.net>
To: Lukasz Majewski <lukma@nabladev.com>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (lm77) Provide of_match_table to allow module auto loading
Date: Fri, 13 Nov 2026 22:40:20 -0800 [thread overview]
Message-ID: <c26e6dfa-c93d-4995-8d9b-69017c116e96@roeck-us.net> (raw)
In-Reply-To: <20261113130133.4094280-1-lukma@nabladev.com>
On 11/13/26 05:01, Lukasz Majewski wrote:
> When lm77 is built as a module and it is properly described in the
> board's DTS file (i.e. with proper compatible) it is required to have
> the in-driver compatible definition as well to allow automatic loading
> of it.
>
> Up till now the lm77 used I2C discovery fallback routine to bind it with
> its name.
>
> Signed-off-by: Lukasz Majewski <lukma@nabladev.com>
> ---
> drivers/hwmon/lm77.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/hwmon/lm77.c b/drivers/hwmon/lm77.c
> index 1f8402be599c..440dd91de39d 100644
> --- a/drivers/hwmon/lm77.c
> +++ b/drivers/hwmon/lm77.c
> @@ -336,6 +336,12 @@ static int lm77_probe(struct i2c_client *client)
> return PTR_ERR_OR_ZERO(hwmon_dev);
> }
>
> +static const struct of_device_id lm77_of_match[] = {
Requires "#include linux/mod_devicetable.h"
Guenter
> + { .compatible = "national,lm77" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, lm77_of_match);
> +
> static const struct i2c_device_id lm77_id[] = {
> { .name = "lm77" },
> { }
> @@ -347,6 +353,7 @@ static struct i2c_driver lm77_driver = {
> .class = I2C_CLASS_HWMON,
> .driver = {
> .name = "lm77",
> + .of_match_table = lm77_of_match,
> },
> .probe = lm77_probe,
> .id_table = lm77_id,
prev parent reply other threads:[~2026-11-14 6:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 13:01 Lukasz Majewski
2026-11-14 6:40 ` 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=c26e6dfa-c93d-4995-8d9b-69017c116e96@roeck-us.net \
--to=linux@roeck-us.net \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukma@nabladev.com \
/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
all inboxes | Powered by JetHome®