aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-tegra-xusb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pinctrl/pinctrl-tegra-xusb.c')
-rw-r--r--drivers/pinctrl/pinctrl-tegra-xusb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-tegra-xusb.c b/drivers/pinctrl/pinctrl-tegra-xusb.c
index a06620474845..e641b4226c42 100644
--- a/drivers/pinctrl/pinctrl-tegra-xusb.c
+++ b/drivers/pinctrl/pinctrl-tegra-xusb.c
@@ -680,7 +680,7 @@ static struct phy *tegra_xusb_padctl_xlate(struct device *dev,
680 if (args->args_count <= 0) 680 if (args->args_count <= 0)
681 return ERR_PTR(-EINVAL); 681 return ERR_PTR(-EINVAL);
682 682
683 if (index > ARRAY_SIZE(padctl->phys)) 683 if (index >= ARRAY_SIZE(padctl->phys))
684 return ERR_PTR(-EINVAL); 684 return ERR_PTR(-EINVAL);
685 685
686 return padctl->phys[index]; 686 return padctl->phys[index];
@@ -930,7 +930,8 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)
930 930
931 padctl->provider = devm_of_phy_provider_register(&pdev->dev, 931 padctl->provider = devm_of_phy_provider_register(&pdev->dev,
932 tegra_xusb_padctl_xlate); 932 tegra_xusb_padctl_xlate);
933 if (err < 0) { 933 if (IS_ERR(padctl->provider)) {
934 err = PTR_ERR(padctl->provider);
934 dev_err(&pdev->dev, "failed to register PHYs: %d\n", err); 935 dev_err(&pdev->dev, "failed to register PHYs: %d\n", err);
935 goto unregister; 936 goto unregister;
936 } 937 }