Skip to content

Commit

Permalink
usb: ehci/ohci-exynos: Fix of_node_put() for child when getting PHYs
Browse files Browse the repository at this point in the history
On enabling CONFIG_OF_SELFTEST which enables CONFIG_OF_DYNAMIC,
we found out that while getting PHYs for the controller we were
doing an extra of_node_put on the child node in our routines -
exynos_e/ohci_get_phy().
This child is however already put by of_get_next_available_child()
which does a of_node_put() on the "prev" node. So there's no point
in putting the same node again in our routine.

Reported-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Vivek Gautam authored and Greg Kroah-Hartman committed Nov 3, 2014
1 parent 61fbe96 commit 6d40500
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion drivers/usb/host/ehci-exynos.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ static int exynos_ehci_get_phy(struct device *dev,

phy = devm_of_phy_get(dev, child, NULL);
exynos_ehci->phy[phy_number] = phy;
of_node_put(child);
if (IS_ERR(phy)) {
ret = PTR_ERR(phy);
if (ret == -EPROBE_DEFER) {
Expand Down
1 change: 0 additions & 1 deletion drivers/usb/host/ohci-exynos.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ static int exynos_ohci_get_phy(struct device *dev,

phy = devm_of_phy_get(dev, child, NULL);
exynos_ohci->phy[phy_number] = phy;
of_node_put(child);
if (IS_ERR(phy)) {
ret = PTR_ERR(phy);
if (ret == -EPROBE_DEFER) {
Expand Down

0 comments on commit 6d40500

Please sign in to comment.