Commit ce871229 authored by Vladimir Murzin's avatar Vladimir Murzin Committed by Greg Kroah-Hartman

serial: mps2-uart: make driver explicitly non-modular

The Kconfig currently controlling compilation of mps2-uart is:

config SERIAL_MPS2_UART
	bool "MPS2 UART port"
	depends on ARM || COMPILE_TEST

...meaning that it currently is not being built as a module by anyone.

Follow commit 89ebc274 ("drivers/tty: make serial/mvebu-uart.c
explicitly non-modular") as an example of moving modular code to
non-modular:

- remove the modular code that is essentially orphaned, so that
  when reading the driver there is no doubt it is builtin-only.

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

- use arch_initcall instead of module_init and remove module_exit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.
Reported-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: default avatarVladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c2c1659b
/* /*
* MPS2 UART driver
*
* Copyright (C) 2015 ARM Limited * Copyright (C) 2015 ARM Limited
* *
* Author: Vladimir Murzin <vladimir.murzin@arm.com> * Author: Vladimir Murzin <vladimir.murzin@arm.com>
...@@ -17,7 +19,6 @@ ...@@ -17,7 +19,6 @@
#include <linux/console.h> #include <linux/console.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
...@@ -569,30 +570,20 @@ static int mps2_serial_probe(struct platform_device *pdev) ...@@ -569,30 +570,20 @@ static int mps2_serial_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int mps2_serial_remove(struct platform_device *pdev)
{
struct mps2_uart_port *mps_port = platform_get_drvdata(pdev);
uart_remove_one_port(&mps2_uart_driver, &mps_port->port);
return 0;
}
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id mps2_match[] = { static const struct of_device_id mps2_match[] = {
{ .compatible = "arm,mps2-uart", }, { .compatible = "arm,mps2-uart", },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, mps2_match);
#endif #endif
static struct platform_driver mps2_serial_driver = { static struct platform_driver mps2_serial_driver = {
.probe = mps2_serial_probe, .probe = mps2_serial_probe,
.remove = mps2_serial_remove,
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.of_match_table = of_match_ptr(mps2_match), .of_match_table = of_match_ptr(mps2_match),
.suppress_bind_attrs = true,
}, },
}; };
...@@ -610,16 +601,4 @@ static int __init mps2_uart_init(void) ...@@ -610,16 +601,4 @@ static int __init mps2_uart_init(void)
return ret; return ret;
} }
module_init(mps2_uart_init); arch_initcall(mps2_uart_init);
static void __exit mps2_uart_exit(void)
{
platform_driver_unregister(&mps2_serial_driver);
uart_unregister_driver(&mps2_uart_driver);
}
module_exit(mps2_uart_exit);
MODULE_AUTHOR("Vladimir Murzin <vladimir.murzin@arm.com>");
MODULE_DESCRIPTION("MPS2 UART driver");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:" DRIVER_NAME);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment