linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: sfr@canb.auug.org.au, monstr@monstr.eu,
	microblaze-uclinux@itee.uq.edu.au,
	devicetree-discuss@lists.ozlabs.org, sparclinux@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, davem@davemloft.net
Subject: Re: [PATCH 07/11] of: merge machine_is_compatible()
Date: Thu, 26 Nov 2009 15:05:10 +1100	[thread overview]
Message-ID: <1259208310.16367.231.camel@pasglop> (raw)
In-Reply-To: <20091124081906.6216.67035.stgit@angua>

On Tue, 2009-11-24 at 01:19 -0700, Grant Likely wrote:
> Merge common code between PowerPC and Microblaze

I don't like moving this one to common code without the of_ prefix. I
think you should move it with the of_ prefix, and then add a alias in
powerpc and microblaze without of_ in a header until we fix all call
sites (which you can put on your to-do list :-)

Cheers,
Ben.

> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> 
>  arch/microblaze/kernel/prom.c |   18 ------------------
>  arch/powerpc/kernel/prom.c    |   18 ------------------
>  drivers/of/base.c             |   18 ++++++++++++++++++
>  3 files changed, 18 insertions(+), 36 deletions(-)
> 
> diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
> index 543465a..c97192d 100644
> --- a/arch/microblaze/kernel/prom.c
> +++ b/arch/microblaze/kernel/prom.c
> @@ -281,24 +281,6 @@ void __init early_init_devtree_arch(void)
>  	/* No Microblaze specific code here */
>  }
>  
> -/**
> - * Indicates whether the root node has a given value in its
> - * compatible property.
> - */
> -int machine_is_compatible(const char *compat)
> -{
> -	struct device_node *root;
> -	int rc = 0;
> -
> -	root = of_find_node_by_path("/");
> -	if (root) {
> -		rc = of_device_is_compatible(root, compat);
> -		of_node_put(root);
> -	}
> -	return rc;
> -}
> -EXPORT_SYMBOL(machine_is_compatible);
> -
>  /*******
>   *
>   * New implementation of the OF "find" APIs, return a refcounted
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index a5b3b9d..65de093 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -677,24 +677,6 @@ void __init early_init_devtree_arch(void)
>  	lmb_enforce_memory_limit(limit);
>  }
>  
> -/**
> - * Indicates whether the root node has a given value in its
> - * compatible property.
> - */
> -int machine_is_compatible(const char *compat)
> -{
> -	struct device_node *root;
> -	int rc = 0;
> -
> -	root = of_find_node_by_path("/");
> -	if (root) {
> -		rc = of_device_is_compatible(root, compat);
> -		of_node_put(root);
> -	}
> -	return rc;
> -}
> -EXPORT_SYMBOL(machine_is_compatible);
> -
>  /*******
>   *
>   * New implementation of the OF "find" APIs, return a refcounted
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index ec56739..e81558f 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -144,6 +144,24 @@ int of_device_is_compatible(const struct device_node *device,
>  EXPORT_SYMBOL(of_device_is_compatible);
>  
>  /**
> + * Indicates whether the root node has a given value in its
> + * compatible property.
> + */
> +int machine_is_compatible(const char *compat)
> +{
> +	struct device_node *root;
> +	int rc = 0;
> +
> +	root = of_find_node_by_path("/");
> +	if (root) {
> +		rc = of_device_is_compatible(root, compat);
> +		of_node_put(root);
> +	}
> +	return rc;
> +}
> +EXPORT_SYMBOL(machine_is_compatible);
> +
> +/**
>   *  of_device_is_available - check if a device is available for use
>   *
>   *  @device: Node to check for availability

  reply	other threads:[~2009-11-26  4:05 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-24  8:17 [PATCH 00/11] Yet another series of OF merge patches Grant Likely
2009-11-24  8:17 ` [PATCH 01/11] of/flattree: Merge early_init_dt_check_for_initrd() Grant Likely
2009-11-26  3:51   ` Benjamin Herrenschmidt
2009-11-26  4:02     ` Grant Likely
2009-11-24  8:18 ` [PATCH 02/11] of/flattree: Merge earlyinit_dt_scan_root() Grant Likely
2009-11-26  3:54   ` Benjamin Herrenschmidt
2009-11-26  4:03     ` Grant Likely
2009-11-24  8:18 ` [PATCH 03/11] of/flattree: merge dt_mem_next_cell Grant Likely
2009-11-26  3:55   ` Benjamin Herrenschmidt
2009-11-24  8:18 ` [PATCH 04/11] of/flattree: eliminate cell_t typedef Grant Likely
2009-11-26  3:59   ` Benjamin Herrenschmidt
2009-11-26  4:05     ` Grant Likely
2009-11-26  5:27       ` Benjamin Herrenschmidt
2009-11-26 21:36         ` Segher Boessenkool
2009-11-26 21:40           ` Benjamin Herrenschmidt
2009-11-26 23:32           ` David Miller
2009-12-11  6:43         ` Grant Likely
2009-11-26  6:28       ` M. Warner Losh
2009-11-26  7:06         ` Benjamin Herrenschmidt
2009-11-26  7:52           ` Mitch Bradley
2009-11-24  8:18 ` [PATCH 05/11] of/flattree: merge early_init_dt_scan_chosen() Grant Likely
2009-11-24  8:19 ` [PATCH 06/11] of/flattree: merge early_init_devtree() and early_init_move_devtree() Grant Likely
2009-11-26  4:04   ` Benjamin Herrenschmidt
2009-12-11  6:19     ` Grant Likely
2009-12-07  7:08   ` Jeremy Kerr
2009-12-11  6:20     ` Grant Likely
2009-11-24  8:19 ` [PATCH 07/11] of: merge machine_is_compatible() Grant Likely
2009-11-26  4:05   ` Benjamin Herrenschmidt [this message]
2009-12-11  6:54     ` Grant Likely
2009-11-24  8:19 ` [PATCH 08/11] of: Merge of_node_get() and of_node_put() Grant Likely
2009-11-26  4:06   ` Benjamin Herrenschmidt
2009-11-24  8:19 ` [PATCH 09/11] of: merge of_attach_node() & of_detach_node() Grant Likely
2009-11-26  4:07   ` Benjamin Herrenschmidt
2009-12-10 22:21     ` Grant Likely
2009-11-24  8:19 ` [PATCH 10/11] microblaze: gut implementation of early_init_dt_scan_cpus() Grant Likely
2009-11-24  8:20 ` [PATCH 11/11] of: unify phandle name in struct device_node Grant Likely
2009-11-24 17:37   ` David Miller
2009-11-24 20:33     ` Grant Likely
2009-11-24 21:10       ` David Miller
2009-11-24 21:06     ` Benjamin Herrenschmidt
2009-11-24 21:39       ` Grant Likely
2009-11-26 12:28 ` [PATCH 00/11] Yet another series of OF merge patches Wolfram Sang

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=1259208310.16367.231.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=microblaze-uclinux@itee.uq.edu.au \
    --cc=monstr@monstr.eu \
    --cc=sfr@canb.auug.org.au \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).