linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: 74x164: use spi_get_drvdata() and spi_set_drvdata()
@ 2013-03-15  9:17 Jingoo Han
  2013-03-15  9:17 ` [PATCH 2/2] gpio: mc33880: " Jingoo Han
  2013-03-27  8:55 ` [PATCH 1/2] gpio: 74x164: " Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Jingoo Han @ 2013-03-15  9:17 UTC (permalink / raw)
  To: 'Grant Likely'
  Cc: 'Linus Walleij', linux-kernel, '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.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/gpio/gpio-74x164.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c
index 464be96..7216079 100644
--- a/drivers/gpio/gpio-74x164.c
+++ b/drivers/gpio/gpio-74x164.c
@@ -137,7 +137,7 @@ static int gen_74x164_probe(struct spi_device *spi)
 
 	mutex_init(&chip->lock);
 
-	dev_set_drvdata(&spi->dev, chip);
+	spi_set_drvdata(spi, chip);
 
 	chip->spi = spi;
 
@@ -176,7 +176,7 @@ static int gen_74x164_probe(struct spi_device *spi)
 	return ret;
 
 exit_destroy:
-	dev_set_drvdata(&spi->dev, NULL);
+	spi_set_drvdata(spi, NULL);
 	mutex_destroy(&chip->lock);
 	return ret;
 }
@@ -186,11 +186,11 @@ static int gen_74x164_remove(struct spi_device *spi)
 	struct gen_74x164_chip *chip;
 	int ret;
 
-	chip = dev_get_drvdata(&spi->dev);
+	chip = spi_get_drvdata(spi);
 	if (chip == NULL)
 		return -ENODEV;
 
-	dev_set_drvdata(&spi->dev, NULL);
+	spi_set_drvdata(spi, NULL);
 
 	ret = gpiochip_remove(&chip->gpio_chip);
 	if (!ret)
-- 
1.7.2.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] gpio: mc33880: use spi_get_drvdata() and spi_set_drvdata()
  2013-03-15  9:17 [PATCH 1/2] gpio: 74x164: use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
@ 2013-03-15  9:17 ` Jingoo Han
  2013-03-27  8:56   ` Linus Walleij
  2013-03-27  8:55 ` [PATCH 1/2] gpio: 74x164: " Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Jingoo Han @ 2013-03-15  9:17 UTC (permalink / raw)
  To: 'Grant Likely'
  Cc: 'Linus Walleij', linux-kernel, '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.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/gpio/gpio-mc33880.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-mc33880.c b/drivers/gpio/gpio-mc33880.c
index 3395879..63a7a1b 100644
--- a/drivers/gpio/gpio-mc33880.c
+++ b/drivers/gpio/gpio-mc33880.c
@@ -107,7 +107,7 @@ static int mc33880_probe(struct spi_device *spi)
 
 	mutex_init(&mc->lock);
 
-	dev_set_drvdata(&spi->dev, mc);
+	spi_set_drvdata(spi, mc);
 
 	mc->spi = spi;
 
@@ -142,7 +142,7 @@ static int mc33880_probe(struct spi_device *spi)
 	return ret;
 
 exit_destroy:
-	dev_set_drvdata(&spi->dev, NULL);
+	spi_set_drvdata(spi, NULL);
 	mutex_destroy(&mc->lock);
 	return ret;
 }
@@ -152,11 +152,11 @@ static int mc33880_remove(struct spi_device *spi)
 	struct mc33880 *mc;
 	int ret;
 
-	mc = dev_get_drvdata(&spi->dev);
+	mc = spi_get_drvdata(spi);
 	if (mc == NULL)
 		return -ENODEV;
 
-	dev_set_drvdata(&spi->dev, NULL);
+	spi_set_drvdata(spi, NULL);
 
 	ret = gpiochip_remove(&mc->chip);
 	if (!ret)
-- 
1.7.2.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] gpio: 74x164: use spi_get_drvdata() and spi_set_drvdata()
  2013-03-15  9:17 [PATCH 1/2] gpio: 74x164: use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
  2013-03-15  9:17 ` [PATCH 2/2] gpio: mc33880: " Jingoo Han
@ 2013-03-27  8:55 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2013-03-27  8:55 UTC (permalink / raw)
  To: Jingoo Han; +Cc: Grant Likely, linux-kernel

On Fri, Mar 15, 2013 at 10:17 AM, Jingoo Han <jg1.han@samsung.com> wrote:

> 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>

Patch applied.

Thanks!
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] gpio: mc33880: use spi_get_drvdata() and spi_set_drvdata()
  2013-03-15  9:17 ` [PATCH 2/2] gpio: mc33880: " Jingoo Han
@ 2013-03-27  8:56   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2013-03-27  8:56 UTC (permalink / raw)
  To: Jingoo Han; +Cc: Grant Likely, linux-kernel

On Fri, Mar 15, 2013 at 10:17 AM, Jingoo Han <jg1.han@samsung.com> wrote:

> 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>

Patch applied.

Thanks!
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-27  8:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-15  9:17 [PATCH 1/2] gpio: 74x164: use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
2013-03-15  9:17 ` [PATCH 2/2] gpio: mc33880: " Jingoo Han
2013-03-27  8:56   ` Linus Walleij
2013-03-27  8:55 ` [PATCH 1/2] gpio: 74x164: " Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).