diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-02-20 15:15:27 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-21 18:00:30 +0100 |
commit | 4c49300d8e676702cc097784007bf11735821d6d (patch) | |
tree | a47290b6ad53fb4a933e9aed53502d3c3388ff3a /drivers/thunderbolt | |
parent | bcf4ef28b0839a55bfae75b2bf4794c1d7244e61 (diff) | |
download | linux-stable-4c49300d8e676702cc097784007bf11735821d6d.tar.gz linux-stable-4c49300d8e676702cc097784007bf11735821d6d.tar.bz2 linux-stable-4c49300d8e676702cc097784007bf11735821d6d.zip |
thunderbolt: Drop duplicate NULL checks around nvmem_unregister()
Since nvmem_unregister() checks for NULL, no need to repeat in
the caller. Drop duplicate NULL checks.
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220220151527.17216-14-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r-- | drivers/thunderbolt/nvm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/thunderbolt/nvm.c b/drivers/thunderbolt/nvm.c index 3a5336913cca..b3f310389378 100644 --- a/drivers/thunderbolt/nvm.c +++ b/drivers/thunderbolt/nvm.c @@ -154,10 +154,8 @@ int tb_nvm_add_non_active(struct tb_nvm *nvm, size_t size, void tb_nvm_free(struct tb_nvm *nvm) { if (nvm) { - if (nvm->non_active) - nvmem_unregister(nvm->non_active); - if (nvm->active) - nvmem_unregister(nvm->active); + nvmem_unregister(nvm->non_active); + nvmem_unregister(nvm->active); vfree(nvm->buf); ida_simple_remove(&nvm_ida, nvm->id); } |