Skip to content

Commit a53dae4

Browse files
Christoph Jaegerdavem330
authored andcommitted
ide: use module_platform_driver()
Eliminate boilerplate code by using module_platform_driver(). Signed-off-by: Christoph Jaeger <christophjaeger@linux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e7fda6c commit a53dae4

2 files changed

Lines changed: 2 additions & 24 deletions

File tree

‎drivers/ide/au1xxx-ide.c‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -592,18 +592,7 @@ static struct platform_driver au1200_ide_driver = {
592592
.remove = au_ide_remove,
593593
};
594594

595-
static int __init au_ide_init(void)
596-
{
597-
return platform_driver_register(&au1200_ide_driver);
598-
}
599-
600-
static void __exit au_ide_exit(void)
601-
{
602-
platform_driver_unregister(&au1200_ide_driver);
603-
}
595+
module_platform_driver(au1200_ide_driver);
604596

605597
MODULE_LICENSE("GPL");
606598
MODULE_DESCRIPTION("AU1200 IDE driver");
607-
608-
module_init(au_ide_init);
609-
module_exit(au_ide_exit);

‎drivers/ide/ide_platform.c‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,8 @@ static struct platform_driver platform_ide_driver = {
131131
.remove = plat_ide_remove,
132132
};
133133

134-
static int __init platform_ide_init(void)
135-
{
136-
return platform_driver_register(&platform_ide_driver);
137-
}
138-
139-
static void __exit platform_ide_exit(void)
140-
{
141-
platform_driver_unregister(&platform_ide_driver);
142-
}
134+
module_platform_driver(platform_ide_driver);
143135

144136
MODULE_DESCRIPTION("Platform IDE driver");
145137
MODULE_LICENSE("GPL");
146138
MODULE_ALIAS("platform:pata_platform");
147-
148-
module_init(platform_ide_init);
149-
module_exit(platform_ide_exit);

0 commit comments

Comments
 (0)