Skip to content

Commit 36f10a9

Browse files
Uwe Kleine-Königdamien-lemoal
authored andcommitted
ata: pata_falcon: Stop using module_platform_driver_probe()
On today's platforms the benefit of platform_driver_probe() isn't that relevant any more. It allows to drop some code after booting (or module loading) for .probe() and discard the .remove() function completely if the driver is built-in. This typically saves a few 100k. The downside of platform_driver_probe() is that the driver cannot be bound and unbound at runtime which is ancient and so slightly complicates testing. There are also thoughts to deprecate platform_driver_probe() because it adds some complexity in the driver core for little gain. Also many drivers don't use it correctly. This driver for example misses to mark the driver struct with __ref which is needed to suppress a (W=1) modpost warning. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent fd3a683 commit 36f10a9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/ata/pata_falcon.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static struct ata_port_operations pata_falcon_ops = {
121121
.set_mode = pata_falcon_set_mode,
122122
};
123123

124-
static int __init pata_falcon_init_one(struct platform_device *pdev)
124+
static int pata_falcon_init_one(struct platform_device *pdev)
125125
{
126126
struct resource *base_mem_res, *ctl_mem_res;
127127
struct resource *base_res, *ctl_res, *irq_res;
@@ -216,7 +216,7 @@ static int __init pata_falcon_init_one(struct platform_device *pdev)
216216
IRQF_SHARED, &pata_falcon_sht);
217217
}
218218

219-
static int __exit pata_falcon_remove_one(struct platform_device *pdev)
219+
static int pata_falcon_remove_one(struct platform_device *pdev)
220220
{
221221
struct ata_host *host = platform_get_drvdata(pdev);
222222

@@ -226,13 +226,14 @@ static int __exit pata_falcon_remove_one(struct platform_device *pdev)
226226
}
227227

228228
static struct platform_driver pata_falcon_driver = {
229-
.remove = __exit_p(pata_falcon_remove_one),
229+
.probe = pata_falcon_init_one,
230+
.remove = pata_falcon_remove_one,
230231
.driver = {
231232
.name = "atari-falcon-ide",
232233
},
233234
};
234235

235-
module_platform_driver_probe(pata_falcon_driver, pata_falcon_init_one);
236+
module_platform_driver(pata_falcon_driver);
236237

237238
MODULE_AUTHOR("Bartlomiej Zolnierkiewicz");
238239
MODULE_DESCRIPTION("low-level driver for Atari Falcon PATA");

0 commit comments

Comments
 (0)