Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
4c49300d bcf4ef28

+2 -4
+2 -4
drivers/thunderbolt/nvm.c
··· 154 154 void tb_nvm_free(struct tb_nvm *nvm) 155 155 { 156 156 if (nvm) { 157 - if (nvm->non_active) 158 - nvmem_unregister(nvm->non_active); 159 - if (nvm->active) 160 - nvmem_unregister(nvm->active); 157 + nvmem_unregister(nvm->non_active); 158 + nvmem_unregister(nvm->active); 161 159 vfree(nvm->buf); 162 160 ida_simple_remove(&nvm_ida, nvm->id); 163 161 }