linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: don't create two devices for each cpm_uart device tree node
@ 2008-02-19 23:32 Nikita V. Youshchenko
  2008-02-20 16:40 ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Nikita V. Youshchenko @ 2008-02-19 23:32 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1903 bytes --]


    powerpc: don't create two devices for each cpm_uart device tree node
    
    Code in arch/powerpc/sysdev/fsl_soc.c used to create two 'struct device'
    objects for each cpm_uart device tree node - one "fsl-cpm-scc:uart"
    in cpm_uart_of_init() and one "fsl-cpm-smc:uart" in cpm_smc_uart_of_init().
    
    This patch adds additional test to those routines, such that cpm_uart_of_init()
    only registers devices with model "SCC", and cpm_smc_uart_of_init() only
    registers devices with model "SMC".
    
    Signed-off-by: Nikita Youshchenko <yoush@debian.org>

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index f1b8412..536f8c9 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -890,6 +890,10 @@ static int __init cpm_uart_of_init(void)
 		const int *id;
 		const char *model;
 
+		model = of_get_property(np, "model", NULL);
+		if (!model || strcmp(model, "SCC") != 0)
+			continue;
+
 		memset(r, 0, sizeof(r));
 		memset(&cpm_uart_data, 0, sizeof(cpm_uart_data));
 
@@ -917,7 +921,6 @@ static int __init cpm_uart_of_init(void)
 		id = of_get_property(np, "device-id", NULL);
 		cpm_uart_data.fs_no = *id;
 
-		model = of_get_property(np, "model", NULL);
 		strcpy(cpm_uart_data.fs_type, model);
 
 		cpm_uart_data.uart_clk = ppc_proc_freq;
@@ -1175,6 +1178,10 @@ static int __init cpm_smc_uart_of_init(void)
 		const int *id;
 		const char *model;
 
+		model = of_get_property(np, "model", NULL);
+		if (!model || strcmp(model, "SMC") != 0)
+			continue;
+
 		memset(r, 0, sizeof(r));
 		memset(&cpm_uart_data, 0, sizeof(cpm_uart_data));
 
@@ -1200,7 +1207,6 @@ static int __init cpm_smc_uart_of_init(void)
 			goto err;
 		}
 
-		model = of_get_property(np, "model", NULL);
 		strcpy(cpm_uart_data.fs_type, model);
 
 		id = of_get_property(np, "device-id", NULL);

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] powerpc: don't create two devices for each cpm_uart device tree node
  2008-02-19 23:32 [PATCH] powerpc: don't create two devices for each cpm_uart device tree node Nikita V. Youshchenko
@ 2008-02-20 16:40 ` Scott Wood
  2008-02-21  6:13   ` Nikita V. Youshchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2008-02-20 16:40 UTC (permalink / raw)
  To: Nikita V. Youshchenko; +Cc: linuxppc-dev

On Wed, Feb 20, 2008 at 02:32:33AM +0300, Nikita V. Youshchenko wrote:
> 
>     powerpc: don't create two devices for each cpm_uart device tree node
>     
>     Code in arch/powerpc/sysdev/fsl_soc.c used to create two 'struct device'
>     objects for each cpm_uart device tree node - one "fsl-cpm-scc:uart"
>     in cpm_uart_of_init() and one "fsl-cpm-smc:uart" in cpm_smc_uart_of_init().

This is old code that only exists for non-CONFIG_PPC_CPM_NEW_BINDING
boards.  As there are none of these remaining in-tree, this code should
go away soon.

-Scott

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

* Re: [PATCH] powerpc: don't create two devices for each cpm_uart device tree node
  2008-02-20 16:40 ` Scott Wood
@ 2008-02-21  6:13   ` Nikita V. Youshchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Nikita V. Youshchenko @ 2008-02-21  6:13 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev

> On Wed, Feb 20, 2008 at 02:32:33AM +0300, Nikita V. Youshchenko wrote:
> >     powerpc: don't create two devices for each cpm_uart device tree
> > node
> >
> >     Code in arch/powerpc/sysdev/fsl_soc.c used to create two 'struct
> > device' objects for each cpm_uart device tree node - one
> > "fsl-cpm-scc:uart" in cpm_uart_of_init() and one "fsl-cpm-smc:uart" in
> > cpm_smc_uart_of_init().
>
> This is old code that only exists for non-CONFIG_PPC_CPM_NEW_BINDING
> boards.  As there are none of these remaining in-tree, this code should
> go away soon.

Thank you for information.

I am working with vendor kernel, based on 2.6.18, and that does not have 
CONFIG_PPC_CPM_NEW_BINDING. I thought that fix I made for that kernel 
could be usable for mainline, but if not - nevermind.

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

end of thread, other threads:[~2008-02-21  6:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-19 23:32 [PATCH] powerpc: don't create two devices for each cpm_uart device tree node Nikita V. Youshchenko
2008-02-20 16:40 ` Scott Wood
2008-02-21  6:13   ` Nikita V. Youshchenko

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