aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-06-06 16:48:07 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-07-22 00:54:45 -0400
commit3d81252ddb10f63ae4db713d9b32faabe641b850 (patch)
tree68ea05d6aebdffaef2fe25c5462c096f88bf8f67 /drivers/spi
parent89409211ff97bf82295d1fb98ab18302a03e9199 (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 ddbe1a5e970e..2833fd772a24 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -576,7 +576,8 @@ static int spidev_probe(struct spi_device *spi)
576 struct device *dev; 576 struct device *dev;
577 577
578 spidev->devt = MKDEV(SPIDEV_MAJOR, minor); 578 spidev->devt = MKDEV(SPIDEV_MAJOR, minor);
579 dev = device_create(spidev_class, &spi->dev, spidev->devt, 579 dev = device_create_drvdata(spidev_class, &spi->dev,
580 spidev->devt, spidev,
580 "spidev%d.%d", 581 "spidev%d.%d",
581 spi->master->bus_num, spi->chip_select); 582 spi->master->bus_num, spi->chip_select);
582 status = IS_ERR(dev) ? PTR_ERR(dev) : 0; 583 status = IS_ERR(dev) ? PTR_ERR(dev) : 0;
@@ -586,7 +587,6 @@ static int spidev_probe(struct spi_device *spi)
586 } 587 }
587 if (status == 0) { 588 if (status == 0) {
588 set_bit(minor, minors); 589 set_bit(minor, minors);
589 spi_set_drvdata(spi, spidev);
590 list_add(&spidev->device_entry, &device_list); 590 list_add(&spidev->device_entry, &device_list);
591 } 591 }
592 mutex_unlock(&device_list_lock); 592 mutex_unlock(&device_list_lock);