From patchwork Mon Mar 5 04:37:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10258365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 560AB60211 for ; Mon, 5 Mar 2018 08:37:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4478F274A3 for ; Mon, 5 Mar 2018 08:37:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3904F28756; Mon, 5 Mar 2018 08:37:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6FDA9274A3 for ; Mon, 5 Mar 2018 08:37:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0ADF86E3D3; Mon, 5 Mar 2018 08:37:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4FD0389836 for ; Mon, 5 Mar 2018 04:37:11 +0000 (UTC) Received: by mail-pg0-x243.google.com with SMTP id l131so6376256pga.2 for ; Sun, 04 Mar 2018 20:37:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FT3lCW30a9ctIdq2bIvOMRuxmhQlpHbqoFTwAUTVhnU=; b=a0PPAAsPIIgTDcIIk+gBFyIbqpnbczy5ffSG8tNlEOdFgjaa6UTkFgUVeOGy5iFyUp x6stIq8e2CQXigO7G6zfzbXZ4cfG2EXgQPAWYvpJjyqCbqrbhGygNhfvl2pBm97N2426 yoQGJj16IDJQXPEGL61oOr7HU75haWWEXzNBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FT3lCW30a9ctIdq2bIvOMRuxmhQlpHbqoFTwAUTVhnU=; b=HaaEOTp8cwSyZWiFNC9nTERie6oiNdCGWHEX69o8KRS8mgF6aGhNAYCZA63qbZ2Z0p eNsjCxtI9qfXnbtYgafOoXixMkyz1vhUfgpyo2cRmYxe4HUzcE0zkojAZ6vVH0BLNbnf iVbUeSfFadz95TgRGTVzJHzIVX/w6Mees0MzwTppdJtJ+JndGD49Dfdul7zkfT5UzIyh ChXgKRB6KToWA+dar8SHmCIsneMule5714cdGPin9LIGJd4OL3GtuT1IuJlVgEr/hQ7S a26ssHrpFU8AFVa6ydMVqjn6eCVGlbZyZnoAlyqmygYnyjljdTReSN8YQJYuO9uVY2VQ VCPw== X-Gm-Message-State: APf1xPCAqr2pN04jvhIq9kEUnvJC2tfdGQ74aulRhN95e+LWLdSNbnl1 ZekNtMjmudU6573z3UQEqsBJHA== X-Google-Smtp-Source: AG47ELsJ8drWokCM4iO064Hr1ozjAniGV3FSQrIE+U/JMdBaGAdqZz1s8sxnc06cGcxZdp3piEJ0JA== X-Received: by 10.99.117.83 with SMTP id f19mr11005055pgn.318.1520224630620; Sun, 04 Mar 2018 20:37:10 -0800 (PST) Received: from localhost ([223.226.75.205]) by smtp.gmail.com with ESMTPSA id t87sm25245697pfi.37.2018.03.04.20.37.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Mar 2018 20:37:10 -0800 (PST) Date: Mon, 5 Mar 2018 10:07:08 +0530 From: Viresh Kumar To: Jordan Crouse Subject: Re: [PATCH 1/3] PM / OPP: Add dev_pm_opp_get_np() Message-ID: <20180305043708.GA23018@vireshk-i7> References: <20180302214329.1086-1-jcrouse@codeaurora.org> <20180302214329.1086-2-jcrouse@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180302214329.1086-2-jcrouse@codeaurora.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Mailman-Approved-At: Mon, 05 Mar 2018 08:37:24 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nm@ti.com, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, sboyd@codeaurora.org, dri-devel@lists.freedesktop.org, vireshk@kernel.org, freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 02-03-18, 14:43, Jordan Crouse wrote: > Add a function to return the device node associated with a > specific opp which will facilitate detailing with custom > properties in client drivers. > > Signed-off-by: Jordan Crouse > --- > drivers/opp/of.c | 20 ++++++++++++++++++++ > include/linux/pm_opp.h | 6 ++++++ > 2 files changed, 26 insertions(+) I was using a patch for this for quite sometime now, but never posted it. So its your patch which should get merged now. But there are few things that you need to change/fix. Please update your patch based on mine (pasted below) and repost here. And I am not really sure how should this patch get merged. Maybe I will apply the patch and share a branch (which I wouldn't rebase) and you can use that ? diff --git a/drivers/opp/of.c b/drivers/opp/of.c index 21265af55117..b17715bc3c0a 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -736,3 +736,22 @@ struct dev_pm_opp *of_dev_pm_opp_find_required_opp(struct device *dev, return opp; } EXPORT_SYMBOL_GPL(of_dev_pm_opp_find_required_opp); + +/** + * dev_pm_opp_get_of_node() - Gets the DT node corresponding to an opp + * @opp: opp for which DT node has to be returned for + * + * Return: DT node corresponding to the opp, else 0 on success. + * + * The caller needs to put the node of_node_put() after using it. + */ +struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp) +{ + if (IS_ERR_OR_NULL(opp)) { + pr_err("%s: Invalid parameters\n", __func__); + return NULL; + } + + return of_node_get(opp->np); +} +EXPORT_SYMBOL_GPL(dev_pm_opp_get_of_node); diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 528a7d9cf2ef..099b31960dec 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -300,6 +300,7 @@ void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask); int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask); struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev); struct dev_pm_opp *of_dev_pm_opp_find_required_opp(struct device *dev, struct device_node *np); +struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp); #else static inline int dev_pm_opp_of_add_table(struct device *dev) { @@ -338,6 +339,10 @@ static inline struct dev_pm_opp *of_dev_pm_opp_find_required_opp(struct device * { return NULL; } +static inline struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp) +{ + return NULL; +} #endif #endif /* __LINUX_OPP_H__ */