net: phy: qcom: qca807x: normalize return value of gpio_get
Subsystems (5)
PATCH v2 1/1 net: phy: qcom: qca807x: normalize return value of gpio_get
The GPIO get callback is expected to return 0 or 1 (or a negative error code). Ensure that the value returned by qca807x_gpio_get() is normalized to the [0, 1] range.
---
v2: add correct netdev tree prefix and "fixes" tag.
drivers/net/phy/qcom/qca807x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/qcom/qca807x.c +1 -1
@@ -375,7 +375,7 @@ static int qca807x_gpio_get(struct gpio_chip *gc, unsigned int offset) reg =QCA807X_MMD7_LED_FORCE_CTRL (offset); val =phy_read_mmd (priv->phy,MDIO_MMD_AN , reg); -return FIELD_GET (QCA807X_GPIO_FORCE_MODE_MASK , val); +return !!FIELD_GET (QCA807X_GPIO_FORCE_MODE_MASK , val); }static int qca807x_gpio_set (struct gpio_chip *gc,unsigned int offset,int value)
Signature · 5 lines
2.53.0.335.g19a08e0c02-goog -- Dmitry
Quoted 30 lines · Dmitry Torokhov
The GPIO get callback is expected to return 0 or 1 (or a negative error code). Ensure that the value returned by
qca807x_gpio_get()is normalized to the [0, 1] range.Fixes 86ef402d805d ("gpiolib: sanitize the return value of gpio_chip::get()")Signed-off-by Dmitry Torokhov <[email protected]>---
v2: add correct netdev tree prefix and "fixes" tag.
drivers/net/phy/qcom/qca807x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/phy/qcom/qca807x.c +1
-2@@ -375,7 +375,7 @@ static int qca807x_gpio_get(struct gpio_chip *gc, unsigned int offset) reg =QCA807X_MMD7_LED_FORCE_CTRL (offset); val =phy_read_mmd (priv->phy,MDIO_MMD_AN , reg); -return FIELD_GET (QCA807X_GPIO_FORCE_MODE_MASK , val); +return !!FIELD_GET (QCA807X_GPIO_FORCE_MODE_MASK , val); }static int qca807x_gpio_set (struct gpio_chip *gc,unsigned int offset,int value) --2.53.0.335.g19a08e0c02-goog
Quoted 3 lines
--
Dmitry
Quoted 6 lines · Dmitry Torokhov
The GPIO get callback is expected to return 0 or 1 (or a negative error code). Ensure that the value returned by
qca807x_gpio_get()is normalized to the [0, 1] range.Fixes 86ef402d805d ("gpiolib: sanitize the return value of gpio_chip::get()")Signed-off-by Dmitry Torokhov <[email protected]>
Yours,
Linus Walleij
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Wed, 18 Feb 2026 16:56:00 -0800 you wrote:
The GPIO get callback is expected to return 0 or 1 (or a negative error code). Ensure that the value returned by
qca807x_gpio_get()is normalized to the [0, 1] range.Fixes 86ef402d805d ("gpiolib: sanitize the return value of gpio_chip::get()")Signed-off-by Dmitry Torokhov <[email protected]>[...]
Here is the summary with links:
- [net,v2] net: phy: qcom: qca807x: normalize return value of gpio_get
https://git.kernel.org/netdev/net/c/2bb995e6155c
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html