From: Laurent Pinchart Date: Mon, 12 Dec 2011 00:15:06 +0000 (+0100) Subject: spi: Fix device unregistration when unregistering the bus master X-Git-Tag: v3.2.17~123 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=4cfa4199d07dfbb9ff3b0f84857a4c81c8b17cae spi: Fix device unregistration when unregistering the bus master commit 178db7d30f94707efca1a189753c105ef69942ed upstream. Device are added as children of the bus master's parent device, but spi_unregister_master() looks for devices to unregister in the bus master's children. This results in the child devices not being unregistered. Fix this by registering devices as direct children of the bus master. Signed-off-by: Laurent Pinchart Signed-off-by: Grant Likely Signed-off-by: Ben Hutchings --- diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 77eae99af11c..b2ccdea30cb9 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -319,7 +319,7 @@ struct spi_device *spi_alloc_device(struct spi_master *master) } spi->master = master; - spi->dev.parent = dev; + spi->dev.parent = &master->dev; spi->dev.bus = &spi_bus_type; spi->dev.release = spidev_release; device_initialize(&spi->dev);