From patchwork Mon Oct 6 06:21:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 5035381 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7BF549F2F1 for ; Mon, 6 Oct 2014 06:21:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3DCA620149 for ; Mon, 6 Oct 2014 06:21:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B00EF20145 for ; Mon, 6 Oct 2014 06:21:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751089AbaJFGVY (ORCPT ); Mon, 6 Oct 2014 02:21:24 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:50225 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbaJFGVX (ORCPT ); Mon, 6 Oct 2014 02:21:23 -0400 Received: by mail-pa0-f42.google.com with SMTP id bj1so4790041pad.15 for ; Sun, 05 Oct 2014 23:21:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=c8w3ClMKiJdYoCvw27lQFa6ew+r3e9oC7xKJ6SwhQgU=; b=mzxXqVks7AiBKcTJRCbXGGsy+ylo5nz3fGvcXuPaQ90sEPjgEioKx2+Gyg0h3Zr2ac TXjn/IEVLX+o1dzD3fhX8D0vNzxy0o1fRpMjMiCeT/jf0rlD5UaCI9m/4f5FvOpKyXAG pTGaeOrtonLgjry5lfsSxvARG2Yre1wjRg9mv63AbT01ZO0hwxjlCr/qfoV9oRjgNkH+ fqi2SjCbKC0R2axHJecMESlU79hJS56mv3kA2FH6mbidkrfnt9OOH4PSn/EwrkmeozBW dRPah7wckSHavykxe1iSgygwM4bdjc/inr7FsozLV5LFE+JUMa8sSXG7CT1+jGxo5TXs m/HQ== X-Received: by 10.66.66.229 with SMTP id i5mr610265pat.131.1412576483442; Sun, 05 Oct 2014 23:21:23 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([14.140.216.146]) by mx.google.com with ESMTPSA id td4sm12320203pbc.36.2014.10.05.23.21.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 05 Oct 2014 23:21:22 -0700 (PDT) From: Vivek Gautam To: linux-usb@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, stern@rowland.harvard.edu, drake@endlessm.com, grant.likely@secretlab.ca, kgene.kim@samsung.com, jg1.han@samsung.com, Vivek Gautam Subject: [PATCH] usb: ehci/ohci-exynos: Fix of_node_put() for child when getting PHYs Date: Mon, 6 Oct 2014 11:51:10 +0530 Message-Id: <1412576470-23974-1-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_RHS_DOB autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Vivek Gautam --- drivers/usb/host/ehci-exynos.c | 1 - drivers/usb/host/ohci-exynos.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index 7189f2e..1b726bf 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -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) { diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index d28b658..39f366b 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -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) {