Skip to content

Commit d72d391

Browse files
Paul Gortmakergregkh
authored andcommitted
drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/tty/serial/8250/Kconfig:config SERIAL_8250_MT6577 drivers/tty/serial/8250/Kconfig: bool "Mediatek 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_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. Cc: Jiri Slaby <jslaby@suse.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: linux-serial@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c39dfeb commit d72d391

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

drivers/tty/serial/8250/8250_mtk.c

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
#include <linux/clk.h>
1818
#include <linux/io.h>
19-
#include <linux/module.h>
19+
#include <linux/init.h>
2020
#include <linux/of_irq.h>
2121
#include <linux/of_platform.h>
2222
#include <linux/platform_device.h>
@@ -245,23 +245,6 @@ static int mtk8250_probe(struct platform_device *pdev)
245245
return 0;
246246
}
247247

248-
static int mtk8250_remove(struct platform_device *pdev)
249-
{
250-
struct mtk8250_data *data = platform_get_drvdata(pdev);
251-
252-
pm_runtime_get_sync(&pdev->dev);
253-
254-
serial8250_unregister_port(data->line);
255-
256-
pm_runtime_disable(&pdev->dev);
257-
pm_runtime_put_noidle(&pdev->dev);
258-
259-
if (!pm_runtime_status_suspended(&pdev->dev))
260-
mtk8250_runtime_suspend(&pdev->dev);
261-
262-
return 0;
263-
}
264-
265248
#ifdef CONFIG_PM_SLEEP
266249
static int mtk8250_suspend(struct device *dev)
267250
{
@@ -292,18 +275,18 @@ static const struct of_device_id mtk8250_of_match[] = {
292275
{ .compatible = "mediatek,mt6577-uart" },
293276
{ /* Sentinel */ }
294277
};
295-
MODULE_DEVICE_TABLE(of, mtk8250_of_match);
296278

297279
static struct platform_driver mtk8250_platform_driver = {
298280
.driver = {
299-
.name = "mt6577-uart",
300-
.pm = &mtk8250_pm_ops,
301-
.of_match_table = mtk8250_of_match,
281+
.name = "mt6577-uart",
282+
.pm = &mtk8250_pm_ops,
283+
.of_match_table = mtk8250_of_match,
284+
.suppress_bind_attrs = true,
285+
302286
},
303287
.probe = mtk8250_probe,
304-
.remove = mtk8250_remove,
305288
};
306-
module_platform_driver(mtk8250_platform_driver);
289+
builtin_platform_driver(mtk8250_platform_driver);
307290

308291
#ifdef CONFIG_SERIAL_8250_CONSOLE
309292
static int __init early_mtk8250_setup(struct earlycon_device *device,
@@ -319,7 +302,3 @@ static int __init early_mtk8250_setup(struct earlycon_device *device,
319302

320303
OF_EARLYCON_DECLARE(mtk8250, "mediatek,mt6577-uart", early_mtk8250_setup);
321304
#endif
322-
323-
MODULE_AUTHOR("Matthias Brugger");
324-
MODULE_LICENSE("GPL");
325-
MODULE_DESCRIPTION("Mediatek 8250 serial port driver");

0 commit comments

Comments
 (0)