Skip to contentSkip to conversation

mfd: wm831x: use spi_get_drvdata() and spi_set_drvdata()

PATCH In review Jingoo Han 2 participants 7 messages Apr 6, 2013 – Apr 9, 2013

Subsystems (4)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/6 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.

---
 drivers/mfd/wm831x-spi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/mfd/wm831x-spi.c +3 -3
index 4e70e15..e7ed14f66 100644
@@ -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);
@@ -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);
 
@@ -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);
 }
Signature · 1 line
1.7.2.5
author
#1 lore raw

PATCH 2/6 mfd: da9052: 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.

---
 drivers/mfd/da9052-spi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/da9052-spi.c +2 -2
index 61d63b9..0680bcb 100644
@@ -38,7 +38,7 @@ static int da9052_spi_probe(struct spi_device *spi)
 	da9052->dev = &spi->dev;
 	da9052->chip_irq = spi->irq;
 
-	dev_set_drvdata(&spi->dev, da9052);
+	spi_set_drvdata(spi, da9052);
 
 	da9052_regmap_config.read_flag_mask = 1;
 	da9052_regmap_config.write_flag_mask = 0;
@@ -60,7 +60,7 @@ static int da9052_spi_probe(struct spi_device *spi)
 
 static int da9052_spi_remove(struct spi_device *spi)
 {
-	struct da9052 *da9052 = dev_get_drvdata(&spi->dev);
+	struct da9052 *da9052 = spi_get_drvdata(spi);
 
 	da9052_device_exit(da9052);
 	return 0;
Signature · 1 line
1.7.2.5
author
#2 lore raw

PATCH 3/6 mfd: ezx-pcap: use spi_get_drvdata() and spi_set_drvdata()

In reply to Jingoo Han

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.

---
 drivers/mfd/ezx-pcap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/ezx-pcap.c +2 -2
index b7a61f0..bbebe8d 100644
@@ -393,7 +393,7 @@ static int pcap_add_subdev(struct pcap_chip *pcap,
 
 static int ezx_pcap_remove(struct spi_device *spi)
 {
-	struct pcap_chip *pcap = dev_get_drvdata(&spi->dev);
+	struct pcap_chip *pcap = spi_get_drvdata(spi);
 	struct pcap_platform_data *pdata = spi->dev.platform_data;
 	int i, adc_irq;
 
@@ -441,7 +441,7 @@ static int ezx_pcap_probe(struct spi_device *spi)
 	mutex_init(&pcap->adc_mutex);
 	INIT_WORK(&pcap->isr_work, pcap_isr_work);
 	INIT_WORK(&pcap->msr_work, pcap_msr_work);
-	dev_set_drvdata(&spi->dev, pcap);
+	spi_set_drvdata(spi, pcap);
 
 	/* setup spi */
 	spi->bits_per_word = 32;
Signature · 1 line
1.7.2.5
author
#3 lore raw

PATCH 4/6 mfd: mc13xxx: use spi_get_drvdata() and spi_set_drvdata()

In reply to Jingoo Han

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.

---
 drivers/mfd/mc13xxx-spi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/mfd/mc13xxx-spi.c +3 -3
index 3032bae..77189da 100644
@@ -131,7 +131,7 @@ static int mc13xxx_spi_probe(struct spi_device *spi)
 	if (!mc13xxx)
 		return -ENOMEM;
 
-	dev_set_drvdata(&spi->dev, mc13xxx);
+	spi_set_drvdata(spi, mc13xxx);
 	spi->mode = SPI_MODE_0 | SPI_CS_HIGH;
 
 	mc13xxx->dev = &spi->dev;
@@ -144,7 +144,7 @@ static int mc13xxx_spi_probe(struct spi_device *spi)
 		ret = PTR_ERR(mc13xxx->regmap);
 		dev_err(mc13xxx->dev, "Failed to initialize register map: %d\n",
 				ret);
-		dev_set_drvdata(&spi->dev, NULL);
+		spi_set_drvdata(spi, NULL);
 		return ret;
 	}
 
@@ -164,7 +164,7 @@ static int mc13xxx_spi_probe(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);
 
Signature · 1 line
1.7.2.5
author
#4 lore raw

PATCH 5/6 mfd: arizona: use spi_get_drvdata()

In reply to Jingoo Han

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.

---
 drivers/mfd/arizona-spi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mfd/arizona-spi.c +1 -1
index 1b9fdd6..b57e642 100644
@@ -67,7 +67,7 @@ static int arizona_spi_probe(struct spi_device *spi)
 
 static int arizona_spi_remove(struct spi_device *spi)
 {
-	struct arizona *arizona = dev_get_drvdata(&spi->dev);
+	struct arizona *arizona = spi_get_drvdata(spi);
 	arizona_dev_exit(arizona);
 	return 0;
 }
Signature · 1 line
1.7.2.5
author
#5 lore raw

PATCH 6/6 mfd: stmpe: use spi_get_drvdata()

In reply to Jingoo Han

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.

---
 drivers/mfd/stmpe-spi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mfd/stmpe-spi.c +1 -1
index 973659f..a81badb 100644
@@ -103,7 +103,7 @@ stmpe_spi_probe(struct spi_device *spi)
 
 static int stmpe_spi_remove(struct spi_device *spi)
 {
-	struct stmpe *stmpe = dev_get_drvdata(&spi->dev);
+	struct stmpe *stmpe = spi_get_drvdata(spi);
 
 	return stmpe_remove(stmpe);
 }
Signature · 1 line
1.7.2.5
#6 lore raw
In reply to Jingoo Han

Hi Jingoo,

Quoted 8 lines · Jingoo Han

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.

---
 drivers/mfd/wm831x-spi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

All 6 patches applied, thanks.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/