From patchwork Fri Apr 15 06:32:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 8845331 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E1C389F3A0 for ; Fri, 15 Apr 2016 06:35:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 057532037E for ; Fri, 15 Apr 2016 06:35:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 141432021A for ; Fri, 15 Apr 2016 06:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753277AbcDOGfQ (ORCPT ); Fri, 15 Apr 2016 02:35:16 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:54099 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752938AbcDOGdN (ORCPT ); Fri, 15 Apr 2016 02:33:13 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O5N02IUQWUY7A40@mailout2.samsung.com>; Fri, 15 Apr 2016 15:32:58 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.113]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 6C.8E.04789.A1B80175; Fri, 15 Apr 2016 15:32:58 +0900 (KST) X-AuditID: cbfee691-f795a6d0000012b5-3d-57108b1a1970 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 8A.93.06682.A1B80175; Fri, 15 Apr 2016 15:32:58 +0900 (KST) Received: from chan.10.32.193.11 ([10.113.62.212]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O5N00MDZWUXF720@mmp2.samsung.com>; Fri, 15 Apr 2016 15:32:57 +0900 (KST) From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com, tomasz.figa@gmail.com, s.nawrocki@samsung.com, kgene@kernel.org Cc: robh@kernel.org, rjw@rjwysocki.net, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, linux@arm.linux.org.uk, linux.amoon@gmail.com, m.reichl@fivetechno.de, tjakobi@math.uni-bielefeld.de, inki.dae@samsung.com, cw00.choi@samsung.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH v2 2/8] PM / devfreq: event: Find the instance of devfreq-event device by using phandle Date: Fri, 15 Apr 2016 15:32:49 +0900 Message-id: <1460701975-24178-3-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1460701975-24178-1-git-send-email-cw00.choi@samsung.com> References: <1460701975-24178-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPIsWRmVeSWpSXmKPExsWyRsSkUFeqWyDc4Ms8SYvrX56zWsw/co7V ov/NQlaLc69WMlpMuj+BxeL1C0OL/sevmS3ONr1ht9j0+BqrxeVdc9gsPvceYbSYcX4fk8W6 jbfYLW5f5rV4eeQHo8XS6xeZLG43rmCzmDB9LYvFmdOXWC1a9x5ht/i/Zwe7xeE37awWbas/ sFqs2vWH0UHCY828NYweLc09bB6X+3qZPG7dqffYOesuu8fK5V/YPDat6mTz2Lyk3uPfMXaP LVfbWTz6tqxi9Pi8SS6AJ4rLJiU1J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GBmggYQ1jBnb fr1iLzjNVbHv5DfGBsbvHF2MnBwSAiYS7w6cZYKwxSQu3FvP1sXIxSEkMItRouPoC7CEkMAX RolP+wRBbDYBLYn9L26AFYkITGWUONg9ixHEYRa4yiyxpLGNHaRKWCBTYu+HP6wgNouAqsT9 fX1sIDavgKvErn0nmCHWyUl82PMIrJ5TwE1i0eTrjBDbXCVa5s1jm8DIu4CRYRWjRGpBckFx UnquYV5quV5xYm5xaV66XnJ+7iZGcNJ4JrWD8eAu90OMAhyMSjy8D2IFwoVYE8uKK3MPMUpw MCuJ8E5uBQrxpiRWVqUW5ccXleakFh9iNAU6bCKzlGhyPjCh5ZXEGxqbmBlZGpkbWhgZmyuJ 8z7+vy5MSCA9sSQ1OzW1ILUIpo+Jg1OqgTH/Rq28gU01R4XfNuMt21PNi+/d19y7d1XwpgpO WW7DOTJiErq7Tyv7n1wdXSeV1dT1XjXysEn8zdRHDKG8s4r+djWr///xyIZ9qsMVjmNlK43V 8rpmX9IpvZh9IlesPcBOPl/4E+9sqf9fuKZGCl7bcqEg/yW3g+m5mAze9cxJEl928K5XUmIp zkg01GIuKk4EAN69jf0wAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected 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=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY 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 This patch use the phandle to find the instance of devfreq-event device in Device Tree when calling the devfreq_event_get_edev_by_phandle() because there is two type devfreq-event devices as following: First case, exynos-ppmu.c driver provides the maximum four event of each PPMU. So, when getting the instance of devfreq-event device, using the unique name of struct devfreq_event_desc. Second case, exynos-nocp.c driver provide the only one event of each NoC Probe device. So, when getting the instance of devfreq-event device, using the phandle of each NoC probe device. Signed-off-by: Chanwoo Choi --- drivers/devfreq/devfreq-event.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c index 38bf144ca147..39b048eda2ce 100644 --- a/drivers/devfreq/devfreq-event.c +++ b/drivers/devfreq/devfreq-event.c @@ -235,6 +235,11 @@ struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev, mutex_lock(&devfreq_event_list_lock); list_for_each_entry(edev, &devfreq_event_list, node) { + if (edev->dev.parent && edev->dev.parent->of_node == node) + goto out; + } + + list_for_each_entry(edev, &devfreq_event_list, node) { if (!strcmp(edev->desc->name, node->name)) goto out; }