aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/phy/phy-core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index 03cf8fb81554..712b358a5756 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -453,7 +453,7 @@ struct phy *phy_create(struct device *dev, const struct phy_ops *ops,
453 if (id < 0) { 453 if (id < 0) {
454 dev_err(dev, "unable to get id\n"); 454 dev_err(dev, "unable to get id\n");
455 ret = id; 455 ret = id;
456 goto err0; 456 goto err1;
457 } 457 }
458 458
459 device_initialize(&phy->dev); 459 device_initialize(&phy->dev);
@@ -468,11 +468,11 @@ struct phy *phy_create(struct device *dev, const struct phy_ops *ops,
468 468
469 ret = dev_set_name(&phy->dev, "phy-%s.%d", dev_name(dev), id); 469 ret = dev_set_name(&phy->dev, "phy-%s.%d", dev_name(dev), id);
470 if (ret) 470 if (ret)
471 goto err1; 471 goto err2;
472 472
473 ret = device_add(&phy->dev); 473 ret = device_add(&phy->dev);
474 if (ret) 474 if (ret)
475 goto err1; 475 goto err2;
476 476
477 if (pm_runtime_enabled(dev)) { 477 if (pm_runtime_enabled(dev)) {
478 pm_runtime_enable(&phy->dev); 478 pm_runtime_enable(&phy->dev);
@@ -481,11 +481,11 @@ struct phy *phy_create(struct device *dev, const struct phy_ops *ops,
481 481
482 return phy; 482 return phy;
483 483
484err1: 484err2:
485 ida_remove(&phy_ida, phy->id); 485 ida_remove(&phy_ida, phy->id);
486 put_device(&phy->dev); 486 put_device(&phy->dev);
487err1:
487 kfree(phy); 488 kfree(phy);
488
489err0: 489err0:
490 return ERR_PTR(ret); 490 return ERR_PTR(ret);
491} 491}