libata: cleanup device sleep capability detection
authorDamien Le Moal <damien.lemoal@wdc.com>
Mon, 16 Aug 2021 01:44:49 +0000 (10:44 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 Aug 2021 13:19:39 +0000 (07:19 -0600)
commitd8d8778c24cc4689250b59c426489a360032d912
treec30e7b257e107d2e9dec91a6add2bcec6a0db5cc
parent56b4f06c55add95fe508a1746d9173bade6388bf
libata: cleanup device sleep capability detection

Move the code to retrieve the device sleep capability and timings out of
ata_dev_configure() into the helper function ata_dev_config_devslp().
While at it, mark the device as supporting the device sleep capability
only if the sata settings page was retrieved successfully to ensure that
the timing information is correctly initialized.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20210816014456.2191776-5-damien.lemoal@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/ata/libata-core.c