Skip to content

Commit

Permalink
mfd: wm831x: Use spi_get_drvdata() and spi_set_drvdata()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jingoo Han authored and Samuel Ortiz committed Apr 9, 2013
1 parent b99877f commit 0c0d2ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/mfd/wm831x-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static int wm831x_spi_probe(struct spi_device *spi)
spi->bits_per_word = 16;
spi->mode = SPI_MODE_0;

dev_set_drvdata(&spi->dev, wm831x);
spi_set_drvdata(spi, wm831x);
wm831x->dev = &spi->dev;

wm831x->regmap = devm_regmap_init_spi(spi, &wm831x_regmap_config);
Expand All @@ -53,7 +53,7 @@ static int wm831x_spi_probe(struct spi_device *spi)

static int wm831x_spi_remove(struct spi_device *spi)
{
struct wm831x *wm831x = dev_get_drvdata(&spi->dev);
struct wm831x *wm831x = spi_get_drvdata(spi);

wm831x_device_exit(wm831x);

Expand All @@ -69,7 +69,7 @@ static int wm831x_spi_suspend(struct device *dev)

static void wm831x_spi_shutdown(struct spi_device *spi)
{
struct wm831x *wm831x = dev_get_drvdata(&spi->dev);
struct wm831x *wm831x = spi_get_drvdata(spi);

wm831x_device_shutdown(wm831x);
}
Expand Down

0 comments on commit 0c0d2ab

Please sign in to comment.