phy: Find the right match in devm_phy_destroy()
authorThierry Reding <treding@nvidia.com>
Wed, 25 Feb 2015 15:16:29 +0000 (16:16 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 17 Apr 2015 00:11:41 +0000 (20:11 -0400)
commit59bbaa453dd58db66cd0bb9ca309aa36f4567778
treefbf2b428c43bc75a9743ee831547834d51c1b8ad
parentbf8935d8ac4130b11b8e09623c496bfb3f730c95
phy: Find the right match in devm_phy_destroy()

[ Upstream commit 2f1bce487cd0a02623cff3d877940f9a2026341c ]

devm_phy_create() stores the pointer to the new PHY at the address
returned by devres_alloc(). The res parameter passed to devm_phy_match()
is therefore the location where the pointer to the PHY is stored, hence
it needs to be dereferenced before comparing to the match data in order
to find the correct match.

Cc: <stable@vger.kernel.org> # v3.13+
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/phy/phy-core.c