Skip to content

Commit

Permalink
Merge tag 'phy-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/phy/linux-phy into char-misc-linus

Vinod writes:

phy: fixes for 5.18

Fixes for bunch of drivers:
 - TI fixes for runtime disable, missing of_node_put and error handling
 - Samsung fixes for device_put and of_node_put
 - Amlogic error path handling

* tag 'phy-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy:
  phy: amlogic: fix error path in phy_g12a_usb3_pcie_probe()
  phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe
  phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe
  phy: ti: omap-usb2: Fix error handling in omap_usb2_enable_clocks
  phy: ti: tusb1210: Fix an error handling path in tusb1210_probe()
  phy: samsung: exynos5250-sata: fix missing device put in probe error paths
  phy: samsung: Fix missing of_node_put() in exynos_sata_phy_probe
  phy: ti: Fix missing of_node_put in ti_pipe3_get_sysctrl()
  phy: ti: tusb1210: Make tusb1210_chg_det_states static
  • Loading branch information
Greg Kroah-Hartman committed Apr 22, 2022
2 parents e90d20c + 2c8045d commit 2e043a2
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 20 deletions.
20 changes: 12 additions & 8 deletions drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,28 +414,32 @@ static int phy_g12a_usb3_pcie_probe(struct platform_device *pdev)

ret = clk_prepare_enable(priv->clk_ref);
if (ret)
goto err_disable_clk_ref;
return ret;

priv->reset = devm_reset_control_array_get_exclusive(dev);
if (IS_ERR(priv->reset))
return PTR_ERR(priv->reset);
if (IS_ERR(priv->reset)) {
ret = PTR_ERR(priv->reset);
goto err_disable_clk_ref;
}

priv->phy = devm_phy_create(dev, np, &phy_g12a_usb3_pcie_ops);
if (IS_ERR(priv->phy)) {
ret = PTR_ERR(priv->phy);
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to create PHY\n");

return ret;
dev_err_probe(dev, ret, "failed to create PHY\n");
goto err_disable_clk_ref;
}

phy_set_drvdata(priv->phy, priv);
dev_set_drvdata(dev, priv);

phy_provider = devm_of_phy_provider_register(dev,
phy_g12a_usb3_pcie_xlate);
if (IS_ERR(phy_provider)) {
ret = PTR_ERR(phy_provider);
goto err_disable_clk_ref;
}

return PTR_ERR_OR_ZERO(phy_provider);
return 0;

err_disable_clk_ref:
clk_disable_unprepare(priv->clk_ref);
Expand Down
3 changes: 2 additions & 1 deletion drivers/phy/motorola/phy-mapphone-mdm6600.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,8 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
cleanup:
if (error < 0)
phy_mdm6600_device_power_off(ddata);

pm_runtime_disable(ddata->dev);
pm_runtime_dont_use_autosuspend(ddata->dev);
return error;
}

Expand Down
21 changes: 15 additions & 6 deletions drivers/phy/samsung/phy-exynos5250-sata.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
return -EINVAL;

sata_phy->client = of_find_i2c_device_by_node(node);
of_node_put(node);
if (!sata_phy->client)
return -EPROBE_DEFER;

Expand All @@ -195,32 +196,40 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
sata_phy->phyclk = devm_clk_get(dev, "sata_phyctrl");
if (IS_ERR(sata_phy->phyclk)) {
dev_err(dev, "failed to get clk for PHY\n");
return PTR_ERR(sata_phy->phyclk);
ret = PTR_ERR(sata_phy->phyclk);
goto put_dev;
}

ret = clk_prepare_enable(sata_phy->phyclk);
if (ret < 0) {
dev_err(dev, "failed to enable source clk\n");
return ret;
goto put_dev;
}

sata_phy->phy = devm_phy_create(dev, NULL, &exynos_sata_phy_ops);
if (IS_ERR(sata_phy->phy)) {
clk_disable_unprepare(sata_phy->phyclk);
dev_err(dev, "failed to create PHY\n");
return PTR_ERR(sata_phy->phy);
ret = PTR_ERR(sata_phy->phy);
goto clk_disable;
}

phy_set_drvdata(sata_phy->phy, sata_phy);

phy_provider = devm_of_phy_provider_register(dev,
of_phy_simple_xlate);
if (IS_ERR(phy_provider)) {
clk_disable_unprepare(sata_phy->phyclk);
return PTR_ERR(phy_provider);
ret = PTR_ERR(phy_provider);
goto clk_disable;
}

return 0;

clk_disable:
clk_disable_unprepare(sata_phy->phyclk);
put_dev:
put_device(&sata_phy->client->dev);

return ret;
}

static const struct of_device_id exynos_sata_phy_of_match[] = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/phy/ti/phy-am654-serdes.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ static int serdes_am654_probe(struct platform_device *pdev)

clk_err:
of_clk_del_provider(node);

pm_runtime_disable(dev);
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/phy/ti/phy-omap-usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static int omap_usb2_enable_clocks(struct omap_usb *phy)
return 0;

err1:
clk_disable(phy->wkupclk);
clk_disable_unprepare(phy->wkupclk);

err0:
return ret;
Expand Down
1 change: 1 addition & 0 deletions drivers/phy/ti/phy-ti-pipe3.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ static int ti_pipe3_get_sysctrl(struct ti_pipe3 *phy)
}

control_pdev = of_find_device_by_node(control_node);
of_node_put(control_node);
if (!control_pdev) {
dev_err(dev, "Failed to get control device\n");
return -EINVAL;
Expand Down
12 changes: 9 additions & 3 deletions drivers/phy/ti/phy-tusb1210.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static int tusb1210_set_mode(struct phy *phy, enum phy_mode mode, int submode)
}

#ifdef CONFIG_POWER_SUPPLY
const char * const tusb1210_chg_det_states[] = {
static const char * const tusb1210_chg_det_states[] = {
"CHG_DET_CONNECTING",
"CHG_DET_START_DET",
"CHG_DET_READ_DET",
Expand Down Expand Up @@ -537,12 +537,18 @@ static int tusb1210_probe(struct ulpi *ulpi)
tusb1210_probe_charger_detect(tusb);

tusb->phy = ulpi_phy_create(ulpi, &phy_ops);
if (IS_ERR(tusb->phy))
return PTR_ERR(tusb->phy);
if (IS_ERR(tusb->phy)) {
ret = PTR_ERR(tusb->phy);
goto err_remove_charger;
}

phy_set_drvdata(tusb->phy, tusb);
ulpi_set_drvdata(ulpi, tusb);
return 0;

err_remove_charger:
tusb1210_remove_charger_detect(tusb);
return ret;
}

static void tusb1210_remove(struct ulpi *ulpi)
Expand Down

0 comments on commit 2e043a2

Please sign in to comment.