mfd: mc13xxx: Use spi_get_drvdata() and spi_set_drvdata()

Use the wrapper functions for getting and setting the driver data using
spi_device instead of using dev_{get|set}_drvdata with &spi->dev, so we
can directly pass a struct spi_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Jingoo Han 2013-04-06 15:44:14 +09:00 коммит произвёл Samuel Ortiz
Родитель 7c478b4058
Коммит a720c30533
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -131,7 +131,7 @@ static int mc13xxx_spi_probe(struct spi_device *spi)
if (!mc13xxx) if (!mc13xxx)
return -ENOMEM; return -ENOMEM;
dev_set_drvdata(&spi->dev, mc13xxx); spi_set_drvdata(spi, mc13xxx);
spi->mode = SPI_MODE_0 | SPI_CS_HIGH; spi->mode = SPI_MODE_0 | SPI_CS_HIGH;
mc13xxx->dev = &spi->dev; mc13xxx->dev = &spi->dev;
@ -144,7 +144,7 @@ static int mc13xxx_spi_probe(struct spi_device *spi)
ret = PTR_ERR(mc13xxx->regmap); ret = PTR_ERR(mc13xxx->regmap);
dev_err(mc13xxx->dev, "Failed to initialize register map: %d\n", dev_err(mc13xxx->dev, "Failed to initialize register map: %d\n",
ret); ret);
dev_set_drvdata(&spi->dev, NULL); spi_set_drvdata(spi, NULL);
return ret; return ret;
} }
@ -164,7 +164,7 @@ static int mc13xxx_spi_probe(struct spi_device *spi)
static int mc13xxx_spi_remove(struct spi_device *spi) static int mc13xxx_spi_remove(struct spi_device *spi)
{ {
struct mc13xxx *mc13xxx = dev_get_drvdata(&spi->dev); struct mc13xxx *mc13xxx = spi_get_drvdata(spi);
mc13xxx_common_cleanup(mc13xxx); mc13xxx_common_cleanup(mc13xxx);