Commit 77b57218 authored by Jon Hunter's avatar Jon Hunter Committed by Greg Kroah-Hartman

usb: gadget: tegra-xudc: Use dev_err_probe()

Rather than testing if the error code is -EPROBE_DEFER before printing
an error message, use dev_err_probe() instead to simplify the code.
Signed-off-by: default avatarJon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20210519163553.212682-2-jonathanh@nvidia.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 80a3c7f7
...@@ -3508,10 +3508,8 @@ static int tegra_xudc_phy_get(struct tegra_xudc *xudc) ...@@ -3508,10 +3508,8 @@ static int tegra_xudc_phy_get(struct tegra_xudc *xudc)
xudc->utmi_phy[i] = devm_phy_optional_get(xudc->dev, phy_name); xudc->utmi_phy[i] = devm_phy_optional_get(xudc->dev, phy_name);
if (IS_ERR(xudc->utmi_phy[i])) { if (IS_ERR(xudc->utmi_phy[i])) {
err = PTR_ERR(xudc->utmi_phy[i]); err = PTR_ERR(xudc->utmi_phy[i]);
if (err != -EPROBE_DEFER) dev_err_probe(xudc->dev, err,
dev_err(xudc->dev, "failed to get usb2-%d PHY: %d\n", "failed to get usb2-%d PHY\n", i);
i, err);
goto clean_up; goto clean_up;
} else if (xudc->utmi_phy[i]) { } else if (xudc->utmi_phy[i]) {
/* Get usb-phy, if utmi phy is available */ /* Get usb-phy, if utmi phy is available */
...@@ -3538,10 +3536,8 @@ static int tegra_xudc_phy_get(struct tegra_xudc *xudc) ...@@ -3538,10 +3536,8 @@ static int tegra_xudc_phy_get(struct tegra_xudc *xudc)
xudc->usb3_phy[i] = devm_phy_optional_get(xudc->dev, phy_name); xudc->usb3_phy[i] = devm_phy_optional_get(xudc->dev, phy_name);
if (IS_ERR(xudc->usb3_phy[i])) { if (IS_ERR(xudc->usb3_phy[i])) {
err = PTR_ERR(xudc->usb3_phy[i]); err = PTR_ERR(xudc->usb3_phy[i]);
if (err != -EPROBE_DEFER) dev_err_probe(xudc->dev, err,
dev_err(xudc->dev, "failed to get usb3-%d PHY: %d\n", "failed to get usb3-%d PHY\n", usb3);
usb3, err);
goto clean_up; goto clean_up;
} else if (xudc->usb3_phy[i]) } else if (xudc->usb3_phy[i])
dev_dbg(xudc->dev, "usb3-%d PHY registered", usb3); dev_dbg(xudc->dev, "usb3-%d PHY registered", usb3);
...@@ -3781,9 +3777,7 @@ static int tegra_xudc_probe(struct platform_device *pdev) ...@@ -3781,9 +3777,7 @@ static int tegra_xudc_probe(struct platform_device *pdev)
err = devm_clk_bulk_get(&pdev->dev, xudc->soc->num_clks, xudc->clks); err = devm_clk_bulk_get(&pdev->dev, xudc->soc->num_clks, xudc->clks);
if (err) { if (err) {
if (err != -EPROBE_DEFER) dev_err_probe(xudc->dev, err, "failed to request clocks\n");
dev_err(xudc->dev, "failed to request clocks: %d\n", err);
return err; return err;
} }
...@@ -3798,9 +3792,7 @@ static int tegra_xudc_probe(struct platform_device *pdev) ...@@ -3798,9 +3792,7 @@ static int tegra_xudc_probe(struct platform_device *pdev)
err = devm_regulator_bulk_get(&pdev->dev, xudc->soc->num_supplies, err = devm_regulator_bulk_get(&pdev->dev, xudc->soc->num_supplies,
xudc->supplies); xudc->supplies);
if (err) { if (err) {
if (err != -EPROBE_DEFER) dev_err_probe(xudc->dev, err, "failed to request regulators\n");
dev_err(xudc->dev, "failed to request regulators: %d\n", err);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment