Skip to content

Commit

Permalink
spi: Fix device unregistration when unregistering the bus master
Browse files Browse the repository at this point in the history
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 <laurent.pinchart@ideasonboard.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Laurent Pinchart authored and Grant Likely committed Dec 13, 2011
1 parent dc47ce9 commit 178db7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 178db7d

Please sign in to comment.