Skip to content

Commit 2e043a2

Browse files
committed
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
2 parents e90d20c + 2c8045d commit 2e043a2

File tree

7 files changed

+41
-20
lines changed

7 files changed

+41
-20
lines changed

drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -414,28 +414,32 @@ static int phy_g12a_usb3_pcie_probe(struct platform_device *pdev)
414414

415415
ret = clk_prepare_enable(priv->clk_ref);
416416
if (ret)
417-
goto err_disable_clk_ref;
417+
return ret;
418418

419419
priv->reset = devm_reset_control_array_get_exclusive(dev);
420-
if (IS_ERR(priv->reset))
421-
return PTR_ERR(priv->reset);
420+
if (IS_ERR(priv->reset)) {
421+
ret = PTR_ERR(priv->reset);
422+
goto err_disable_clk_ref;
423+
}
422424

423425
priv->phy = devm_phy_create(dev, np, &phy_g12a_usb3_pcie_ops);
424426
if (IS_ERR(priv->phy)) {
425427
ret = PTR_ERR(priv->phy);
426-
if (ret != -EPROBE_DEFER)
427-
dev_err(dev, "failed to create PHY\n");
428-
429-
return ret;
428+
dev_err_probe(dev, ret, "failed to create PHY\n");
429+
goto err_disable_clk_ref;
430430
}
431431

432432
phy_set_drvdata(priv->phy, priv);
433433
dev_set_drvdata(dev, priv);
434434

435435
phy_provider = devm_of_phy_provider_register(dev,
436436
phy_g12a_usb3_pcie_xlate);
437+
if (IS_ERR(phy_provider)) {
438+
ret = PTR_ERR(phy_provider);
439+
goto err_disable_clk_ref;
440+
}
437441

438-
return PTR_ERR_OR_ZERO(phy_provider);
442+
return 0;
439443

440444
err_disable_clk_ref:
441445
clk_disable_unprepare(priv->clk_ref);

drivers/phy/motorola/phy-mapphone-mdm6600.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
629629
cleanup:
630630
if (error < 0)
631631
phy_mdm6600_device_power_off(ddata);
632-
632+
pm_runtime_disable(ddata->dev);
633+
pm_runtime_dont_use_autosuspend(ddata->dev);
633634
return error;
634635
}
635636

drivers/phy/samsung/phy-exynos5250-sata.c

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
187187
return -EINVAL;
188188

189189
sata_phy->client = of_find_i2c_device_by_node(node);
190+
of_node_put(node);
190191
if (!sata_phy->client)
191192
return -EPROBE_DEFER;
192193

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

201203
ret = clk_prepare_enable(sata_phy->phyclk);
202204
if (ret < 0) {
203205
dev_err(dev, "failed to enable source clk\n");
204-
return ret;
206+
goto put_dev;
205207
}
206208

207209
sata_phy->phy = devm_phy_create(dev, NULL, &exynos_sata_phy_ops);
208210
if (IS_ERR(sata_phy->phy)) {
209-
clk_disable_unprepare(sata_phy->phyclk);
210211
dev_err(dev, "failed to create PHY\n");
211-
return PTR_ERR(sata_phy->phy);
212+
ret = PTR_ERR(sata_phy->phy);
213+
goto clk_disable;
212214
}
213215

214216
phy_set_drvdata(sata_phy->phy, sata_phy);
215217

216218
phy_provider = devm_of_phy_provider_register(dev,
217219
of_phy_simple_xlate);
218220
if (IS_ERR(phy_provider)) {
219-
clk_disable_unprepare(sata_phy->phyclk);
220-
return PTR_ERR(phy_provider);
221+
ret = PTR_ERR(phy_provider);
222+
goto clk_disable;
221223
}
222224

223225
return 0;
226+
227+
clk_disable:
228+
clk_disable_unprepare(sata_phy->phyclk);
229+
put_dev:
230+
put_device(&sata_phy->client->dev);
231+
232+
return ret;
224233
}
225234

226235
static const struct of_device_id exynos_sata_phy_of_match[] = {

drivers/phy/ti/phy-am654-serdes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ static int serdes_am654_probe(struct platform_device *pdev)
838838

839839
clk_err:
840840
of_clk_del_provider(node);
841-
841+
pm_runtime_disable(dev);
842842
return ret;
843843
}
844844

drivers/phy/ti/phy-omap-usb2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static int omap_usb2_enable_clocks(struct omap_usb *phy)
215215
return 0;
216216

217217
err1:
218-
clk_disable(phy->wkupclk);
218+
clk_disable_unprepare(phy->wkupclk);
219219

220220
err0:
221221
return ret;

drivers/phy/ti/phy-ti-pipe3.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ static int ti_pipe3_get_sysctrl(struct ti_pipe3 *phy)
696696
}
697697

698698
control_pdev = of_find_device_by_node(control_node);
699+
of_node_put(control_node);
699700
if (!control_pdev) {
700701
dev_err(dev, "Failed to get control device\n");
701702
return -EINVAL;

drivers/phy/ti/phy-tusb1210.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static int tusb1210_set_mode(struct phy *phy, enum phy_mode mode, int submode)
155155
}
156156

157157
#ifdef CONFIG_POWER_SUPPLY
158-
const char * const tusb1210_chg_det_states[] = {
158+
static const char * const tusb1210_chg_det_states[] = {
159159
"CHG_DET_CONNECTING",
160160
"CHG_DET_START_DET",
161161
"CHG_DET_READ_DET",
@@ -537,12 +537,18 @@ static int tusb1210_probe(struct ulpi *ulpi)
537537
tusb1210_probe_charger_detect(tusb);
538538

539539
tusb->phy = ulpi_phy_create(ulpi, &phy_ops);
540-
if (IS_ERR(tusb->phy))
541-
return PTR_ERR(tusb->phy);
540+
if (IS_ERR(tusb->phy)) {
541+
ret = PTR_ERR(tusb->phy);
542+
goto err_remove_charger;
543+
}
542544

543545
phy_set_drvdata(tusb->phy, tusb);
544546
ulpi_set_drvdata(ulpi, tusb);
545547
return 0;
548+
549+
err_remove_charger:
550+
tusb1210_remove_charger_detect(tusb);
551+
return ret;
546552
}
547553

548554
static void tusb1210_remove(struct ulpi *ulpi)

0 commit comments

Comments
 (0)