Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759567Ab3GZSzi (ORCPT ); Fri, 26 Jul 2013 14:55:38 -0400 Received: from mail-qe0-f42.google.com ([209.85.128.42]:36410 "EHLO mail-qe0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759544Ab3GZSzf convert rfc822-to-8bit (ORCPT ); Fri, 26 Jul 2013 14:55:35 -0400 MIME-Version: 1.0 In-Reply-To: <51F2AB71.3070102@arm.com> References: <1374069984-20567-1-git-send-email-Sudeep.KarkadaNagesha@arm.com> <1374492747-13879-1-git-send-email-Sudeep.KarkadaNagesha@arm.com> <1374492747-13879-8-git-send-email-Sudeep.KarkadaNagesha@arm.com> <51F2AB71.3070102@arm.com> Date: Fri, 26 Jul 2013 13:55:34 -0500 Message-ID: Subject: Re: [PATCH v3 07/16] of/device: add helper to get cpu device node from logical cpu index From: Rob Herring To: Sudeep KarkadaNagesha Cc: "rob.herring@calxeda.com" , "devicetree@vger.kernel.org" , Lorenzo Pieralisi , Russell King , Arnd Bergmann , "linux-pm@vger.kernel.org" , Greg Kroah-Hartman , Olof Johansson , "linux-kernel@vger.kernel.org" , "cpufreq@vger.kernel.org" , "Rafael J. Wysocki" , "grant.likely@linaro.org" , Viresh Kumar , Gregory Clement , Shawn Guo , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2696 Lines: 84 On Fri, Jul 26, 2013 at 12:01 PM, Sudeep KarkadaNagesha wrote: > Rob, > > On 22/07/13 12:32, Sudeep KarkadaNagesha wrote: >> From: Sudeep KarkadaNagesha >> >> Multiple drivers need to get the cpu device node from the cpu logical >> index and then access the of_node. >> >> This patch adds helper function to fetch the device node directly. >> >> Cc: Rob Herring >> Signed-off-by: Sudeep KarkadaNagesha > > If you have no objections with this patch, can I add your ACK ? Yes. Acked-by: Rob Herring > > Regards, > Sudeep > >> --- >> include/linux/of_device.h | 15 +++++++++++++++ >> 1 file changed, 15 insertions(+) >> >> diff --git a/include/linux/of_device.h b/include/linux/of_device.h >> index 9d27475..82ce324 100644 >> --- a/include/linux/of_device.h >> +++ b/include/linux/of_device.h >> @@ -1,6 +1,7 @@ >> #ifndef _LINUX_OF_DEVICE_H >> #define _LINUX_OF_DEVICE_H >> >> +#include >> #include >> #include /* temporary until merge */ >> >> @@ -43,6 +44,15 @@ static inline void of_device_node_put(struct device *dev) >> of_node_put(dev->of_node); >> } >> >> +static inline struct device_node *of_cpu_device_node_get(int cpu) >> +{ >> + struct device *cpu_dev; >> + cpu_dev = get_cpu_device(cpu); >> + if (!cpu_dev) >> + return NULL; >> + return of_node_get(cpu_dev->of_node); >> +} >> + >> #else /* CONFIG_OF */ >> >> static inline int of_driver_match_device(struct device *dev, >> @@ -67,6 +77,11 @@ static inline const struct of_device_id *of_match_device( >> { >> return NULL; >> } >> + >> +static inline struct device_node *of_cpu_device_node_get(int cpu) >> +{ >> + return NULL; >> +} >> #endif /* CONFIG_OF */ >> >> #endif /* _LINUX_OF_DEVICE_H */ >> > > > -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/