diff mbox

[RFC,3/3] ARM/AVR32: get rid of serial_at91.h

Message ID E1TEzfE-000780-1t@rmk-PC.arm.linux.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Russell King Sept. 21, 2012, 9:36 a.m. UTC
The definitions provided by serial_at91.h are only used by the
atmel_serial driver, and the function that uses it is never called
from anywhere in the kernel.  Therefore, these definitions are unused
and/or obsolete, and can be removed.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/include/asm/mach/serial_at91.h   |   33 -----------------------------
 arch/avr32/include/asm/mach/serial_at91.h |   33 -----------------------------
 drivers/tty/serial/atmel_serial.c         |   18 ---------------
 3 files changed, 0 insertions(+), 84 deletions(-)
 delete mode 100644 arch/arm/include/asm/mach/serial_at91.h
 delete mode 100644 arch/avr32/include/asm/mach/serial_at91.h

Comments

Jean-Christophe PLAGNIOL-VILLARD Nov. 16, 2012, 9:53 a.m. UTC | #1
On 10:36 Fri 21 Sep     , Russell King wrote:
> The definitions provided by serial_at91.h are only used by the
> atmel_serial driver, and the function that uses it is never called
> from anywhere in the kernel.  Therefore, these definitions are unused
> and/or obsolete, and can be removed.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
personnaly I'm ok with it too
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

but Andrew seems use it so let him reply

Best Regards,
J.
> ---
>  arch/arm/include/asm/mach/serial_at91.h   |   33 -----------------------------
>  arch/avr32/include/asm/mach/serial_at91.h |   33 -----------------------------
>  drivers/tty/serial/atmel_serial.c         |   18 ---------------
>  3 files changed, 0 insertions(+), 84 deletions(-)
>  delete mode 100644 arch/arm/include/asm/mach/serial_at91.h
>  delete mode 100644 arch/avr32/include/asm/mach/serial_at91.h
> 
> diff --git a/arch/arm/include/asm/mach/serial_at91.h b/arch/arm/include/asm/mach/serial_at91.h
> deleted file mode 100644
> index ea6d063..0000000
> --- a/arch/arm/include/asm/mach/serial_at91.h
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -/*
> - *  arch/arm/include/asm/mach/serial_at91.h
> - *
> - *  Based on serial_sa1100.h  by Nicolas Pitre
> - *
> - *  Copyright (C) 2002 ATMEL Rousset
> - *
> - *  Low level machine dependent UART functions.
> - */
> -
> -struct uart_port;
> -
> -/*
> - * This is a temporary structure for registering these
> - * functions; it is intended to be discarded after boot.
> - */
> -struct atmel_port_fns {
> -	void	(*set_mctrl)(struct uart_port *, u_int);
> -	u_int	(*get_mctrl)(struct uart_port *);
> -	void	(*enable_ms)(struct uart_port *);
> -	void	(*pm)(struct uart_port *, u_int, u_int);
> -	int	(*set_wake)(struct uart_port *, u_int);
> -	int	(*open)(struct uart_port *);
> -	void	(*close)(struct uart_port *);
> -};
> -
> -#if defined(CONFIG_SERIAL_ATMEL)
> -void atmel_register_uart_fns(struct atmel_port_fns *fns);
> -#else
> -#define atmel_register_uart_fns(fns) do { } while (0)
> -#endif
> -
> -
> diff --git a/arch/avr32/include/asm/mach/serial_at91.h b/arch/avr32/include/asm/mach/serial_at91.h
> deleted file mode 100644
> index 55b317a..0000000
> --- a/arch/avr32/include/asm/mach/serial_at91.h
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -/*
> - *  linux/include/asm-arm/mach/serial_at91.h
> - *
> - *  Based on serial_sa1100.h  by Nicolas Pitre
> - *
> - *  Copyright (C) 2002 ATMEL Rousset
> - *
> - *  Low level machine dependent UART functions.
> - */
> -
> -struct uart_port;
> -
> -/*
> - * This is a temporary structure for registering these
> - * functions; it is intended to be discarded after boot.
> - */
> -struct atmel_port_fns {
> -	void	(*set_mctrl)(struct uart_port *, u_int);
> -	u_int	(*get_mctrl)(struct uart_port *);
> -	void	(*enable_ms)(struct uart_port *);
> -	void	(*pm)(struct uart_port *, u_int, u_int);
> -	int	(*set_wake)(struct uart_port *, u_int);
> -	int	(*open)(struct uart_port *);
> -	void	(*close)(struct uart_port *);
> -};
> -
> -#if defined(CONFIG_SERIAL_ATMEL)
> -void atmel_register_uart_fns(struct atmel_port_fns *fns);
> -#else
> -#define atmel_register_uart_fns(fns) do { } while (0)
> -#endif
> -
> -
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 3d7e1ee..a6134c9 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -43,7 +43,6 @@
>  #include <asm/io.h>
>  #include <asm/ioctls.h>
>  
> -#include <asm/mach/serial_at91.h>
>  #include <mach/board.h>
>  
>  #ifdef CONFIG_ARM
> @@ -1513,23 +1512,6 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
>  	}
>  }
>  
> -/*
> - * Register board-specific modem-control line handlers.
> - */
> -void __init atmel_register_uart_fns(struct atmel_port_fns *fns)
> -{
> -	if (fns->enable_ms)
> -		atmel_pops.enable_ms = fns->enable_ms;
> -	if (fns->get_mctrl)
> -		atmel_pops.get_mctrl = fns->get_mctrl;
> -	if (fns->set_mctrl)
> -		atmel_pops.set_mctrl = fns->set_mctrl;
> -	atmel_open_hook		= fns->open;
> -	atmel_close_hook	= fns->close;
> -	atmel_pops.pm		= fns->pm;
> -	atmel_pops.set_wake	= fns->set_wake;
> -}
> -
>  struct platform_device *atmel_default_console_device;	/* the serial console device */
>  
>  #ifdef CONFIG_SERIAL_ATMEL_CONSOLE
> -- 
> 1.7.4.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Nicolas Ferre Nov. 16, 2012, 10:12 a.m. UTC | #2
On 11/16/2012 10:53 AM, Jean-Christophe PLAGNIOL-VILLARD :
> On 10:36 Fri 21 Sep     , Russell King wrote:
>> The definitions provided by serial_at91.h are only used by the
>> atmel_serial driver, and the function that uses it is never called
>> from anywhere in the kernel.  Therefore, these definitions are unused
>> and/or obsolete, and can be removed.
>>
>> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> personnaly I'm ok with it too
> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> 
> but Andrew seems use it so let him reply

Yes, during previous attempt to remove the files, Andrew said that it
was used internally in his former company. I had no serious reason to
remove it, so we kept it back then.
But now it seems the situation has evolved and we must consider the move
to a single kernel image and the will to clean the include/asm/mach
directory.

So, now, on my side:

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

>> ---
>>  arch/arm/include/asm/mach/serial_at91.h   |   33 -----------------------------
>>  arch/avr32/include/asm/mach/serial_at91.h |   33 -----------------------------
>>  drivers/tty/serial/atmel_serial.c         |   18 ---------------
>>  3 files changed, 0 insertions(+), 84 deletions(-)
>>  delete mode 100644 arch/arm/include/asm/mach/serial_at91.h
>>  delete mode 100644 arch/avr32/include/asm/mach/serial_at91.h
>>
>> diff --git a/arch/arm/include/asm/mach/serial_at91.h b/arch/arm/include/asm/mach/serial_at91.h
>> deleted file mode 100644
>> index ea6d063..0000000
>> --- a/arch/arm/include/asm/mach/serial_at91.h
>> +++ /dev/null
>> @@ -1,33 +0,0 @@
>> -/*
>> - *  arch/arm/include/asm/mach/serial_at91.h
>> - *
>> - *  Based on serial_sa1100.h  by Nicolas Pitre
>> - *
>> - *  Copyright (C) 2002 ATMEL Rousset
>> - *
>> - *  Low level machine dependent UART functions.
>> - */
>> -
>> -struct uart_port;
>> -
>> -/*
>> - * This is a temporary structure for registering these
>> - * functions; it is intended to be discarded after boot.
>> - */
>> -struct atmel_port_fns {
>> -	void	(*set_mctrl)(struct uart_port *, u_int);
>> -	u_int	(*get_mctrl)(struct uart_port *);
>> -	void	(*enable_ms)(struct uart_port *);
>> -	void	(*pm)(struct uart_port *, u_int, u_int);
>> -	int	(*set_wake)(struct uart_port *, u_int);
>> -	int	(*open)(struct uart_port *);
>> -	void	(*close)(struct uart_port *);
>> -};
>> -
>> -#if defined(CONFIG_SERIAL_ATMEL)
>> -void atmel_register_uart_fns(struct atmel_port_fns *fns);
>> -#else
>> -#define atmel_register_uart_fns(fns) do { } while (0)
>> -#endif
>> -
>> -
>> diff --git a/arch/avr32/include/asm/mach/serial_at91.h b/arch/avr32/include/asm/mach/serial_at91.h
>> deleted file mode 100644
>> index 55b317a..0000000
>> --- a/arch/avr32/include/asm/mach/serial_at91.h
>> +++ /dev/null
>> @@ -1,33 +0,0 @@
>> -/*
>> - *  linux/include/asm-arm/mach/serial_at91.h
>> - *
>> - *  Based on serial_sa1100.h  by Nicolas Pitre
>> - *
>> - *  Copyright (C) 2002 ATMEL Rousset
>> - *
>> - *  Low level machine dependent UART functions.
>> - */
>> -
>> -struct uart_port;
>> -
>> -/*
>> - * This is a temporary structure for registering these
>> - * functions; it is intended to be discarded after boot.
>> - */
>> -struct atmel_port_fns {
>> -	void	(*set_mctrl)(struct uart_port *, u_int);
>> -	u_int	(*get_mctrl)(struct uart_port *);
>> -	void	(*enable_ms)(struct uart_port *);
>> -	void	(*pm)(struct uart_port *, u_int, u_int);
>> -	int	(*set_wake)(struct uart_port *, u_int);
>> -	int	(*open)(struct uart_port *);
>> -	void	(*close)(struct uart_port *);
>> -};
>> -
>> -#if defined(CONFIG_SERIAL_ATMEL)
>> -void atmel_register_uart_fns(struct atmel_port_fns *fns);
>> -#else
>> -#define atmel_register_uart_fns(fns) do { } while (0)
>> -#endif
>> -
>> -
>> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
>> index 3d7e1ee..a6134c9 100644
>> --- a/drivers/tty/serial/atmel_serial.c
>> +++ b/drivers/tty/serial/atmel_serial.c
>> @@ -43,7 +43,6 @@
>>  #include <asm/io.h>
>>  #include <asm/ioctls.h>
>>  
>> -#include <asm/mach/serial_at91.h>
>>  #include <mach/board.h>
>>  
>>  #ifdef CONFIG_ARM
>> @@ -1513,23 +1512,6 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
>>  	}
>>  }
>>  
>> -/*
>> - * Register board-specific modem-control line handlers.
>> - */
>> -void __init atmel_register_uart_fns(struct atmel_port_fns *fns)
>> -{
>> -	if (fns->enable_ms)
>> -		atmel_pops.enable_ms = fns->enable_ms;
>> -	if (fns->get_mctrl)
>> -		atmel_pops.get_mctrl = fns->get_mctrl;
>> -	if (fns->set_mctrl)
>> -		atmel_pops.set_mctrl = fns->set_mctrl;
>> -	atmel_open_hook		= fns->open;
>> -	atmel_close_hook	= fns->close;
>> -	atmel_pops.pm		= fns->pm;
>> -	atmel_pops.set_wake	= fns->set_wake;
>> -}
>> -
>>  struct platform_device *atmel_default_console_device;	/* the serial console device */
>>  
>>  #ifdef CONFIG_SERIAL_ATMEL_CONSOLE
>> -- 
>> 1.7.4.4
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 
>
Russell King - ARM Linux Nov. 16, 2012, 11:38 a.m. UTC | #3
On Fri, Nov 16, 2012 at 11:12:46AM +0100, Nicolas Ferre wrote:
> On 11/16/2012 10:53 AM, Jean-Christophe PLAGNIOL-VILLARD :
> > On 10:36 Fri 21 Sep     , Russell King wrote:
> >> The definitions provided by serial_at91.h are only used by the
> >> atmel_serial driver, and the function that uses it is never called
> >> from anywhere in the kernel.  Therefore, these definitions are unused
> >> and/or obsolete, and can be removed.
> >>
> >> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> > personnaly I'm ok with it too
> > Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > 
> > but Andrew seems use it so let him reply
> 
> Yes, during previous attempt to remove the files, Andrew said that it
> was used internally in his former company. I had no serious reason to
> remove it, so we kept it back then.
> But now it seems the situation has evolved and we must consider the move
> to a single kernel image and the will to clean the include/asm/mach
> directory.
> 
> So, now, on my side:
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Thanks for reminding me about this series, I'd completely forgotten about
it.  It'll be in the next linux-next tree now.
Andrew Victor Nov. 16, 2012, 8:46 p.m. UTC | #4
hi,

> Yes, during previous attempt to remove the files, Andrew said that it
> was used internally in his former company. I had no serious reason to
> remove it, so we kept it back then.
> But now it seems the situation has evolved and we must consider the move
> to a single kernel image and the will to clean the include/asm/mach
> directory.

SAN People will just need to maintain a custom patch / driver for this.
No reason to delay the progress of mainline.

Acked-By: Andrew Victor <avictor.za@gmail.com>
Joachim Eastwood Nov. 16, 2012, 10:08 p.m. UTC | #5
Hi Russell,

I made a similar patch a while ago. One note below.
(http://marc.info/?l=linux-arm-kernel&m=133372829203680)

On 21 September 2012 11:36, Russell King <rmk+kernel@arm.linux.org.uk> wrote:
> The definitions provided by serial_at91.h are only used by the
> atmel_serial driver, and the function that uses it is never called
> from anywhere in the kernel.  Therefore, these definitions are unused
> and/or obsolete, and can be removed.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
>  arch/arm/include/asm/mach/serial_at91.h   |   33 -----------------------------
>  arch/avr32/include/asm/mach/serial_at91.h |   33 -----------------------------
>  drivers/tty/serial/atmel_serial.c         |   18 ---------------
>  3 files changed, 0 insertions(+), 84 deletions(-)
>  delete mode 100644 arch/arm/include/asm/mach/serial_at91.h
>  delete mode 100644 arch/avr32/include/asm/mach/serial_at91.h

<snip>

> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 3d7e1ee..a6134c9 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -43,7 +43,6 @@
>  #include <asm/io.h>
>  #include <asm/ioctls.h>
>
> -#include <asm/mach/serial_at91.h>
>  #include <mach/board.h>
>
>  #ifdef CONFIG_ARM
> @@ -1513,23 +1512,6 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
>         }
>  }
>
> -/*
> - * Register board-specific modem-control line handlers.
> - */
> -void __init atmel_register_uart_fns(struct atmel_port_fns *fns)
> -{
> -       if (fns->enable_ms)
> -               atmel_pops.enable_ms = fns->enable_ms;
> -       if (fns->get_mctrl)
> -               atmel_pops.get_mctrl = fns->get_mctrl;
> -       if (fns->set_mctrl)
> -               atmel_pops.set_mctrl = fns->set_mctrl;
> -       atmel_open_hook         = fns->open;
> -       atmel_close_hook        = fns->close;
> -       atmel_pops.pm           = fns->pm;
> -       atmel_pops.set_wake     = fns->set_wake;
> -}

When the atmel_open_hook/atmel_open_close assignment is dropped, these
global variables will be useless so we should remove them as well.
There are also some other code that uses the variables that can be
dropped. Should shave another 22 lines of code off atmel_serial.c

I can send out a patch on top of yours if you prefer that.

regards
Joachim Eastwood
Russell King - ARM Linux Nov. 16, 2012, 11:08 p.m. UTC | #6
On Fri, Nov 16, 2012 at 11:08:47PM +0100, Joachim Eastwood wrote:
> When the atmel_open_hook/atmel_open_close assignment is dropped, these
> global variables will be useless so we should remove them as well.
> There are also some other code that uses the variables that can be
> dropped. Should shave another 22 lines of code off atmel_serial.c
> 
> I can send out a patch on top of yours if you prefer that.

Yes please.

Thanks.
diff mbox

Patch

diff --git a/arch/arm/include/asm/mach/serial_at91.h b/arch/arm/include/asm/mach/serial_at91.h
deleted file mode 100644
index ea6d063..0000000
--- a/arch/arm/include/asm/mach/serial_at91.h
+++ /dev/null
@@ -1,33 +0,0 @@ 
-/*
- *  arch/arm/include/asm/mach/serial_at91.h
- *
- *  Based on serial_sa1100.h  by Nicolas Pitre
- *
- *  Copyright (C) 2002 ATMEL Rousset
- *
- *  Low level machine dependent UART functions.
- */
-
-struct uart_port;
-
-/*
- * This is a temporary structure for registering these
- * functions; it is intended to be discarded after boot.
- */
-struct atmel_port_fns {
-	void	(*set_mctrl)(struct uart_port *, u_int);
-	u_int	(*get_mctrl)(struct uart_port *);
-	void	(*enable_ms)(struct uart_port *);
-	void	(*pm)(struct uart_port *, u_int, u_int);
-	int	(*set_wake)(struct uart_port *, u_int);
-	int	(*open)(struct uart_port *);
-	void	(*close)(struct uart_port *);
-};
-
-#if defined(CONFIG_SERIAL_ATMEL)
-void atmel_register_uart_fns(struct atmel_port_fns *fns);
-#else
-#define atmel_register_uart_fns(fns) do { } while (0)
-#endif
-
-
diff --git a/arch/avr32/include/asm/mach/serial_at91.h b/arch/avr32/include/asm/mach/serial_at91.h
deleted file mode 100644
index 55b317a..0000000
--- a/arch/avr32/include/asm/mach/serial_at91.h
+++ /dev/null
@@ -1,33 +0,0 @@ 
-/*
- *  linux/include/asm-arm/mach/serial_at91.h
- *
- *  Based on serial_sa1100.h  by Nicolas Pitre
- *
- *  Copyright (C) 2002 ATMEL Rousset
- *
- *  Low level machine dependent UART functions.
- */
-
-struct uart_port;
-
-/*
- * This is a temporary structure for registering these
- * functions; it is intended to be discarded after boot.
- */
-struct atmel_port_fns {
-	void	(*set_mctrl)(struct uart_port *, u_int);
-	u_int	(*get_mctrl)(struct uart_port *);
-	void	(*enable_ms)(struct uart_port *);
-	void	(*pm)(struct uart_port *, u_int, u_int);
-	int	(*set_wake)(struct uart_port *, u_int);
-	int	(*open)(struct uart_port *);
-	void	(*close)(struct uart_port *);
-};
-
-#if defined(CONFIG_SERIAL_ATMEL)
-void atmel_register_uart_fns(struct atmel_port_fns *fns);
-#else
-#define atmel_register_uart_fns(fns) do { } while (0)
-#endif
-
-
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 3d7e1ee..a6134c9 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -43,7 +43,6 @@ 
 #include <asm/io.h>
 #include <asm/ioctls.h>
 
-#include <asm/mach/serial_at91.h>
 #include <mach/board.h>
 
 #ifdef CONFIG_ARM
@@ -1513,23 +1512,6 @@  static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
 	}
 }
 
-/*
- * Register board-specific modem-control line handlers.
- */
-void __init atmel_register_uart_fns(struct atmel_port_fns *fns)
-{
-	if (fns->enable_ms)
-		atmel_pops.enable_ms = fns->enable_ms;
-	if (fns->get_mctrl)
-		atmel_pops.get_mctrl = fns->get_mctrl;
-	if (fns->set_mctrl)
-		atmel_pops.set_mctrl = fns->set_mctrl;
-	atmel_open_hook		= fns->open;
-	atmel_close_hook	= fns->close;
-	atmel_pops.pm		= fns->pm;
-	atmel_pops.set_wake	= fns->set_wake;
-}
-
 struct platform_device *atmel_default_console_device;	/* the serial console device */
 
 #ifdef CONFIG_SERIAL_ATMEL_CONSOLE