From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suzuki K Poulose Subject: Re: [PATCH v5 4/9] coresight: refactor with function of_coresight_get_cpu Date: Fri, 31 Mar 2017 10:05:37 +0100 Message-ID: <8f45279c-5768-9a56-3c6d-3ecfd63f4b18@arm.com> References: <1490466197-29163-1-git-send-email-leo.yan@linaro.org> <1490466197-29163-5-git-send-email-leo.yan@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from foss.arm.com ([217.140.101.70]:56676 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932605AbdCaJFp (ORCPT ); Fri, 31 Mar 2017 05:05:45 -0400 In-Reply-To: <1490466197-29163-5-git-send-email-leo.yan@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Leo Yan , Jonathan Corbet , Rob Herring , Mark Rutland , Wei Xu , Catalin Marinas , Will Deacon , Andy Gross , David Brown , Michael Turquette , Stephen Boyd , Mathieu Poirier , Guodong Xu , John Stultz , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, mike.leach@linaro.org, sudeep.ho On 25/03/17 18:23, Leo Yan wrote: > This is refactor to add function of_coresight_get_cpu(), so it's used to > retrieve CPU id for coresight component. Finally can use it as a common > function for multiple places. > > Suggested-by: Mathieu Poirier > Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose > - if (found) > - break; > - } > - of_node_put(dn); > - > - /* Affinity to CPU0 if no cpu nodes are found */ > - pdata->cpu = found ? cpu : 0; > + pdata->cpu = of_coresight_get_cpu(node); > > return pdata; > } > diff --git a/include/linux/coresight.h b/include/linux/coresight.h > index 2a5982c..bf96678 100644 > --- a/include/linux/coresight.h > +++ b/include/linux/coresight.h > @@ -263,9 +263,11 @@ static inline int coresight_timeout(void __iomem *addr, u32 offset, > #endif > > #ifdef CONFIG_OF > +extern int of_coresight_get_cpu(struct device_node *node); > extern struct coresight_platform_data *of_get_coresight_platform_data( > struct device *dev, struct device_node *node); > #else > +static inline int of_coresight_get_cpu(struct device_node *node) { return 0; } > static inline struct coresight_platform_data *of_get_coresight_platform_data( > struct device *dev, struct device_node *node) { return NULL; } > #endif > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933141AbdCaJFy (ORCPT ); Fri, 31 Mar 2017 05:05:54 -0400 Received: from foss.arm.com ([217.140.101.70]:56676 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932605AbdCaJFp (ORCPT ); Fri, 31 Mar 2017 05:05:45 -0400 Subject: Re: [PATCH v5 4/9] coresight: refactor with function of_coresight_get_cpu To: Leo Yan , Jonathan Corbet , Rob Herring , Mark Rutland , Wei Xu , Catalin Marinas , Will Deacon , Andy Gross , David Brown , Michael Turquette , Stephen Boyd , Mathieu Poirier , Guodong Xu , John Stultz , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, mike.leach@linaro.org, sudeep.holla@arm.com References: <1490466197-29163-1-git-send-email-leo.yan@linaro.org> <1490466197-29163-5-git-send-email-leo.yan@linaro.org> From: Suzuki K Poulose Message-ID: <8f45279c-5768-9a56-3c6d-3ecfd63f4b18@arm.com> Date: Fri, 31 Mar 2017 10:05:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1490466197-29163-5-git-send-email-leo.yan@linaro.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/03/17 18:23, Leo Yan wrote: > This is refactor to add function of_coresight_get_cpu(), so it's used to > retrieve CPU id for coresight component. Finally can use it as a common > function for multiple places. > > Suggested-by: Mathieu Poirier > Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose > - if (found) > - break; > - } > - of_node_put(dn); > - > - /* Affinity to CPU0 if no cpu nodes are found */ > - pdata->cpu = found ? cpu : 0; > + pdata->cpu = of_coresight_get_cpu(node); > > return pdata; > } > diff --git a/include/linux/coresight.h b/include/linux/coresight.h > index 2a5982c..bf96678 100644 > --- a/include/linux/coresight.h > +++ b/include/linux/coresight.h > @@ -263,9 +263,11 @@ static inline int coresight_timeout(void __iomem *addr, u32 offset, > #endif > > #ifdef CONFIG_OF > +extern int of_coresight_get_cpu(struct device_node *node); > extern struct coresight_platform_data *of_get_coresight_platform_data( > struct device *dev, struct device_node *node); > #else > +static inline int of_coresight_get_cpu(struct device_node *node) { return 0; } > static inline struct coresight_platform_data *of_get_coresight_platform_data( > struct device *dev, struct device_node *node) { return NULL; } > #endif > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suzuki.Poulose@arm.com (Suzuki K Poulose) Date: Fri, 31 Mar 2017 10:05:37 +0100 Subject: [PATCH v5 4/9] coresight: refactor with function of_coresight_get_cpu In-Reply-To: <1490466197-29163-5-git-send-email-leo.yan@linaro.org> References: <1490466197-29163-1-git-send-email-leo.yan@linaro.org> <1490466197-29163-5-git-send-email-leo.yan@linaro.org> Message-ID: <8f45279c-5768-9a56-3c6d-3ecfd63f4b18@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 25/03/17 18:23, Leo Yan wrote: > This is refactor to add function of_coresight_get_cpu(), so it's used to > retrieve CPU id for coresight component. Finally can use it as a common > function for multiple places. > > Suggested-by: Mathieu Poirier > Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose > - if (found) > - break; > - } > - of_node_put(dn); > - > - /* Affinity to CPU0 if no cpu nodes are found */ > - pdata->cpu = found ? cpu : 0; > + pdata->cpu = of_coresight_get_cpu(node); > > return pdata; > } > diff --git a/include/linux/coresight.h b/include/linux/coresight.h > index 2a5982c..bf96678 100644 > --- a/include/linux/coresight.h > +++ b/include/linux/coresight.h > @@ -263,9 +263,11 @@ static inline int coresight_timeout(void __iomem *addr, u32 offset, > #endif > > #ifdef CONFIG_OF > +extern int of_coresight_get_cpu(struct device_node *node); > extern struct coresight_platform_data *of_get_coresight_platform_data( > struct device *dev, struct device_node *node); > #else > +static inline int of_coresight_get_cpu(struct device_node *node) { return 0; } > static inline struct coresight_platform_data *of_get_coresight_platform_data( > struct device *dev, struct device_node *node) { return NULL; } > #endif >