Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: wm831x: 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>

authored by

Jingoo Han and committed by
Samuel Ortiz
0c0d2ab0 b99877f3

+3 -3
+3 -3
drivers/mfd/wm831x-spi.c
··· 37 37 spi->bits_per_word = 16; 38 38 spi->mode = SPI_MODE_0; 39 39 40 - dev_set_drvdata(&spi->dev, wm831x); 40 + spi_set_drvdata(spi, wm831x); 41 41 wm831x->dev = &spi->dev; 42 42 43 43 wm831x->regmap = devm_regmap_init_spi(spi, &wm831x_regmap_config); ··· 53 53 54 54 static int wm831x_spi_remove(struct spi_device *spi) 55 55 { 56 - struct wm831x *wm831x = dev_get_drvdata(&spi->dev); 56 + struct wm831x *wm831x = spi_get_drvdata(spi); 57 57 58 58 wm831x_device_exit(wm831x); 59 59 ··· 69 69 70 70 static void wm831x_spi_shutdown(struct spi_device *spi) 71 71 { 72 - struct wm831x *wm831x = dev_get_drvdata(&spi->dev); 72 + struct wm831x *wm831x = spi_get_drvdata(spi); 73 73 74 74 wm831x_device_shutdown(wm831x); 75 75 }