All of lore.kernel.org
 help / color / mirror / Atom feed
From: sshtylyov@ru.mvista.com (Sergei Shtylyov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 5/9] ARM: versatile: Map local timers using Device Tree when possible
Date: Mon, 12 Dec 2011 15:18:26 +0400	[thread overview]
Message-ID: <4EE5E302.8070301@ru.mvista.com> (raw)
In-Reply-To: <1323687811.2391.3.camel@hornet.cambridge.arm.com>

Hello.

On 12-12-2011 15:03, Pawel Moll wrote:

>>>    int __cpuinit local_timer_setup(struct clock_event_device *evt)
>>>    {
>>> +#if defined(CONFIG_OF)
>>> +	if (!twd_base) {
>>> +		struct device_node *np = of_find_compatible_node(NULL,
>>> +				NULL, "arm,smp-twd");
>>> +
>>> +		twd_base = of_iomap(np, 0);
>>> +		if (!twd_base)
>>> +			return -ENXIO;

>>      -ENOMEM.

> Hm. What I did simply mimics this ("arch/arm/include/asm/localtimer.h"):

> #ifdef CONFIG_LOCAL_TIMERS
> [...]
> #else

> static inline int local_timer_setup(struct clock_event_device *evt)
> {
>          return -ENXIO;
> }

> Now, I had a look at "include/asm-generic/errno-base.h":

> #define ENXIO            6      /* No such device or address */
> [...]
> #define ENOMEM          12      /* Out of memory */

> and to be honest, ENXIO makes more sense to me, but I really have no
> strong feelings either way... Do you?

    I think if of_iomap() fails, it's because the system is out of memory, so 
-ENOMEM seems more proper error in this case. Although... it's not the only 
case when of_iomap() fails.

> Thanks for your time!

> Pawe?

WBR, Sergei

WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
To: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
Cc: "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v5 5/9] ARM: versatile: Map local timers using Device Tree when possible
Date: Mon, 12 Dec 2011 15:18:26 +0400	[thread overview]
Message-ID: <4EE5E302.8070301@ru.mvista.com> (raw)
In-Reply-To: <1323687811.2391.3.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>

Hello.

On 12-12-2011 15:03, Pawel Moll wrote:

>>>    int __cpuinit local_timer_setup(struct clock_event_device *evt)
>>>    {
>>> +#if defined(CONFIG_OF)
>>> +	if (!twd_base) {
>>> +		struct device_node *np = of_find_compatible_node(NULL,
>>> +				NULL, "arm,smp-twd");
>>> +
>>> +		twd_base = of_iomap(np, 0);
>>> +		if (!twd_base)
>>> +			return -ENXIO;

>>      -ENOMEM.

> Hm. What I did simply mimics this ("arch/arm/include/asm/localtimer.h"):

> #ifdef CONFIG_LOCAL_TIMERS
> [...]
> #else

> static inline int local_timer_setup(struct clock_event_device *evt)
> {
>          return -ENXIO;
> }

> Now, I had a look at "include/asm-generic/errno-base.h":

> #define ENXIO            6      /* No such device or address */
> [...]
> #define ENOMEM          12      /* Out of memory */

> and to be honest, ENXIO makes more sense to me, but I really have no
> strong feelings either way... Do you?

    I think if of_iomap() fails, it's because the system is out of memory, so 
-ENOMEM seems more proper error in this case. Although... it's not the only 
case when of_iomap() fails.

> Thanks for your time!

> Paweł

WBR, Sergei
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

  reply	other threads:[~2011-12-12 11:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 19:03 [PATCH v5 0/9] Versatile Express DT support Pawel Moll
2011-12-09 19:03 ` Pawel Moll
2011-12-09 19:03 ` [PATCH v5 1/9] ARM: versatile: Add missing ENDPROC to headsmp.S Pawel Moll
2011-12-09 19:03   ` Pawel Moll
2011-12-09 19:03 ` [PATCH v5 2/9] ARM: vexpress: Get rid of MMIO_P2V Pawel Moll
2011-12-09 19:03   ` Pawel Moll
2011-12-09 19:03 ` [PATCH v5 3/9] ARM: vexpress: Add Device Tree support Pawel Moll
2011-12-09 19:03   ` Pawel Moll
2011-12-09 19:03 ` [PATCH v5 4/9] ARM: vexpress: Motherboard RS1 memory map support Pawel Moll
2011-12-09 19:03   ` Pawel Moll
2011-12-09 19:03 ` [PATCH v5 5/9] ARM: versatile: Map local timers using Device Tree when possible Pawel Moll
2011-12-09 19:03   ` Pawel Moll
2011-12-10 15:27   ` Sergei Shtylyov
2011-12-10 15:27     ` Sergei Shtylyov
2011-12-12 11:03     ` Pawel Moll
2011-12-12 11:03       ` Pawel Moll
2011-12-12 11:18       ` Sergei Shtylyov [this message]
2011-12-12 11:18         ` Sergei Shtylyov
2011-12-12 11:29         ` Pawel Moll
2011-12-12 11:29           ` Pawel Moll
2011-12-12 14:04   ` Russell King - ARM Linux
2011-12-12 14:04     ` Russell King - ARM Linux
2011-12-12 14:06     ` Pawel Moll
2011-12-12 14:06       ` Pawel Moll
2011-12-09 19:03 ` [PATCH v5 6/9] ARM: vexpress: Use FDT data in platform SMP calls Pawel Moll
2011-12-09 19:03   ` Pawel Moll
2011-12-09 19:03 ` [PATCH v5 7/9] ARM: vexpress: Add Device Tree for V2P-CA5s core tile Pawel Moll
2011-12-09 19:03   ` Pawel Moll
2011-12-09 19:03 ` [PATCH v5 8/9] ARM: vexpress: Add Device Tree for V2P-CA9 " Pawel Moll
2011-12-09 19:03   ` Pawel Moll
2011-12-09 19:03 ` [PATCH v5 9/9] ARM: vexpress: Add Device Tree for V2P-CA15 core tile (TC1 variant) Pawel Moll
2011-12-09 19:03   ` Pawel Moll

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EE5E302.8070301@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.