Skip to content

Commit c39dfeb

Browse files
Paul Gortmakergregkh
authored andcommitted
drivers/tty/serial: make serial/atmel_serial.c explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/tty/serial/Kconfig:config SERIAL_ATMEL drivers/tty/serial/Kconfig: bool "AT91 / AT32 on-chip serial port support" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. We explicitly disallow a driver unbind, since that doesn't have a sensible use case anyway, and it allows us to drop the ".remove" code for non-modular drivers. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We don't replace module.h with init.h since the file already has that. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-serial@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent cc56884 commit c39dfeb

File tree

1 file changed

+4
-41
lines changed

1 file changed

+4
-41
lines changed

drivers/tty/serial/atmel_serial.c

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2323
*
2424
*/
25-
#include <linux/module.h>
2625
#include <linux/tty.h>
2726
#include <linux/ioport.h>
2827
#include <linux/slab.h>
@@ -2762,37 +2761,14 @@ static int atmel_serial_probe(struct platform_device *pdev)
27622761
return ret;
27632762
}
27642763

2765-
static int atmel_serial_remove(struct platform_device *pdev)
2766-
{
2767-
struct uart_port *port = platform_get_drvdata(pdev);
2768-
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
2769-
int ret = 0;
2770-
2771-
tasklet_kill(&atmel_port->tasklet);
2772-
2773-
device_init_wakeup(&pdev->dev, 0);
2774-
2775-
ret = uart_remove_one_port(&atmel_uart, port);
2776-
2777-
kfree(atmel_port->rx_ring.buf);
2778-
2779-
/* "port" is allocated statically, so we shouldn't free it */
2780-
2781-
clear_bit(port->line, atmel_ports_in_use);
2782-
2783-
clk_put(atmel_port->clk);
2784-
2785-
return ret;
2786-
}
2787-
27882764
static struct platform_driver atmel_serial_driver = {
27892765
.probe = atmel_serial_probe,
2790-
.remove = atmel_serial_remove,
27912766
.suspend = atmel_serial_suspend,
27922767
.resume = atmel_serial_resume,
27932768
.driver = {
2794-
.name = "atmel_usart",
2795-
.of_match_table = of_match_ptr(atmel_serial_dt_ids),
2769+
.name = "atmel_usart",
2770+
.of_match_table = of_match_ptr(atmel_serial_dt_ids),
2771+
.suppress_bind_attrs = true,
27962772
},
27972773
};
27982774

@@ -2810,17 +2786,4 @@ static int __init atmel_serial_init(void)
28102786

28112787
return ret;
28122788
}
2813-
2814-
static void __exit atmel_serial_exit(void)
2815-
{
2816-
platform_driver_unregister(&atmel_serial_driver);
2817-
uart_unregister_driver(&atmel_uart);
2818-
}
2819-
2820-
module_init(atmel_serial_init);
2821-
module_exit(atmel_serial_exit);
2822-
2823-
MODULE_AUTHOR("Rick Bronson");
2824-
MODULE_DESCRIPTION("Atmel AT91 / AT32 serial port driver");
2825-
MODULE_LICENSE("GPL");
2826-
MODULE_ALIAS("platform:atmel_usart");
2789+
device_initcall(atmel_serial_init);

0 commit comments

Comments
 (0)