Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03a38129 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman
Browse files

spi: No need to assign dummy value in spi_unregister_controller()



[ Upstream commit ebc37af5e0a134355ea2b62ed4141458bdbd5389 ]

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 52c419ba
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2305,7 +2305,6 @@ void spi_unregister_controller(struct spi_controller *ctlr)
{
	struct spi_controller *found;
	int id = ctlr->bus_num;
	int dummy;

	/* First make sure that this controller was ever added */
	mutex_lock(&board_lock);
@@ -2319,7 +2318,7 @@ void spi_unregister_controller(struct spi_controller *ctlr)
	list_del(&ctlr->list);
	mutex_unlock(&board_lock);

	dummy = device_for_each_child(&ctlr->dev, NULL, __unregister);
	device_for_each_child(&ctlr->dev, NULL, __unregister);
	device_unregister(&ctlr->dev);
	/* free bus id */
	mutex_lock(&board_lock);