Re: [PATCH 08/11] pinctrl: tegra-xusb: Return void in padctl enable/disable functions

Jon Hunter <[email protected]>
Newsgroups dev.linux.lists.sophgo,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-rockchip,org.kernel.vger.linux-gpio,org.kernel.vger.linux-kernel,org.kernel.vger.linux-tegra,org.ozlabs.lists.linux-aspeed,org.ozlabs.lists.openbmc
Message-ID <[email protected]>

On 14/01/2026 15:30, Krzysztof Kozlowski wrote:
> Make the padctl functions a bit simpler by returning void instead of
> always '0'.  The callers - phy init/exit - still need to return 0, but
> these are smaller function without if/branching.
> 
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
>   drivers/pinctrl/tegra/pinctrl-tegra-xusb.c | 14 ++++++++------
>   1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c b/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
> index 49c5edeba87f..34a373f7e04d 100644
> --- a/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
> +++ b/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
> @@ -474,7 +474,7 @@ static const struct pinconf_ops tegra_xusb_padctl_pinconf_ops = {
>   #endif
>   };
>   
> -static int tegra_xusb_padctl_enable(struct tegra_xusb_padctl *padctl)
> +static void tegra_xusb_padctl_enable(struct tegra_xusb_padctl *padctl)
>   {
>   	u32 value;
>   
> @@ -501,10 +501,9 @@ static int tegra_xusb_padctl_enable(struct tegra_xusb_padctl *padctl)
>   
>   out:
>   	mutex_unlock(&padctl->lock);
> -	return 0;
>   }
>   
> -static int tegra_xusb_padctl_disable(struct tegra_xusb_padctl *padctl)
> +static void tegra_xusb_padctl_disable(struct tegra_xusb_padctl *padctl)
>   {
>   	u32 value;
>   
> @@ -534,21 +533,24 @@ static int tegra_xusb_padctl_disable(struct tegra_xusb_padctl *padctl)
>   
>   out:
>   	mutex_unlock(&padctl->lock);
> -	return 0;
>   }
>   
>   static int tegra_xusb_phy_init(struct phy *phy)
>   {
>   	struct tegra_xusb_padctl *padctl = phy_get_drvdata(phy);
>   
> -	return tegra_xusb_padctl_enable(padctl);
> +	tegra_xusb_padctl_enable(padctl);
> +
> +	return 0;
>   }
>   
>   static int tegra_xusb_phy_exit(struct phy *phy)
>   {
>   	struct tegra_xusb_padctl *padctl = phy_get_drvdata(phy);
>   
> -	return tegra_xusb_padctl_disable(padctl);
> +	tegra_xusb_padctl_disable(padctl);
> +
> +	return 0;
>   }
>   
>   static int pcie_phy_power_on(struct phy *phy)
> 

Reviewed-by: Jon Hunter <[email protected]>

Thanks
Jon

-- 
nvpublic
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.