Skip to content

Commit 0899bab

Browse files
krzklinusw
authored andcommitted
pinctrl: tegra-xusb: Return void in padctl enable/disable functions
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. Acked-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
1 parent b339e1d commit 0899bab

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

drivers/pinctrl/tegra/pinctrl-tegra-xusb.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ static const struct pinconf_ops tegra_xusb_padctl_pinconf_ops = {
474474
#endif
475475
};
476476

477-
static int tegra_xusb_padctl_enable(struct tegra_xusb_padctl *padctl)
477+
static void tegra_xusb_padctl_enable(struct tegra_xusb_padctl *padctl)
478478
{
479479
u32 value;
480480

@@ -501,10 +501,9 @@ static int tegra_xusb_padctl_enable(struct tegra_xusb_padctl *padctl)
501501

502502
out:
503503
mutex_unlock(&padctl->lock);
504-
return 0;
505504
}
506505

507-
static int tegra_xusb_padctl_disable(struct tegra_xusb_padctl *padctl)
506+
static void tegra_xusb_padctl_disable(struct tegra_xusb_padctl *padctl)
508507
{
509508
u32 value;
510509

@@ -534,21 +533,24 @@ static int tegra_xusb_padctl_disable(struct tegra_xusb_padctl *padctl)
534533

535534
out:
536535
mutex_unlock(&padctl->lock);
537-
return 0;
538536
}
539537

540538
static int tegra_xusb_phy_init(struct phy *phy)
541539
{
542540
struct tegra_xusb_padctl *padctl = phy_get_drvdata(phy);
543541

544-
return tegra_xusb_padctl_enable(padctl);
542+
tegra_xusb_padctl_enable(padctl);
543+
544+
return 0;
545545
}
546546

547547
static int tegra_xusb_phy_exit(struct phy *phy)
548548
{
549549
struct tegra_xusb_padctl *padctl = phy_get_drvdata(phy);
550550

551-
return tegra_xusb_padctl_disable(padctl);
551+
tegra_xusb_padctl_disable(padctl);
552+
553+
return 0;
552554
}
553555

554556
static int pcie_phy_power_on(struct phy *phy)

0 commit comments

Comments
 (0)