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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+vs47OPLdNbVcHzyfBQHDyUjg0cFAmJhT/cACgkQfBQHDyUj
 g0fAuQ/+Kkp8Lv9+s3EDue0EhElpypUZVpzFGHoUV/TxV48789F9dCv03h5eUE5q
 peG3M2JybnI+giff3xMXV4pRK9m8EOfp/3eitFmrJ/dAjuYEQhOxk5zFPYznW++T
 YZ/ozfjNDtwRu5BzF5joCd+YZJCnCw2A5xh0VeHKDI1vLedhf/ZNAcX5oLGuxayT
 q+QDfksmSHA0MlwXT7/l97nTh/tDX7/c5cWvj8WV9oX4L0Erd58Xr4skdpvaNvzS
 6dsi91suVhWKd78+Et4HWJMn+hOGpkOVRogUtCsiE4KU0xDA63prISV9nlOdMLvx
 fwYWgWeVXVChx2vN2WpygjdrkUP6Yc8zkQCqtUjYLn5fHfxKmPXia99tna6Hf3kL
 fIcDzOK2EWHito8AUKbtH+E0KUr6HRtnR/SNezpVmRzPc6sFBHoZ7ZDJQmdbE3fI
 xCugZwaYzsv+IHcNBKnEB3ox1Pot2u1J3WZcWRdj0+5qjRb9HrfW+6d7s0tbC024
 s0Y+p15p9gvDIf6WgMFKYgEm8uEESYuhn3CtZZCGxQxMZbOKzr4YwDJk416LzTQW
 uiyZUUhQl0TBia1XRsEwI9eOH6w4n8hoXrRTwz9iGSugXhcQi4XzCqR8dHcraj10
 HSq/z0+CsnDF1sLybCodRFuPIm7rJL8cqlneGX6zkb+WoBXiOec=
 =lZty
 -----END PGP SIGNATURE-----

Merge tag 'phy-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/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
This commit is contained in:
Greg Kroah-Hartman 2022-04-22 15:49:23 +02:00
commit 2e043a2ead
7 changed files with 41 additions and 20 deletions

View file

@ -414,19 +414,19 @@ 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);
@ -434,8 +434,12 @@ static int phy_g12a_usb3_pcie_probe(struct platform_device *pdev)
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);

View file

@ -629,7 +629,8 @@ idle:
cleanup:
if (error < 0)
phy_mdm6600_device_power_off(ddata);
pm_runtime_disable(ddata->dev);
pm_runtime_dont_use_autosuspend(ddata->dev);
return error;
}

View file

@ -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;
@ -195,20 +196,21 @@ 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);
@ -216,11 +218,18 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
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[] = {

View file

@ -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;
}

View file

@ -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;

View file

@ -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;

View file

@ -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",
@ -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)