From: Jingoo Han <jg1.han@samsung.com>
To: "'Grant Likely'" <grant.likely@secretlab.ca>
Cc: "'Linus Walleij'" <linus.walleij@linaro.org>,
linux-kernel@vger.kernel.org,
"'Jingoo Han'" <jg1.han@samsung.com>
Subject: [PATCH 2/2] gpio: mc33880: use spi_get_drvdata() and spi_set_drvdata()
Date: Fri, 15 Mar 2013 18:17:54 +0900 [thread overview]
Message-ID: <006a01ce215d$f9b44860$ed1cd920$%han@samsung.com> (raw)
In-Reply-To: <006901ce215d$e42c0b90$ac8422b0$%han@samsung.com>
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
next prev parent reply other threads:[~2013-03-15 9:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-15 9:17 [PATCH 1/2] gpio: 74x164: " Jingoo Han
2013-03-15 9:17 ` Jingoo Han [this message]
2013-03-27 8:56 ` [PATCH 2/2] gpio: mc33880: " Linus Walleij
2013-03-27 8:55 ` [PATCH 1/2] gpio: 74x164: " Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='006a01ce215d$f9b44860$ed1cd920$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®