Commit 3d81252d authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 89409211
...@@ -576,7 +576,8 @@ static int spidev_probe(struct spi_device *spi) ...@@ -576,7 +576,8 @@ static int spidev_probe(struct spi_device *spi)
struct device *dev; struct device *dev;
spidev->devt = MKDEV(SPIDEV_MAJOR, minor); 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", "spidev%d.%d",
spi->master->bus_num, spi->chip_select); spi->master->bus_num, spi->chip_select);
status = IS_ERR(dev) ? PTR_ERR(dev) : 0; status = IS_ERR(dev) ? PTR_ERR(dev) : 0;
...@@ -586,7 +587,6 @@ static int spidev_probe(struct spi_device *spi) ...@@ -586,7 +587,6 @@ static int spidev_probe(struct spi_device *spi)
} }
if (status == 0) { if (status == 0) {
set_bit(minor, minors); set_bit(minor, minors);
spi_set_drvdata(spi, spidev);
list_add(&spidev->device_entry, &device_list); list_add(&spidev->device_entry, &device_list);
} }
mutex_unlock(&device_list_lock); mutex_unlock(&device_list_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment