Skip to content

Commit d02a7eb

Browse files
MrVanvinodkoul
authored andcommitted
phy: phy-can-transceiver: Drop the gpio desc check
gpiod_set_value_cansleep has an internal check on gpio_desc using 'VALIDATE_DESC(desc)', the check before invoking gpiod_set_value_cansleep could be removed. Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Link: https://patch.msgid.link/20251001-can-v7-4-fad29efc3884@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 6e9fe94 commit d02a7eb

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

drivers/phy/phy-can-transceiver.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@ static int can_transceiver_phy_power_on(struct phy *phy)
4747
return ret;
4848
}
4949
}
50-
if (can_transceiver_phy->standby_gpio)
51-
gpiod_set_value_cansleep(can_transceiver_phy->standby_gpio, 0);
52-
if (can_transceiver_phy->enable_gpio)
53-
gpiod_set_value_cansleep(can_transceiver_phy->enable_gpio, 1);
50+
gpiod_set_value_cansleep(can_transceiver_phy->standby_gpio, 0);
51+
gpiod_set_value_cansleep(can_transceiver_phy->enable_gpio, 1);
5452

5553
return 0;
5654
}
@@ -61,10 +59,8 @@ static int can_transceiver_phy_power_off(struct phy *phy)
6159
struct can_transceiver_phy *can_transceiver_phy = phy_get_drvdata(phy);
6260
struct can_transceiver_priv *priv = can_transceiver_phy->priv;
6361

64-
if (can_transceiver_phy->standby_gpio)
65-
gpiod_set_value_cansleep(can_transceiver_phy->standby_gpio, 1);
66-
if (can_transceiver_phy->enable_gpio)
67-
gpiod_set_value_cansleep(can_transceiver_phy->enable_gpio, 0);
62+
gpiod_set_value_cansleep(can_transceiver_phy->standby_gpio, 1);
63+
gpiod_set_value_cansleep(can_transceiver_phy->enable_gpio, 0);
6864
if (priv->mux_state)
6965
mux_state_deselect(priv->mux_state);
7066

0 commit comments

Comments
 (0)