summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-06-06 15:48:07 -0500
committerStephen Rothwell <sfr@canb.auug.org.au>2008-06-18 10:17:13 +1000
commitc801c8586ac8fe9a7a58f50845f5073544518182 (patch)
tree7e3836b1f456376817020215f75a111df810b1cf /drivers/spi
parent27989dad3c6c96595c474c122ae35e34cdc05d7c (diff)
device create: spi: convert device_create to device_create_drvdata
Switch over to use the shiny new device_create_drvdata() call instead of the original device_create() calls, so this continues to work after device_create() is removed. Note that this driver never had the race which motivated removing the original call; it locked correctly. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spidev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 799337f7fde1..55b58ea40273 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -575,7 +575,8 @@ static int spidev_probe(struct spi_device *spi)
struct device *dev;
spidev->devt = MKDEV(SPIDEV_MAJOR, minor);
- dev = device_create(spidev_class, &spi->dev, spidev->devt,
+ dev = device_create_drvdata(spidev_class, &spi->dev,
+ spidev->devt, spidev,
"spidev%d.%d",
spi->master->bus_num, spi->chip_select);
status = IS_ERR(dev) ? PTR_ERR(dev) : 0;
@@ -585,7 +586,6 @@ static int spidev_probe(struct spi_device *spi)
}
if (status == 0) {
set_bit(minor, minors);
- spi_set_drvdata(spi, spidev);
list_add(&spidev->device_entry, &device_list);
}
mutex_unlock(&device_list_lock);