Re: [PATCH] net: phy: qcom: qca807x: normalize return value of gpio_get
From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-02-18 23:12:01
Also in:
linux-arm-msm, linux-gpio, lkml
From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-02-18 23:12:01
Also in:
linux-arm-msm, linux-gpio, lkml
On Wed, Feb 18, 2026 at 03:01:22PM -0800, Dmitry Torokhov wrote:
On February 18, 2026 2:55:32 PM PST, Andrew Lunn [off-list ref] wrote:quoted
On Wed, Feb 18, 2026 at 12:57:17PM -0800, Dmitry Torokhov wrote:quoted
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. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>This appears to be a fix. Please add a Fixes: tag. Also, please put net into the Subject. https://www.kernel.org/doc/html/latest/process/maintainer-netdev.htmlWill do, however I am not sure what should be tagged as "Fixes" - original driver commit or the change in gpiolib tightening the checks?
commit 60befd2ea1c2061775838ea7bac5cc2b1353afd0 Author: Vladimir Zapolskiy [off-list ref] Date: Tue Dec 22 16:37:28 2015 +0200 suggests the check is to do with bugs when you have 32 GPIOs, and so the top bit for the 31st GPIO turns the value negative and results in an error code. However, this driver only has 2 GPIOs, so it is not an issue. So i would go for when the gpiolib tightened up the checks. Andrew