linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ppchameleon_early_serial_map hidden under #ifdef CONFIG_SERIAL_8250
@ 2007-04-03  5:21 Igor Marnat
  2007-04-03  6:05 ` Grant Likely
  0 siblings, 1 reply; 4+ messages in thread
From: Igor Marnat @ 2007-04-03  5:21 UTC (permalink / raw)
  To: linuxppc-dev

Hello List!

Having selected PPChameleonEVB as a platform and having turned off
seral driver (CONFIG_SERIAL_8250 is not set) I got the following error
message during kernel compilation:

arch/ppc/platforms/4xx/built-in.o: In function `board_setup_arch':
: undefined reference to `early_serial_setup'


Perhaps the following patch will be ok?


Date: Tue, 3 Apr 2007 09:11:35 +0400
Subject: [PATCH] ppchameleon_early_serial_map hidden under #ifdef CONFIG_SERIAL_8250
Signed-off-by: Igor Marnat <marny@rambler.ru>
---
 arch/ppc/platforms/4xx/ppchameleon.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/ppc/platforms/4xx/ppchameleon.c b/arch/ppc/platforms/4xx/ppchameleon.c
index 6d8b7ad..159d4a6 100644
--- a/arch/ppc/platforms/4xx/ppchameleon.c
+++ b/arch/ppc/platforms/4xx/ppchameleon.c
@@ -45,7 +45,9 @@
 void *ppchameleon_rtc_base;

 extern void gen550_init(int, struct uart_port *);
+#ifdef CONFIG_SERIAL_8250
 extern int early_serial_setup(struct uart_port *port);
+#endif /* CONFIG_SERIAL_8250 */

 /* Some IRQs unique to the board
  * Used by the generic 405 PCI setup functions in ppc4xx_pci.c
@@ -75,6 +77,7 @@ ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
  * Calculate the proper input baud rate and setup the serial driver.
  */

+#ifdef CONFIG_SERIAL_8250
 static void __init
 ppchameleon_early_serial_map (void)
 {
@@ -105,7 +108,9 @@ ppchameleon_early_serial_map (void)
                printk ("Early serial init of port 0 failed\n");
        }
 }
-
+#else /* CONFIG_SERIAL_8250 */
+#define ppchameleon_early_serial_map()
+#endif /* CONFIG_SERIAL_8250 */

 void __init board_setup_arch (void)
 {
-- 

Best regards,
Igor Marnat
mailto:marny@rambler.ru

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

* Re: [PATCH] ppchameleon_early_serial_map hidden under #ifdef CONFIG_SERIAL_8250
  2007-04-03  5:21 [PATCH] ppchameleon_early_serial_map hidden under #ifdef CONFIG_SERIAL_8250 Igor Marnat
@ 2007-04-03  6:05 ` Grant Likely
  2007-04-04  7:58   ` Igor Marnat
  0 siblings, 1 reply; 4+ messages in thread
From: Grant Likely @ 2007-04-03  6:05 UTC (permalink / raw)
  To: Igor Marnat; +Cc: linuxppc-dev

On 4/2/07, Igor Marnat <marny@rambler.ru> wrote:
> Hello List!
>
> Having selected PPChameleonEVB as a platform and having turned off
> seral driver (CONFIG_SERIAL_8250 is not set) I got the following error
> message during kernel compilation:
>
> arch/ppc/platforms/4xx/built-in.o: In function `board_setup_arch':
> : undefined reference to `early_serial_setup'
>
>
> Perhaps the following patch will be ok?

In general looks okay, but one comment below.  This code is going to
need to be moved over to arch/powerpc fairly soon.

> diff --git a/arch/ppc/platforms/4xx/ppchameleon.c b/arch/ppc/platforms/4xx/ppchameleon.c
> index 6d8b7ad..159d4a6 100644
> --- a/arch/ppc/platforms/4xx/ppchameleon.c
> +++ b/arch/ppc/platforms/4xx/ppchameleon.c
> @@ -45,7 +45,9 @@
>  void *ppchameleon_rtc_base;
>
>  extern void gen550_init(int, struct uart_port *);
> +#ifdef CONFIG_SERIAL_8250
>  extern int early_serial_setup(struct uart_port *port);
> +#endif /* CONFIG_SERIAL_8250 */

This is just ugly, but not because of your patch.  External function
prototypes that aren't pulled from header files can lead to all kinds
of wierdness.  Since the code is already ugly and dangerous, I
wouldn't even bother with adding the #ifdef around it.

>
>  /* Some IRQs unique to the board
>   * Used by the generic 405 PCI setup functions in ppc4xx_pci.c
> @@ -75,6 +77,7 @@ ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
>   * Calculate the proper input baud rate and setup the serial driver.
>   */
>
> +#ifdef CONFIG_SERIAL_8250
>  static void __init
>  ppchameleon_early_serial_map (void)
>  {
> @@ -105,7 +108,9 @@ ppchameleon_early_serial_map (void)
>                 printk ("Early serial init of port 0 failed\n");
>         }
>  }
> -
> +#else /* CONFIG_SERIAL_8250 */
> +#define ppchameleon_early_serial_map()
> +#endif /* CONFIG_SERIAL_8250 */
>
>  void __init board_setup_arch (void)
>  {
> --

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

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

* Re: [PATCH] ppchameleon_early_serial_map hidden under #ifdef CONFIG_SERIAL_8250
  2007-04-03  6:05 ` Grant Likely
@ 2007-04-04  7:58   ` Igor Marnat
       [not found]     ` <528646bc0704041012v5cd1fd05pa9ca88d05b7e031b@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Igor Marnat @ 2007-04-04  7:58 UTC (permalink / raw)
  To: glikely, Grant Likely; +Cc: linuxppc-dev

Hello Grant and List!

GL> This is just ugly, but not because of your patch.  External function
GL> prototypes that aren't pulled from header files can lead to all kinds
GL> of wierdness.  Since the code is already ugly and dangerous, I
GL> wouldn't even bother with adding the #ifdef around it.

Well, should I change the patch or it will be applied as is?

Best regards,
Igor Marnat                            mailto:marny@rambler.ru

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

* Re[2]: [PATCH] ppchameleon_early_serial_map hidden under #ifdef CONFIG_SERIAL_8250
       [not found]     ` <528646bc0704041012v5cd1fd05pa9ca88d05b7e031b@mail.gmail.com>
@ 2007-04-10  7:31       ` Igor Marnat
  0 siblings, 0 replies; 4+ messages in thread
From: Igor Marnat @ 2007-04-10  7:31 UTC (permalink / raw)
  To: glikely, Grant Likely; +Cc: linuxppc-dev

Hello!

>> GL> This is just ugly, but not because of your patch.  External function
>> GL> prototypes that aren't pulled from header files can lead to all kinds
>> GL> of wierdness.  Since the code is already ugly and dangerous, I
>> GL> wouldn't even bother with adding the #ifdef around it.

I changed the patch as you recommended. You were correct, external
declarations are of no use there. At least kernel gets built
successfully both with and without CONFIG_SERIAL_8250 with the patch
applied. Hope it will suit better.


Author: Igor Marnat <marny@rambler.ru>
Date:   Tue Apr 10 11:16:35 2007 +0400

    ppchameleon_early_serial_map hidden under #ifdef CONFIG_SERIAL_8250,
    "extern void gen550_init" and  "extern int early_serial_setup" declarations removed
    since they are already included in header files

    Signed-off-by: Igor Marnat <marny@rambler.ru>

diff --git a/arch/ppc/platforms/4xx/ppchameleon.c b/arch/ppc/platforms/4xx/ppchameleon.c
index 6d8b7ad..f3cf7ec 100644
--- a/arch/ppc/platforms/4xx/ppchameleon.c
+++ b/arch/ppc/platforms/4xx/ppchameleon.c
@@ -44,9 +44,6 @@

 void *ppchameleon_rtc_base;

-extern void gen550_init(int, struct uart_port *);
-extern int early_serial_setup(struct uart_port *port);
-
 /* Some IRQs unique to the board
  * Used by the generic 405 PCI setup functions in ppc4xx_pci.c
  */
@@ -75,6 +72,7 @@ ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
  * Calculate the proper input baud rate and setup the serial driver.
  */

+#ifdef CONFIG_SERIAL_8250
 static void __init
 ppchameleon_early_serial_map (void)
 {
@@ -105,7 +103,9 @@ ppchameleon_early_serial_map (void)
                printk ("Early serial init of port 0 failed\n");
        }
 }
-
+#else /* CONFIG_SERIAL_8250 */
+#define ppchameleon_early_serial_map()
+#endif /* CONFIG_SERIAL_8250 */

 void __init board_setup_arch (void)
 {



Best regards,
Igor Marnat
mailto:marny@rambler.ru

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

end of thread, other threads:[~2007-04-10  7:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-03  5:21 [PATCH] ppchameleon_early_serial_map hidden under #ifdef CONFIG_SERIAL_8250 Igor Marnat
2007-04-03  6:05 ` Grant Likely
2007-04-04  7:58   ` Igor Marnat
     [not found]     ` <528646bc0704041012v5cd1fd05pa9ca88d05b7e031b@mail.gmail.com>
2007-04-10  7:31       ` Re[2]: " Igor Marnat

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