Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Camel Guo <camel.guo@axis.com>, Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@axis.com
Subject: Re: [PATCH] hwmon: (tmp401) Add of_match_table
Date: Fri, 29 Apr 2022 09:22:25 -0700	[thread overview]
Message-ID: <737ea26d-2e25-b39b-af9b-190958008f8d@roeck-us.net> (raw)
In-Reply-To: <20220429095201.2932180-1-camel.guo@axis.com>

On 4/29/22 02:52, Camel Guo wrote:
> Add the missing of_match_table to allow device tree probing
> 

I2C devices probe based on the I2C device table even on devicetree systems,
so this isn't a correct statement. Please provide evidence and explain
in detail the circumstances where this does not work.

Guenter

> Signed-off-by: Camel Guo <camel.guo@axis.com>
> ---
>   drivers/hwmon/tmp401.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
> index a58a2f31a07e..cc0a1c219b1f 100644
> --- a/drivers/hwmon/tmp401.c
> +++ b/drivers/hwmon/tmp401.c
> @@ -750,10 +750,21 @@ static int tmp401_probe(struct i2c_client *client)
>   	return 0;
>   }
>   
> +static const struct of_device_id __maybe_unused tmp4xx_of_match[] = {
> +	{ .compatible = "ti,tmp401", },
> +	{ .compatible = "ti,tmp411", },
> +	{ .compatible = "ti,tmp431", },
> +	{ .compatible = "ti,tmp432", },
> +	{ .compatible = "ti,tmp435", },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, tmp4xx_of_match);
> +
>   static struct i2c_driver tmp401_driver = {
>   	.class		= I2C_CLASS_HWMON,
>   	.driver = {
>   		.name	= "tmp401",
> +		.of_match_table = of_match_ptr(tmp4xx_of_match),
>   	},
>   	.probe_new	= tmp401_probe,
>   	.id_table	= tmp401_id,


  reply	other threads:[~2022-04-29 16:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29  9:52 [PATCH] hwmon: (tmp401) Add of_match_table Camel Guo
2022-04-29 16:22 ` Guenter Roeck [this message]
2022-05-02  9:20   ` Camel Guo

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=737ea26d-2e25-b39b-af9b-190958008f8d@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=camel.guo@axis.com \
    --cc=jdelvare@suse.com \
    --cc=kernel@axis.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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