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

spi: sifive: Remove spi_master_put in sifive_spi_remove()

The call to spi_master_put() in sifive_spi_remove() is redundant since
the master is registered using devm_spi_register_master() and no
reference hold by using spi_master_get() in sifive_spi_remove().

This is detected by Coccinelle semantic patch.

Fixes: 484a9a68d669 ("spi: sifive: Add driver for the SiFive SPI controller")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Wei Yongjun and committed by
Mark Brown
049e5fea bf9f742c

-1
-1
drivers/spi/spi-sifive.c
··· 424 424 425 425 /* Disable all the interrupts just in case */ 426 426 sifive_spi_write(spi, SIFIVE_SPI_REG_IE, 0); 427 - spi_master_put(master); 428 427 429 428 return 0; 430 429 }