From: Rob Herring <rob.herring@calxeda.com>
To: Andreas Larsson <andreas@gaisler.com>
Cc: davem@davemloft.net, sam@ravnborg.org,
sparclinux@vger.kernel.org, software@gaisler.com,
Grant Likely <grant.likely@secretlab.ca>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc a
Date: Mon, 05 Nov 2012 16:12:10 +0000 [thread overview]
Message-ID: <5097E55A.4090305@calxeda.com> (raw)
In-Reply-To: <1352112798-26307-1-git-send-email-andreas@gaisler.com>
On 11/05/2012 04:53 AM, Andreas Larsson wrote:
> This bug-fix makes sure that of_address_to_resource is defined extern for sparc
> so that the sparc-specific implementation of of_address_to_resource() is once
> again used when including include/linux/of_address.h in a sparc context. A
> number of drivers in mainline relies on this function working for sparc.
>
> The bug was introduced in a850a7554442f08d3e910c6eeb4ee216868dda1e, "of/address:
> add empty static inlines for !CONFIG_OF". Contrary to that commit title, the
> static inlines are added for !CONFIG_OF_ADRESS, and CONFIG_OF_ADRESS is never
s/ADRESS/ADDRESS/
> defined for sparc. This is good behavior for the other functions in
> include/linux/of_address.h, as the extern functions defined in
> drivers/of/address.c only gets linked when OF_ADDRESS is configured. However,
> for of_address_to_resource is that there exists a sparc-specific implementation
> in arch/sparc/arch/sparc/kernel/of_device_common.c
>
> Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Otherwise,
Acked-by: Rob Herring <rob.herring@calxeda.com>
> ---
> arch/sparc/include/asm/prom.h | 5 +++++
> include/linux/of_address.h | 2 ++
> 2 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h
> index c287651..f930031 100644
> --- a/arch/sparc/include/asm/prom.h
> +++ b/arch/sparc/include/asm/prom.h
> @@ -63,5 +63,10 @@ extern char *of_console_options;
> extern void irq_trans_init(struct device_node *dp);
> extern char *build_path_component(struct device_node *dp);
>
> +/* SPARC has a local implementation */
> +extern int of_address_to_resource(struct device_node *dev, int index,
> + struct resource *r);
> +#define of_address_to_resource of_address_to_resource
> +
> #endif /* __KERNEL__ */
> #endif /* _SPARC_PROM_H */
> diff --git a/include/linux/of_address.h b/include/linux/of_address.h
> index a1984dd..e20e3af 100644
> --- a/include/linux/of_address.h
> +++ b/include/linux/of_address.h
> @@ -28,11 +28,13 @@ static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
> #endif
>
> #else /* CONFIG_OF_ADDRESS */
> +#ifndef of_address_to_resource
> static inline int of_address_to_resource(struct device_node *dev, int index,
> struct resource *r)
> {
> return -EINVAL;
> }
> +#endif
> static inline struct device_node *of_find_matching_node_by_address(
> struct device_node *from,
> const struct of_device_id *matches,
>
WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <rob.herring@calxeda.com>
To: Andreas Larsson <andreas@gaisler.com>
Cc: davem@davemloft.net, sam@ravnborg.org,
sparclinux@vger.kernel.org, software@gaisler.com,
Grant Likely <grant.likely@secretlab.ca>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again
Date: Mon, 05 Nov 2012 10:12:10 -0600 [thread overview]
Message-ID: <5097E55A.4090305@calxeda.com> (raw)
In-Reply-To: <1352112798-26307-1-git-send-email-andreas@gaisler.com>
On 11/05/2012 04:53 AM, Andreas Larsson wrote:
> This bug-fix makes sure that of_address_to_resource is defined extern for sparc
> so that the sparc-specific implementation of of_address_to_resource() is once
> again used when including include/linux/of_address.h in a sparc context. A
> number of drivers in mainline relies on this function working for sparc.
>
> The bug was introduced in a850a7554442f08d3e910c6eeb4ee216868dda1e, "of/address:
> add empty static inlines for !CONFIG_OF". Contrary to that commit title, the
> static inlines are added for !CONFIG_OF_ADRESS, and CONFIG_OF_ADRESS is never
s/ADRESS/ADDRESS/
> defined for sparc. This is good behavior for the other functions in
> include/linux/of_address.h, as the extern functions defined in
> drivers/of/address.c only gets linked when OF_ADDRESS is configured. However,
> for of_address_to_resource is that there exists a sparc-specific implementation
> in arch/sparc/arch/sparc/kernel/of_device_common.c
>
> Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Otherwise,
Acked-by: Rob Herring <rob.herring@calxeda.com>
> ---
> arch/sparc/include/asm/prom.h | 5 +++++
> include/linux/of_address.h | 2 ++
> 2 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h
> index c287651..f930031 100644
> --- a/arch/sparc/include/asm/prom.h
> +++ b/arch/sparc/include/asm/prom.h
> @@ -63,5 +63,10 @@ extern char *of_console_options;
> extern void irq_trans_init(struct device_node *dp);
> extern char *build_path_component(struct device_node *dp);
>
> +/* SPARC has a local implementation */
> +extern int of_address_to_resource(struct device_node *dev, int index,
> + struct resource *r);
> +#define of_address_to_resource of_address_to_resource
> +
> #endif /* __KERNEL__ */
> #endif /* _SPARC_PROM_H */
> diff --git a/include/linux/of_address.h b/include/linux/of_address.h
> index a1984dd..e20e3af 100644
> --- a/include/linux/of_address.h
> +++ b/include/linux/of_address.h
> @@ -28,11 +28,13 @@ static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
> #endif
>
> #else /* CONFIG_OF_ADDRESS */
> +#ifndef of_address_to_resource
> static inline int of_address_to_resource(struct device_node *dev, int index,
> struct resource *r)
> {
> return -EINVAL;
> }
> +#endif
> static inline struct device_node *of_find_matching_node_by_address(
> struct device_node *from,
> const struct of_device_id *matches,
>
next prev parent reply other threads:[~2012-11-05 16:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-02 11:03 [PATCH] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again Andreas Larsson
2012-11-02 11:03 ` Andreas Larsson
2012-11-02 17:53 ` [PATCH] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc agai Sam Ravnborg
2012-11-02 17:53 ` [PATCH] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again Sam Ravnborg
2012-11-05 10:21 ` [PATCH] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc agai Andreas Larsson
2012-11-05 10:21 ` [PATCH] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again Andreas Larsson
2012-11-05 10:53 ` [PATCH v2] " Andreas Larsson
2012-11-05 10:53 ` Andreas Larsson
2012-11-05 16:12 ` Rob Herring [this message]
2012-11-05 16:12 ` Rob Herring
2012-11-06 10:12 ` [PATCH v3] " Andreas Larsson
2012-11-06 10:12 ` Andreas Larsson
2012-11-10 3:49 ` [PATCH v2] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc a David Miller
2012-11-10 3:49 ` [PATCH v2] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again David Miller
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=5097E55A.4090305@calxeda.com \
--to=rob.herring@calxeda.com \
--cc=andreas@gaisler.com \
--cc=davem@davemloft.net \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=software@gaisler.com \
--cc=sparclinux@vger.kernel.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.