aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
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);