From patchwork Mon Jul 14 10:25:01 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: 33564 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 861FF20CAD for ; Mon, 14 Jul 2014 10:26:06 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id uq10sf7653836igb.11 for ; Mon, 14 Jul 2014 03:26:06 -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=rNQYSGX/9bayHMQWkqilpJ8unL7bZ5UqyOKwZvWtiBk=; b=RDTSqvtl1WuerWyTC67gEvywOK1hg5tsBldLbPKlpuj56EKsXk2gjr4W3qw89nUJ9l TYKaw75vfNKp6bY9YoYG8qus2r2Ijh5hRIbOtBeWx/os7Rbfuxvhgzi40dgNJg/rEiH7 4m8VvrClrdA4Bb1Mk7vr23UZaxb7qGkNyyj9FCU3xRkj2JOTTeyj0ULO31YuoGzK+TZm ngFWZv5LMmal9yj4kZ4kwx7c/Kz4jDe1YdPGgfWEM35fUnP5d1U5n1yX/+s2h7s6HqXz ApC/JkwHVNe2uVzKD1TSUGyIiXzMEPt7FRAjjBjfE21USVKiX0n/MhJL6+iBHdq8Sdkg 2oYw== X-Gm-Message-State: ALoCoQnPkdmcN0FF1hUw8JxnXNHHtEnhDb/LSurd5uO21rMyo7WvIrnZxgGt7HfGc1bTDUoEHLKV X-Received: by 10.43.114.138 with SMTP id fa10mr9277506icc.17.1405333565996; Mon, 14 Jul 2014 03:26:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.171 with SMTP id 40ls1020538qgx.9.gmail; Mon, 14 Jul 2014 03:26:05 -0700 (PDT) X-Received: by 10.220.122.132 with SMTP id l4mr48601vcr.41.1405333565908; Mon, 14 Jul 2014 03:26:05 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id ta7si896254vdc.37.2014.07.14.03.26.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jul 2014 03:26:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hq11so5633165vcb.17 for ; Mon, 14 Jul 2014 03:26:05 -0700 (PDT) X-Received: by 10.220.92.135 with SMTP id r7mr15340198vcm.11.1405333565811; Mon, 14 Jul 2014 03:26:05 -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.221.37.5 with SMTP id tc5csp123929vcb; Mon, 14 Jul 2014 03:26:05 -0700 (PDT) X-Received: by 10.66.117.200 with SMTP id kg8mr15928406pab.49.1405333564893; Mon, 14 Jul 2014 03:26:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si4417189pde.417.2014.07.14.03.26.04; Mon, 14 Jul 2014 03:26:04 -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 S1754510AbaGNKZs (ORCPT + 28 others); Mon, 14 Jul 2014 06:25:48 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:50702 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753816AbaGNKZa (ORCPT ); Mon, 14 Jul 2014 06:25:30 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s6EAPQ0Y016041; Mon, 14 Jul 2014 05:25:26 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6EAPQJK008860; Mon, 14 Jul 2014 05:25:26 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Mon, 14 Jul 2014 05:25:26 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6EAPN3i024641; Mon, 14 Jul 2014 05:25:24 -0500 From: Kishon Vijay Abraham I To: , , , , CC: Subject: [PATCH 1/2] phy: core: Fix of_phy_provider_lookup to return PHY provider for sub node Date: Mon, 14 Jul 2014 15:55:01 +0530 Message-ID: <1405333502-24385-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.220.172 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: , Fixed of_phy_provider_lookup to return 'phy_provider' if _of_phy_get passes the node pointer of the sub-node of phy provider node. This is needed when phy provider implements multiple PHYs and each PHY is modelled as the sub-node of PHY provider device node. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lee Jones --- drivers/phy/phy-core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 75c9739..527e744 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -87,10 +87,15 @@ static struct phy *phy_lookup(struct device *device, const char *port) static struct phy_provider *of_phy_provider_lookup(struct device_node *node) { struct phy_provider *phy_provider; + struct device_node *child; list_for_each_entry(phy_provider, &phy_provider_list, list) { if (phy_provider->dev->of_node == node) return phy_provider; + + for_each_child_of_node(phy_provider->dev->of_node, child) + if (child == node) + return phy_provider; } return ERR_PTR(-EPROBE_DEFER);