From: Guenter Roeck <linux@roeck-us.net>
To: JuenKit_Yip@hotmail.com, jdelvare@suse.com,
krzysztof.kozlowki+dt@linaro.org, conor+dt@kernel.org,
broonie@kernel.org, vincent@vtremblay.dev, michal.simek@amd.com,
geert+renesas@glider.be
Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] hwmon: (sht3x) add device-tree support
Date: Sat, 24 Jun 2023 09:34:57 -0700 [thread overview]
Message-ID: <cb2f59a0-4054-c8a4-9d75-0ea354b92e3b@roeck-us.net> (raw)
In-Reply-To: <DB4PR10MB62616C555E4D76672BDC6B7B9220A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM>
On 6/24/23 09:01, JuenKit_Yip@hotmail.com wrote:
> From: JuenKit Yip <JuenKit_Yip@hotmail.com>
>
> add "compatible" property for supporting device-tree
>
> Signed-off-by: JuenKit Yip <JuenKit_Yip@hotmail.com>
> ---
> drivers/hwmon/sht3x.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/sht3x.c b/drivers/hwmon/sht3x.c
> index 9b2dadd11eeb..e7648c011e5f 100644
> --- a/drivers/hwmon/sht3x.c
> +++ b/drivers/hwmon/sht3x.c
> @@ -925,8 +925,18 @@ static const struct i2c_device_id sht3x_ids[] = {
>
> MODULE_DEVICE_TABLE(i2c, sht3x_ids);
>
> +/* devicetree ID table */
> +static const struct of_device_id sht3x_of_match[] = {
> + { .compatible = "sensirion,sht3x" },
> + { .compatible = "sensirion,sts3x" },
> + {},
> +};
Add
MODULE_DEVICE_TABLE(of, sht3x_of_match);
> +
> static struct i2c_driver sht3x_i2c_driver = {
> - .driver.name = "sht3x",
> + .driver = {
> + .name = "sht3x",
> + .of_match_table = of_match_ptr(sht3x_of_match),
Drop of_match_ptr().
> + },
> .probe = sht3x_probe,
> .id_table = sht3x_ids,
> };
next prev parent reply other threads:[~2023-06-24 16:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230624160148.218786-1-JuenKit_Yip@hotmail.com>
2023-06-24 16:01 ` JuenKit_Yip
2023-06-24 16:34 ` Guenter Roeck [this message]
2023-06-24 16:01 ` [PATCH 3/3] dt-bindings: <hwmon>: add sht3x devicetree binding JuenKit_Yip
2023-06-24 16:36 ` Guenter Roeck
2023-06-24 17:25 ` Rob Herring
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=cb2f59a0-4054-c8a4-9d75-0ea354b92e3b@roeck-us.net \
--to=linux@roeck-us.net \
--cc=JuenKit_Yip@hotmail.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=jdelvare@suse.com \
--cc=krzysztof.kozlowki+dt@linaro.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=vincent@vtremblay.dev \
/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®