Skip to content

Commit 107a20e

Browse files
author
Izabela Bakollari
committed
net: phy: qca807x: fix compilation when CONFIG_GPIOLIB is not set
JIRA: https://issues.redhat.com/browse/RHEL-33716 commit 1677293 Author: Robert Marko <robimarko@gmail.com> Date: Tue Mar 5 15:20:33 2024 +0100 net: phy: qca807x: fix compilation when CONFIG_GPIOLIB is not set Kernel bot has discovered that if CONFIG_GPIOLIB is not set compilation will fail. Upon investigation the issue is that qca807x_gpio() is guarded by a preprocessor check but then it is called under if (IS_ENABLED(CONFIG_GPIOLIB)) in the probe call so the compiler will error out since qca807x_gpio() has not been declared if CONFIG_GPIOLIB has not been set. Fixes: d1cb613 ("net: phy: qcom: add support for QCA807x PHY Family") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202403031332.IGAbZzwq-lkp@intel.com/ Signed-off-by: Robert Marko <robimarko@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Tested-by: Simon Horman <horms@kernel.org> # build-tested Link: https://lore.kernel.org/r/20240305142113.795005-1-robimarko@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
1 parent 8c87727 commit 107a20e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

drivers/net/phy/qcom/qca807x.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -732,24 +732,24 @@ static int qca807x_probe(struct phy_device *phydev)
732732
priv->dac_disable_bias_current_tweak = of_property_read_bool(node,
733733
"qcom,dac-disable-bias-current-tweak");
734734

735-
if (IS_ENABLED(CONFIG_GPIOLIB)) {
736-
/* Make sure we don't have mixed leds node and gpio-controller
737-
* to prevent registering leds and having gpio-controller usage
738-
* conflicting with them.
739-
*/
740-
if (of_find_property(node, "leds", NULL) &&
741-
of_find_property(node, "gpio-controller", NULL)) {
742-
phydev_err(phydev, "Invalid property detected. LEDs and gpio-controller are mutually exclusive.");
743-
return -EINVAL;
744-
}
735+
#if IS_ENABLED(CONFIG_GPIOLIB)
736+
/* Make sure we don't have mixed leds node and gpio-controller
737+
* to prevent registering leds and having gpio-controller usage
738+
* conflicting with them.
739+
*/
740+
if (of_find_property(node, "leds", NULL) &&
741+
of_find_property(node, "gpio-controller", NULL)) {
742+
phydev_err(phydev, "Invalid property detected. LEDs and gpio-controller are mutually exclusive.");
743+
return -EINVAL;
744+
}
745745

746-
/* Do not register a GPIO controller unless flagged for it */
747-
if (of_property_read_bool(node, "gpio-controller")) {
748-
ret = qca807x_gpio(phydev);
749-
if (ret)
750-
return ret;
751-
}
746+
/* Do not register a GPIO controller unless flagged for it */
747+
if (of_property_read_bool(node, "gpio-controller")) {
748+
ret = qca807x_gpio(phydev);
749+
if (ret)
750+
return ret;
752751
}
752+
#endif
753753

754754
/* Attach SFP bus on combo port*/
755755
if (phy_read(phydev, QCA807X_CHIP_CONFIGURATION)) {

0 commit comments

Comments
 (0)