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

Krzysztof Kozlowski posted 11 patches 3 weeks, 5 days ago
There is a newer version of this series
[PATCH 08/11] pinctrl: tegra-xusb: Return void in padctl enable/disable functions
Posted by Krzysztof Kozlowski 3 weeks, 5 days ago
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 <krzysztof.kozlowski@oss.qualcomm.com>
---
 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)

-- 
2.51.0
Re: [PATCH 08/11] pinctrl: tegra-xusb: Return void in padctl enable/disable functions
Posted by Thierry Reding 3 weeks, 3 days ago
On Wed, Jan 14, 2026 at 04:30:09PM +0100, 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 <krzysztof.kozlowski@oss.qualcomm.com>
> ---
>  drivers/pinctrl/tegra/pinctrl-tegra-xusb.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>
Re: [PATCH 08/11] pinctrl: tegra-xusb: Return void in padctl enable/disable functions
Posted by Jon Hunter 3 weeks, 5 days ago

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 <krzysztof.kozlowski@oss.qualcomm.com>
> ---
>   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 <jonathanh@nvidia.com>

Thanks
Jon

-- 
nvpublic