linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Remove `have_of' global variable
@ 2008-12-09 19:47 Anton Vorontsov
  2008-12-09 23:30 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Vorontsov @ 2008-12-09 19:47 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

The `have_of' variable is a relic from the arch/ppc time, it isn't
useful nowadays.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 arch/powerpc/include/asm/processor.h |    2 --
 arch/powerpc/kernel/pci-common.c     |    2 --
 arch/powerpc/kernel/pci_32.c         |    7 +------
 arch/powerpc/kernel/setup_32.c       |    2 --
 arch/powerpc/kernel/setup_64.c       |    1 -
 fs/proc/proc_devtree.c               |    3 +--
 6 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index cd7a478..d346649 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -69,8 +69,6 @@ extern int _prep_type;
 
 #ifdef __KERNEL__
 
-extern int have_of;
-
 struct task_struct;
 void start_thread(struct pt_regs *regs, unsigned long fdptr, unsigned long sp);
 void release_thread(struct task_struct *);
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 91c3f52..1a32db3 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -160,8 +160,6 @@ EXPORT_SYMBOL(pci_domain_nr);
  */
 struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node)
 {
-	if (!have_of)
-		return NULL;
 	while(node) {
 		struct pci_controller *hose, *tmp;
 		list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 7ad11e5..132cd80 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -266,9 +266,6 @@ pci_busdev_to_OF_node(struct pci_bus *bus, int devfn)
 {
 	struct device_node *parent, *np;
 
-	if (!have_of)
-		return NULL;
-
 	pr_debug("pci_busdev_to_OF_node(%d,0x%x)\n", bus->number, devfn);
 	parent = scan_OF_for_pci_bus(bus);
 	if (parent == NULL)
@@ -309,8 +306,6 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
 	struct pci_controller* hose;
 	struct pci_dev* dev = NULL;
 	
-	if (!have_of)
-		return -ENODEV;
 	/* Make sure it's really a PCI device */
 	hose = pci_find_hose_for_OF_device(node);
 	if (!hose || !hose->dn)
@@ -431,7 +426,7 @@ static int __init pcibios_init(void)
 	 * numbers vs. kernel bus numbers since we may have to
 	 * remap them.
 	 */
-	if (pci_assign_all_buses && have_of)
+	if (pci_assign_all_buses)
 		pcibios_make_OF_bus_map();
 
 	/* Call common code to handle resource allocation */
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index c1a2762..cc4679e 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -53,8 +53,6 @@ unsigned long ISA_DMA_THRESHOLD;
 unsigned int DMA_MODE_READ;
 unsigned int DMA_MODE_WRITE;
 
-int have_of = 1;
-
 #ifdef CONFIG_VGA_CONSOLE
 unsigned long vgacon_remap_base;
 EXPORT_SYMBOL(vgacon_remap_base);
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 93c875a..ce48f5c 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -70,7 +70,6 @@
 #define DBG(fmt...)
 #endif
 
-int have_of = 1;
 int boot_cpuid = 0;
 u64 ppc64_pft_size;
 
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
index d777789..de2bba5 100644
--- a/fs/proc/proc_devtree.c
+++ b/fs/proc/proc_devtree.c
@@ -218,8 +218,7 @@ void proc_device_tree_add_node(struct device_node *np,
 void __init proc_device_tree_init(void)
 {
 	struct device_node *root;
-	if ( !have_of )
-		return;
+
 	proc_device_tree = proc_mkdir("device-tree", NULL);
 	if (proc_device_tree == 0)
 		return;
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc: Remove `have_of' global variable
  2008-12-09 19:47 [PATCH] powerpc: Remove `have_of' global variable Anton Vorontsov
@ 2008-12-09 23:30 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2008-12-09 23:30 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linuxppc-dev, Paul Mackerras

On Tue, 2008-12-09 at 22:47 +0300, Anton Vorontsov wrote:
> The `have_of' variable is a relic from the arch/ppc time, it isn't
> useful nowadays.
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> ---
>  arch/powerpc/include/asm/processor.h |    2 --
>  arch/powerpc/kernel/pci-common.c     |    2 --
>  arch/powerpc/kernel/pci_32.c         |    7 +------
>  arch/powerpc/kernel/setup_32.c       |    2 --
>  arch/powerpc/kernel/setup_64.c       |    1 -
>  fs/proc/proc_devtree.c               |    3 +--
>  6 files changed, 2 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
> index cd7a478..d346649 100644
> --- a/arch/powerpc/include/asm/processor.h
> +++ b/arch/powerpc/include/asm/processor.h
> @@ -69,8 +69,6 @@ extern int _prep_type;
>  
>  #ifdef __KERNEL__
>  
> -extern int have_of;
> -
>  struct task_struct;
>  void start_thread(struct pt_regs *regs, unsigned long fdptr, unsigned long sp);
>  void release_thread(struct task_struct *);
> diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
> index 91c3f52..1a32db3 100644
> --- a/arch/powerpc/kernel/pci-common.c
> +++ b/arch/powerpc/kernel/pci-common.c
> @@ -160,8 +160,6 @@ EXPORT_SYMBOL(pci_domain_nr);
>   */
>  struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node)
>  {
> -	if (!have_of)
> -		return NULL;
>  	while(node) {
>  		struct pci_controller *hose, *tmp;
>  		list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
> diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
> index 7ad11e5..132cd80 100644
> --- a/arch/powerpc/kernel/pci_32.c
> +++ b/arch/powerpc/kernel/pci_32.c
> @@ -266,9 +266,6 @@ pci_busdev_to_OF_node(struct pci_bus *bus, int devfn)
>  {
>  	struct device_node *parent, *np;
>  
> -	if (!have_of)
> -		return NULL;
> -
>  	pr_debug("pci_busdev_to_OF_node(%d,0x%x)\n", bus->number, devfn);
>  	parent = scan_OF_for_pci_bus(bus);
>  	if (parent == NULL)
> @@ -309,8 +306,6 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
>  	struct pci_controller* hose;
>  	struct pci_dev* dev = NULL;
>  	
> -	if (!have_of)
> -		return -ENODEV;
>  	/* Make sure it's really a PCI device */
>  	hose = pci_find_hose_for_OF_device(node);
>  	if (!hose || !hose->dn)
> @@ -431,7 +426,7 @@ static int __init pcibios_init(void)
>  	 * numbers vs. kernel bus numbers since we may have to
>  	 * remap them.
>  	 */
> -	if (pci_assign_all_buses && have_of)
> +	if (pci_assign_all_buses)
>  		pcibios_make_OF_bus_map();
>  
>  	/* Call common code to handle resource allocation */
> diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
> index c1a2762..cc4679e 100644
> --- a/arch/powerpc/kernel/setup_32.c
> +++ b/arch/powerpc/kernel/setup_32.c
> @@ -53,8 +53,6 @@ unsigned long ISA_DMA_THRESHOLD;
>  unsigned int DMA_MODE_READ;
>  unsigned int DMA_MODE_WRITE;
>  
> -int have_of = 1;
> -
>  #ifdef CONFIG_VGA_CONSOLE
>  unsigned long vgacon_remap_base;
>  EXPORT_SYMBOL(vgacon_remap_base);
> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
> index 93c875a..ce48f5c 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -70,7 +70,6 @@
>  #define DBG(fmt...)
>  #endif
>  
> -int have_of = 1;
>  int boot_cpuid = 0;
>  u64 ppc64_pft_size;
>  
> diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
> index d777789..de2bba5 100644
> --- a/fs/proc/proc_devtree.c
> +++ b/fs/proc/proc_devtree.c
> @@ -218,8 +218,7 @@ void proc_device_tree_add_node(struct device_node *np,
>  void __init proc_device_tree_init(void)
>  {
>  	struct device_node *root;
> -	if ( !have_of )
> -		return;
> +
>  	proc_device_tree = proc_mkdir("device-tree", NULL);
>  	if (proc_device_tree == 0)
>  		return;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-09 23:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-09 19:47 [PATCH] powerpc: Remove `have_of' global variable Anton Vorontsov
2008-12-09 23:30 ` Benjamin Herrenschmidt

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).