summaryrefslogtreecommitdiff
path: root/drivers/phy/phy-core.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-08-05 09:04:59 +1000
committerDave Airlie <airlied@redhat.com>2014-08-05 09:04:59 +1000
commit5d42f82a9b8c5168d75cf59307cd271feca94464 (patch)
treea7049189a2c814589b3ad7e6e776fb736f980967 /drivers/phy/phy-core.c
parentc759606c96dc052373d4c36ea383595da46b04e9 (diff)
parent19583ca584d6f574384e17fe7613dfaeadcdc4a6 (diff)
Merge tag 'v3.16' into drm-next
Linux 3.16 backmerge requested by i915, nouveau and radeon authors Conflicts: drivers/gpu/drm/i915/i915_gem_render_state.c drivers/gpu/drm/i915/intel_drv.h
Diffstat (limited to 'drivers/phy/phy-core.c')
-rw-r--r--drivers/phy/phy-core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index c64a2f3b2d62..49c446530101 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -614,8 +614,9 @@ struct phy *phy_create(struct device *dev, const struct phy_ops *ops,
return phy;
put_dev:
- put_device(&phy->dev);
- ida_remove(&phy_ida, phy->id);
+ put_device(&phy->dev); /* calls phy_release() which frees resources */
+ return ERR_PTR(ret);
+
free_phy:
kfree(phy);
return ERR_PTR(ret);
@@ -799,7 +800,7 @@ static void phy_release(struct device *dev)
phy = to_phy(dev);
dev_vdbg(dev, "releasing '%s'\n", dev_name(dev));
- ida_remove(&phy_ida, phy->id);
+ ida_simple_remove(&phy_ida, phy->id);
kfree(phy);
}