mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
spi: No need to assign dummy value in spi_unregister_controller()
[ Upstream commit ebc37af5e0 ]
The device_for_each_child() doesn't require the returned value to be checked.
Thus, drop the dummy variable completely and have no warning anymore:
drivers/spi/spi.c: In function ‘spi_unregister_controller’:
drivers/spi/spi.c:2480:6: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
int dummy;
^~~~~
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
35654d44a5
commit
7bc16ca02b
@@ -2025,8 +2025,6 @@ static int __unregister(struct device *dev, void *null)
|
||||
*/
|
||||
void spi_unregister_master(struct spi_master *master)
|
||||
{
|
||||
int dummy;
|
||||
|
||||
if (master->queued) {
|
||||
if (spi_destroy_queue(master))
|
||||
dev_err(&master->dev, "queue remove failed\n");
|
||||
@@ -2036,7 +2034,7 @@ void spi_unregister_master(struct spi_master *master)
|
||||
list_del(&master->list);
|
||||
mutex_unlock(&board_lock);
|
||||
|
||||
dummy = device_for_each_child(&master->dev, NULL, __unregister);
|
||||
device_for_each_child(&master->dev, NULL, __unregister);
|
||||
device_unregister(&master->dev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(spi_unregister_master);
|
||||
|
||||
Reference in New Issue
Block a user