linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] hwmon: (pmbus/fsp-3y) Fix functionality bitmask in FSP-3Y YM-2151E
@ 2023-04-20 17:19 Tomáš Pecka
  2023-04-20 18:19 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Tomáš Pecka @ 2023-04-20 17:19 UTC (permalink / raw)
  To: linux; +Cc: linux-hwmon, linux-kernel, Tomáš Pecka, Jan Kundrát

The bit flags in pmbus_driver_info functionality for YM-2151E chip were
joined with a comma operator instead of a bitwise OR. This means that
the last constant PMBUS_HAVE_IIN was not OR-ed with the other
PM_BUS_HAVE_* constants for this page but it initialized the next element
of the func array (which was not accessed from anywhere because of the
number of pages).

However, there is no need for setting PMBUS_HAVE_IIN in the 5Vsb page
because this command does not seem to be paged. Obviously, the device
only has one IIN sensor, so it doesn't make sense to query it again from
the second page.

Fixes: 1734b4135a62 ("hwmon: Add driver for fsp-3y PSUs and PDUs")
Co-developed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Signed-off-by: Tomáš Pecka <tomas.pecka@cesnet.cz>
---
 drivers/hwmon/pmbus/fsp-3y.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/fsp-3y.c b/drivers/hwmon/pmbus/fsp-3y.c
index aec294cc72d1..c7469d2cdedc 100644
--- a/drivers/hwmon/pmbus/fsp-3y.c
+++ b/drivers/hwmon/pmbus/fsp-3y.c
@@ -180,7 +180,6 @@ static struct pmbus_driver_info fsp3y_info[] = {
 			PMBUS_HAVE_FAN12,
 		.func[YM2151_PAGE_5VSB_LOG] =
 			PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT,
-			PMBUS_HAVE_IIN,
 		.read_word_data = fsp3y_read_word_data,
 		.read_byte_data = fsp3y_read_byte_data,
 	},
-- 
2.40.0


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

* Re: [PATCH 1/1] hwmon: (pmbus/fsp-3y) Fix functionality bitmask in FSP-3Y YM-2151E
  2023-04-20 17:19 [PATCH 1/1] hwmon: (pmbus/fsp-3y) Fix functionality bitmask in FSP-3Y YM-2151E Tomáš Pecka
@ 2023-04-20 18:19 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2023-04-20 18:19 UTC (permalink / raw)
  To: Tomáš Pecka; +Cc: linux-hwmon, linux-kernel, Jan Kundrát

On Thu, Apr 20, 2023 at 07:19:39PM +0200, Tomáš Pecka wrote:
> The bit flags in pmbus_driver_info functionality for YM-2151E chip were
> joined with a comma operator instead of a bitwise OR. This means that
> the last constant PMBUS_HAVE_IIN was not OR-ed with the other
> PM_BUS_HAVE_* constants for this page but it initialized the next element
> of the func array (which was not accessed from anywhere because of the
> number of pages).
> 
> However, there is no need for setting PMBUS_HAVE_IIN in the 5Vsb page
> because this command does not seem to be paged. Obviously, the device
> only has one IIN sensor, so it doesn't make sense to query it again from
> the second page.
> 
> Fixes: 1734b4135a62 ("hwmon: Add driver for fsp-3y PSUs and PDUs")
> Co-developed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
> Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>

FWIW, adding both Co-developed-by: and Signed-off-by: tags doesn't
make sense since Signed-off-by: implies Co-developed-by:.
I'll drop the first tag.

> Signed-off-by: Tomáš Pecka <tomas.pecka@cesnet.cz>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/pmbus/fsp-3y.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/hwmon/pmbus/fsp-3y.c b/drivers/hwmon/pmbus/fsp-3y.c
> index aec294cc72d1..c7469d2cdedc 100644
> --- a/drivers/hwmon/pmbus/fsp-3y.c
> +++ b/drivers/hwmon/pmbus/fsp-3y.c
> @@ -180,7 +180,6 @@ static struct pmbus_driver_info fsp3y_info[] = {
>  			PMBUS_HAVE_FAN12,
>  		.func[YM2151_PAGE_5VSB_LOG] =
>  			PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT,
> -			PMBUS_HAVE_IIN,
>  		.read_word_data = fsp3y_read_word_data,
>  		.read_byte_data = fsp3y_read_byte_data,
>  	},

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

end of thread, other threads:[~2023-04-20 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-20 17:19 [PATCH 1/1] hwmon: (pmbus/fsp-3y) Fix functionality bitmask in FSP-3Y YM-2151E Tomáš Pecka
2023-04-20 18:19 ` Guenter Roeck

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).