OSDN Git Service

ata: brcm: fix reset controller API usage
authorArnd Bergmann <arnd@arndb.de>
Tue, 7 Jan 2020 22:15:00 +0000 (23:15 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 17 Jan 2020 04:49:09 +0000 (21:49 -0700)
commit6fedae3cad8b122c8b0afb26a0569d9910255edd
tree86b2dd526ec09a8c36d545495946588922b62af2
parented87ad196dab6a757352d39c4c3fbc599340fe2c
ata: brcm: fix reset controller API usage

While fixing another issue in this driver I noticed it uses
IS_ERR_OR_NULL(), which is almost always a mistake.

Change the driver to use the proper devm_reset_control_get_optional()
interface instead and remove the checks except for the one that
checks for a failure in that function.

Fixes: 2b2c47d9e1fe ("ata: ahci_brcm: Allow optional reset controller to be used")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/ata/ahci_brcm.c