linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
Cc: "jdelvare@suse.com" <jdelvare@suse.com>,
	"manio@skyboo.net" <manio@skyboo.net>,
	"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] hwmon: (adt7475) Convert to use device_property APIs
Date: Wed, 19 Apr 2023 13:59:56 -0700	[thread overview]
Message-ID: <76ae207d-9872-95e9-277c-d98f5f979659@roeck-us.net> (raw)
In-Reply-To: <9ad2433a-676f-0a90-809c-f256d2b9ba79@alliedtelesis.co.nz>

On 4/19/23 13:49, Chris Packham wrote:
> 
> On 20/04/23 04:06, Guenter Roeck wrote:
>> On Wed, Apr 19, 2023 at 11:36:56AM +1200, Chris Packham wrote:
>>> Instead of of_property_read_*() use the equivalent
>>> device_property_read_*() API. This will allow these properties to be
>>> used on DT unaware platforms. For DT aware platforms this will be a
>>> noop.
>>>
>>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
>>> ---
>>>
>>> Notes:
>>>       This is an additional update for master from the preceeding bugfix
>>>       commit. I've not added a fixes tag for this one because I don't think
>>>       there will be a behaviour change for existing usages.
>>>       
>>>       I know we have one upcoming DT unaware platform that we may want to use
>>>       some of these properties via ACPI tables so I won't object if this ends
>>>       up on the stable track but I don't think it meets the criteria for
>>>       stable.
>>>
>>>    drivers/hwmon/adt7475.c | 8 ++++----
>>>    1 file changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
>>> index 6a6ebcc896b1..3b9289bc5997 100644
>>> --- a/drivers/hwmon/adt7475.c
>>> +++ b/drivers/hwmon/adt7475.c
>>> @@ -1468,7 +1468,7 @@ static int load_config3(const struct i2c_client *client, const char *propname)
>>>    	u8 config3;
>>>    	int ret;
>>>    
>>> -	ret = of_property_read_string(client->dev.of_node, propname, &function);
>>> +	ret = device_property_read_string(&client->dev, propname, &function);
>> Unfortunately that is a problem because the parameter passed to
>> load_config3 is a pointer to a const data structure and
>> device_property_read_string doesn't like that (afaics for
>> no good reason). You'll also have to change the client parameter
>> to load_config() and friends to not be const.
> 
> Not sure how I didn't notice that. Probably rushing to get the fix part out.
> 
> I do have a v3 that drops the const where needed to silence the warnings
> but I'll sit on that for now in the hope that your patch gets accepted.
> 

Sounds good to me. There is no hurry with this one, after all.

Thanks,
Guenter


  reply	other threads:[~2023-04-19 21:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18 23:36 [PATCH v2 0/2] hwmon: (adt7475) Handle DT unaware platforms Chris Packham
2023-04-18 23:36 ` [PATCH v2 1/2] hwmon: (adt7475) Use device_property APIs when configuring polarity Chris Packham
2023-04-19  3:57   ` Guenter Roeck
2023-04-19 15:54   ` Guenter Roeck
2023-04-18 23:36 ` [PATCH v2 2/2] hwmon: (adt7475) Convert to use device_property APIs Chris Packham
2023-04-19 12:48   ` kernel test robot
2023-04-19 16:06   ` Guenter Roeck
2023-04-19 20:49     ` Chris Packham
2023-04-19 20:59       ` Guenter Roeck [this message]
2023-04-21  4:33   ` kernel test robot
2023-04-21  6:15   ` kernel test robot
2023-04-30 12:49   ` Guenter Roeck

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=76ae207d-9872-95e9-277c-d98f5f979659@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Chris.Packham@alliedtelesis.co.nz \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manio@skyboo.net \
    /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;
as well as URLs for NNTP newsgroup(s).