All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon:q54sj108a2: the PMBUS_MFR_ID is actually 6 chars instead of 5
@ 2021-05-17 22:26 Chu Lin
  2021-05-17 22:28 ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Chu Lin @ 2021-05-17 22:26 UTC (permalink / raw)
  To: linchuyuan, jasonling, zhongqil, linux, jdelvare, linux-hwmon,
	linux-kernel
  Cc: Chu Lin

The PMBUS_MFR_ID block is actually 6 chars for q54sj108a2.
/sys/bus/i2c/drivers/q54sj108a2_test# iotools smbus_read8 $BUS $ADDR 0x99
0x06

Tested: Devices are able to bind to the q54sj108a2 driver successfully.

Signed-off-by: Chu Lin <linchuyuan@google.com>
---
 drivers/hwmon/pmbus/q54sj108a2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/q54sj108a2.c b/drivers/hwmon/pmbus/q54sj108a2.c
index aec512766c31..0976268b2670 100644
--- a/drivers/hwmon/pmbus/q54sj108a2.c
+++ b/drivers/hwmon/pmbus/q54sj108a2.c
@@ -299,7 +299,7 @@ static int q54sj108a2_probe(struct i2c_client *client)
 		dev_err(&client->dev, "Failed to read Manufacturer ID\n");
 		return ret;
 	}
-	if (ret != 5 || strncmp(buf, "DELTA", 5)) {
+	if (ret != 6 || strncmp(buf, "DELTA", 5)) {
 		buf[ret] = '\0';
 		dev_err(dev, "Unsupported Manufacturer ID '%s'\n", buf);
 		return -ENODEV;
-- 
2.31.1.751.gd2f1c929bd-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] hwmon:q54sj108a2: the PMBUS_MFR_ID is actually 6 chars instead of 5
  2021-05-17 22:26 [PATCH] hwmon:q54sj108a2: the PMBUS_MFR_ID is actually 6 chars instead of 5 Chu Lin
@ 2021-05-17 22:28 ` Guenter Roeck
  2021-05-17 22:32   ` Chu Lin
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2021-05-17 22:28 UTC (permalink / raw)
  To: Chu Lin, linchuyuan, jasonling, zhongqil, jdelvare, linux-hwmon,
	linux-kernel

On 5/17/21 3:26 PM, Chu Lin wrote:
> The PMBUS_MFR_ID block is actually 6 chars for q54sj108a2.
> /sys/bus/i2c/drivers/q54sj108a2_test# iotools smbus_read8 $BUS $ADDR 0x99
> 0x06
> 

What is the 6th character ? Should it be checked as well ?

> Tested: Devices are able to bind to the q54sj108a2 driver successfully.
> 
> Signed-off-by: Chu Lin <linchuyuan@google.com>
> ---
>   drivers/hwmon/pmbus/q54sj108a2.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/pmbus/q54sj108a2.c b/drivers/hwmon/pmbus/q54sj108a2.c
> index aec512766c31..0976268b2670 100644
> --- a/drivers/hwmon/pmbus/q54sj108a2.c
> +++ b/drivers/hwmon/pmbus/q54sj108a2.c
> @@ -299,7 +299,7 @@ static int q54sj108a2_probe(struct i2c_client *client)
>   		dev_err(&client->dev, "Failed to read Manufacturer ID\n");
>   		return ret;
>   	}
> -	if (ret != 5 || strncmp(buf, "DELTA", 5)) {
> +	if (ret != 6 || strncmp(buf, "DELTA", 5)) {
>   		buf[ret] = '\0';
>   		dev_err(dev, "Unsupported Manufacturer ID '%s'\n", buf);
>   		return -ENODEV;
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hwmon:q54sj108a2: the PMBUS_MFR_ID is actually 6 chars instead of 5
  2021-05-17 22:28 ` Guenter Roeck
@ 2021-05-17 22:32   ` Chu Lin
  2021-05-17 22:50     ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Chu Lin @ 2021-05-17 22:32 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linchuyuan, Jason Ling, Zhongqi Li, jdelvare, linux-hwmon, linux-kernel

On Mon, May 17, 2021 at 3:28 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On 5/17/21 3:26 PM, Chu Lin wrote:
> > The PMBUS_MFR_ID block is actually 6 chars for q54sj108a2.
> > /sys/bus/i2c/drivers/q54sj108a2_test# iotools smbus_read8 $BUS $ADDR 0x99
> > 0x06
> >
>
> What is the 6th character ? Should it be checked as well ?
>
The 6th char is \0. Do you suggest we check that as well?

Thanks,
Chu

> > Tested: Devices are able to bind to the q54sj108a2 driver successfully.
> >
> > Signed-off-by: Chu Lin <linchuyuan@google.com>
> > ---
> >   drivers/hwmon/pmbus/q54sj108a2.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/hwmon/pmbus/q54sj108a2.c b/drivers/hwmon/pmbus/q54sj108a2.c
> > index aec512766c31..0976268b2670 100644
> > --- a/drivers/hwmon/pmbus/q54sj108a2.c
> > +++ b/drivers/hwmon/pmbus/q54sj108a2.c
> > @@ -299,7 +299,7 @@ static int q54sj108a2_probe(struct i2c_client *client)
> >               dev_err(&client->dev, "Failed to read Manufacturer ID\n");
> >               return ret;
> >       }
> > -     if (ret != 5 || strncmp(buf, "DELTA", 5)) {
> > +     if (ret != 6 || strncmp(buf, "DELTA", 5)) {
> >               buf[ret] = '\0';
> >               dev_err(dev, "Unsupported Manufacturer ID '%s'\n", buf);
> >               return -ENODEV;
> >
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hwmon:q54sj108a2: the PMBUS_MFR_ID is actually 6 chars instead of 5
  2021-05-17 22:32   ` Chu Lin
@ 2021-05-17 22:50     ` Guenter Roeck
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2021-05-17 22:50 UTC (permalink / raw)
  To: Chu Lin
  Cc: linchuyuan, Jason Ling, Zhongqi Li, jdelvare, linux-hwmon, linux-kernel

On 5/17/21 3:32 PM, Chu Lin wrote:
> On Mon, May 17, 2021 at 3:28 PM Guenter Roeck <linux@roeck-us.net> wrote:
>>
>> On 5/17/21 3:26 PM, Chu Lin wrote:
>>> The PMBUS_MFR_ID block is actually 6 chars for q54sj108a2.
>>> /sys/bus/i2c/drivers/q54sj108a2_test# iotools smbus_read8 $BUS $ADDR 0x99
>>> 0x06
>>>
>>
>> What is the 6th character ? Should it be checked as well ?
>>
> The 6th char is \0. Do you suggest we check that as well?
> 
No, that would be a bit pointless. I'll apply the patch.

Thanks,
Guenter


> Thanks,
> Chu
> 
>>> Tested: Devices are able to bind to the q54sj108a2 driver successfully.
>>>
>>> Signed-off-by: Chu Lin <linchuyuan@google.com>
>>> ---
>>>    drivers/hwmon/pmbus/q54sj108a2.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/hwmon/pmbus/q54sj108a2.c b/drivers/hwmon/pmbus/q54sj108a2.c
>>> index aec512766c31..0976268b2670 100644
>>> --- a/drivers/hwmon/pmbus/q54sj108a2.c
>>> +++ b/drivers/hwmon/pmbus/q54sj108a2.c
>>> @@ -299,7 +299,7 @@ static int q54sj108a2_probe(struct i2c_client *client)
>>>                dev_err(&client->dev, "Failed to read Manufacturer ID\n");
>>>                return ret;
>>>        }
>>> -     if (ret != 5 || strncmp(buf, "DELTA", 5)) {
>>> +     if (ret != 6 || strncmp(buf, "DELTA", 5)) {
>>>                buf[ret] = '\0';
>>>                dev_err(dev, "Unsupported Manufacturer ID '%s'\n", buf);
>>>                return -ENODEV;
>>>
>>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-17 22:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17 22:26 [PATCH] hwmon:q54sj108a2: the PMBUS_MFR_ID is actually 6 chars instead of 5 Chu Lin
2021-05-17 22:28 ` Guenter Roeck
2021-05-17 22:32   ` Chu Lin
2021-05-17 22:50     ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.