diff options
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi.c | 2 | ||||
-rw-r--r-- | drivers/spi/spidev.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 1ad12afc6ba0..1771b2456bfa 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -502,7 +502,7 @@ struct spi_master *spi_busnum_to_master(u16 bus_num) | |||
502 | struct device *dev; | 502 | struct device *dev; |
503 | struct spi_master *master = NULL; | 503 | struct spi_master *master = NULL; |
504 | 504 | ||
505 | dev = class_find_device(&spi_master_class, &bus_num, | 505 | dev = class_find_device(&spi_master_class, NULL, &bus_num, |
506 | __spi_master_match); | 506 | __spi_master_match); |
507 | if (dev) | 507 | if (dev) |
508 | master = container_of(dev, struct spi_master, dev); | 508 | master = container_of(dev, struct spi_master, dev); |
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); |