]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ata: libata: Introduce ata_dev_free_resources
authorDamien Le Moal <dlemoal@kernel.org>
Thu, 5 Sep 2024 01:51:19 +0000 (10:51 +0900)
committerDamien Le Moal <dlemoal@kernel.org>
Sat, 7 Sep 2024 01:16:55 +0000 (10:16 +0900)
commit5f8319c4b3ec4e8fdc7f7bf61f47f985e1a6f074
treeb7577c2ff9a457b2203cfa3979c3fc006dde3d64
parentda65bbdd3bc1e8d2193e01167a413d90d9988c04
ata: libata: Introduce ata_dev_free_resources

Introduce the function ata_dev_free_resources() to free the resources
allocated to support a device features. For now, this function is
reduced to calling zpodd_exit() for devices that have this feature
enabled.

ata_dev_free_resources() is called from ata_eh_dev_disable() as this
function is always called for all devices attached to a port that is
being detached and for devices that are being disabled due to being
removed (detached) from the system or due to errors.

With this change, the call to zpodd_exit() done in ata_port_detach()
and ata_scsi_handle_link_detach() are removed as these functions
remove all devices attached to the link or port using libata EH, thus
resulting in ata_eh_dev_disable() being called and the zpodd_exit()
function being executed.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
drivers/ata/libata-scsi.c
drivers/ata/libata.h