From patchwork Fri Oct 31 08:34:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 39862 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2334F202FE for ; Fri, 31 Oct 2014 08:34:35 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id x13sf3806141wgg.9 for ; Fri, 31 Oct 2014 01:34:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=uE+Mqqj+bW4qcQ/RqrQfl82AGqM1YjZcpsoOZVJ2OQw=; b=STQOOfuPJQKtap90Cn091HRxlvVNe/wRkjZ3qdbXt9DxfCXMHdKJuHd8fq7lz98Qnu agF0RKIf7KrfM+HilVRh9dWMb2NPiLVhECAqqjPGrycdZAv+wQWus06joRR57KXurIAO 2Bq3Na9A2O1malBOVaD6/wSrPiijU5Zj1VxEDAzvxbbxuI1Bqr9x+HchVCHXA+d1UcIu yOgfJTFhc0bP2A96F72P+YnaTSYmjGVrdfhL2peg+/K+qX9RF81XZ544JSKLJTzGFrSh XM5zWFoDzpdal05x9rL6jPAdr75v9nwsS6RM5t0dG9Mr200GuT1g6PtzNcJLIpgJqjtO 2heg== X-Gm-Message-State: ALoCoQkqxmqpqAClfzsjemjBAZCRh9ILcnwyUzh8RrT8+fwR/iUpVzoFhTK1q2TwHRNP4C2wq8rh X-Received: by 10.112.170.167 with SMTP id an7mr3828842lbc.4.1414744474293; Fri, 31 Oct 2014 01:34:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.121.72 with SMTP id li8ls460780lab.101.gmail; Fri, 31 Oct 2014 01:34:34 -0700 (PDT) X-Received: by 10.112.47.37 with SMTP id a5mr24466964lbn.31.1414744473945; Fri, 31 Oct 2014 01:34:33 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id 6si4466245lav.119.2014.10.31.01.34.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 01:34:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id z11so3752466lbi.33 for ; Fri, 31 Oct 2014 01:34:33 -0700 (PDT) X-Received: by 10.112.130.41 with SMTP id ob9mr24035399lbb.74.1414744473830; Fri, 31 Oct 2014 01:34:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp167014lbz; Fri, 31 Oct 2014 01:34:32 -0700 (PDT) X-Received: by 10.70.38.48 with SMTP id d16mr3902472pdk.79.1414744472052; Fri, 31 Oct 2014 01:34:32 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ur9si8691089pbc.125.2014.10.31.01.34.31 for ; Fri, 31 Oct 2014 01:34:32 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756551AbaJaIe1 (ORCPT + 26 others); Fri, 31 Oct 2014 04:34:27 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:37151 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751457AbaJaIeZ (ORCPT ); Fri, 31 Oct 2014 04:34:25 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9V8YOdd009351; Fri, 31 Oct 2014 03:34:24 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9V8YORi032421; Fri, 31 Oct 2014 03:34:24 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Fri, 31 Oct 2014 03:34:24 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9V8YL9w015917; Fri, 31 Oct 2014 03:34:22 -0500 From: Kishon Vijay Abraham I To: , CC: , Subject: [PATCH v2] phy: phy-core: use the np present in of_phandle_args to get the PHY Date: Fri, 31 Oct 2014 14:04:20 +0530 Message-ID: <1414744460-10795-1-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kishon@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Instead of using the node pointer of the PHY provider and then scanning its child nodes to get a reference to the PHY, directly use the node pointer present in of_phandle_args to get a reference to the PHY. Signed-off-by: Kishon Vijay Abraham I --- I sent the wrong version of the patch before. Now I'm sending the proper one without errors and warnings. drivers/phy/phy-core.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index ff5eec5..1606ce9 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -414,21 +414,13 @@ struct phy *of_phy_simple_xlate(struct device *dev, struct of_phandle_args { struct phy *phy; struct class_dev_iter iter; - struct device_node *node = dev->of_node; - struct device_node *child; class_dev_iter_init(&iter, phy_class, NULL, NULL); while ((dev = class_dev_iter_next(&iter))) { phy = to_phy(dev); - if (node != phy->dev.of_node) { - for_each_child_of_node(node, child) { - if (child == phy->dev.of_node) - goto phy_found; - } + if (args->np != phy->dev.of_node) continue; - } -phy_found: class_dev_iter_exit(&iter); return phy; }