]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ata: pata_parport: switch to dynamic root device
authorJohan Hovold <johan@kernel.org>
Fri, 24 Apr 2026 10:38:30 +0000 (12:38 +0200)
committerNiklas Cassel <cassel@kernel.org>
Mon, 27 Apr 2026 09:38:16 +0000 (11:38 +0200)
commit163f6494233e1679ec6fa6a4803f74ae7b1c94db
tree489c4f2b042d1f93b9008ea8f753fe67f333cafa
parent254f49634ee16a731174d2ae34bc50bd5f45e731
ata: pata_parport: switch to dynamic root device

Driver core expects devices to be dynamically allocated and will, for
example, complain loudly when no release function has been provided.

Use root_device_register() to allocate and register the root device
instead of open coding using a static device.

Note that this also fixes a reference leak in the unlikely event that
device_register() ever fails.

Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
drivers/ata/pata_parport/pata_parport.c