Commit 163f649
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>1 parent 254f496 commit 163f649
1 file changed
Lines changed: 7 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | 462 | | |
468 | 463 | | |
469 | 464 | | |
470 | 465 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
| 466 | + | |
475 | 467 | | |
476 | 468 | | |
477 | 469 | | |
| |||
518 | 510 | | |
519 | 511 | | |
520 | 512 | | |
521 | | - | |
| 513 | + | |
522 | 514 | | |
523 | 515 | | |
524 | 516 | | |
| |||
780 | 772 | | |
781 | 773 | | |
782 | 774 | | |
783 | | - | |
784 | | - | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
785 | 778 | | |
786 | 779 | | |
787 | 780 | | |
| |||
811 | 804 | | |
812 | 805 | | |
813 | 806 | | |
814 | | - | |
| 807 | + | |
815 | 808 | | |
816 | 809 | | |
817 | 810 | | |
| |||
822 | 815 | | |
823 | 816 | | |
824 | 817 | | |
825 | | - | |
| 818 | + | |
826 | 819 | | |
827 | 820 | | |
828 | 821 | | |
| |||
0 commit comments