* [PATCH 1/3] Input: ads7846 - use spi_get_drvdata() and spi_set_drvdata()
@ 2013-04-06 6:46 Jingoo Han
2013-04-06 6:46 ` [PATCH 2/3] Input: ad7877 " Jingoo Han
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jingoo Han @ 2013-04-06 6:46 UTC (permalink / raw)
To: 'Dmitry Torokhov'
Cc: 'Dmitry Torokhov', linux-input, '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/input/touchscreen/ads7846.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 434c3df..84ccf14 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1245,7 +1245,7 @@ static int ads7846_probe(struct spi_device *spi)
goto err_free_mem;
}
- dev_set_drvdata(&spi->dev, ts);
+ spi_set_drvdata(spi, ts);
ts->packet = packet;
ts->spi = spi;
@@ -1397,7 +1397,7 @@ static int ads7846_probe(struct spi_device *spi)
static int ads7846_remove(struct spi_device *spi)
{
- struct ads7846 *ts = dev_get_drvdata(&spi->dev);
+ struct ads7846 *ts = spi_get_drvdata(spi);
device_init_wakeup(&spi->dev, false);
--
1.7.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] Input: ad7877 - use spi_get_drvdata() and spi_set_drvdata()
2013-04-06 6:46 [PATCH 1/3] Input: ads7846 - use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
@ 2013-04-06 6:46 ` Jingoo Han
2013-04-06 6:47 ` [PATCH 3/3] Input: adxl34x - use spi_get_drvdata() Jingoo Han
2013-04-08 4:08 ` [PATCH 1/3] Input: ads7846 - use spi_get_drvdata() and spi_set_drvdata() Dmitry Torokhov
2 siblings, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2013-04-06 6:46 UTC (permalink / raw)
To: 'Dmitry Torokhov'
Cc: 'Dmitry Torokhov', linux-input, '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/input/touchscreen/ad7877.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c
index 23fa829b8..f3a174a 100644
--- a/drivers/input/touchscreen/ad7877.c
+++ b/drivers/input/touchscreen/ad7877.c
@@ -273,7 +273,7 @@ static int ad7877_write(struct spi_device *spi, u16 reg, u16 val)
static int ad7877_read_adc(struct spi_device *spi, unsigned command)
{
- struct ad7877 *ts = dev_get_drvdata(&spi->dev);
+ struct ad7877 *ts = spi_get_drvdata(spi);
struct ser_req *req;
int status;
int sample;
@@ -720,7 +720,7 @@ static int ad7877_probe(struct spi_device *spi)
goto err_free_mem;
}
- dev_set_drvdata(&spi->dev, ts);
+ spi_set_drvdata(spi, ts);
ts->spi = spi;
ts->input = input_dev;
@@ -806,13 +806,13 @@ err_free_irq:
err_free_mem:
input_free_device(input_dev);
kfree(ts);
- dev_set_drvdata(&spi->dev, NULL);
+ spi_set_drvdata(spi, NULL);
return err;
}
static int ad7877_remove(struct spi_device *spi)
{
- struct ad7877 *ts = dev_get_drvdata(&spi->dev);
+ struct ad7877 *ts = spi_get_drvdata(spi);
sysfs_remove_group(&spi->dev.kobj, &ad7877_attr_group);
@@ -823,7 +823,7 @@ static int ad7877_remove(struct spi_device *spi)
kfree(ts);
dev_dbg(&spi->dev, "unregistered touchscreen\n");
- dev_set_drvdata(&spi->dev, NULL);
+ spi_set_drvdata(spi, NULL);
return 0;
}
--
1.7.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] Input: adxl34x - use spi_get_drvdata()
2013-04-06 6:46 [PATCH 1/3] Input: ads7846 - use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
2013-04-06 6:46 ` [PATCH 2/3] Input: ad7877 " Jingoo Han
@ 2013-04-06 6:47 ` Jingoo Han
2013-04-08 4:08 ` [PATCH 1/3] Input: ads7846 - use spi_get_drvdata() and spi_set_drvdata() Dmitry Torokhov
2 siblings, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2013-04-06 6:47 UTC (permalink / raw)
To: 'Dmitry Torokhov'
Cc: 'Dmitry Torokhov', linux-input, '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/input/misc/adxl34x-spi.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/input/misc/adxl34x-spi.c b/drivers/input/misc/adxl34x-spi.c
index 990b49e..76dc067 100644
--- a/drivers/input/misc/adxl34x-spi.c
+++ b/drivers/input/misc/adxl34x-spi.c
@@ -89,7 +89,7 @@ static int adxl34x_spi_probe(struct spi_device *spi)
static int adxl34x_spi_remove(struct spi_device *spi)
{
- struct adxl34x *ac = dev_get_drvdata(&spi->dev);
+ struct adxl34x *ac = spi_get_drvdata(spi);
return adxl34x_remove(ac);
}
@@ -98,7 +98,7 @@ static int adxl34x_spi_remove(struct spi_device *spi)
static int adxl34x_spi_suspend(struct device *dev)
{
struct spi_device *spi = to_spi_device(dev);
- struct adxl34x *ac = dev_get_drvdata(&spi->dev);
+ struct adxl34x *ac = spi_get_drvdata(spi);
adxl34x_suspend(ac);
@@ -108,7 +108,7 @@ static int adxl34x_spi_suspend(struct device *dev)
static int adxl34x_spi_resume(struct device *dev)
{
struct spi_device *spi = to_spi_device(dev);
- struct adxl34x *ac = dev_get_drvdata(&spi->dev);
+ struct adxl34x *ac = spi_get_drvdata(spi);
adxl34x_resume(ac);
--
1.7.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] Input: ads7846 - use spi_get_drvdata() and spi_set_drvdata()
2013-04-06 6:46 [PATCH 1/3] Input: ads7846 - use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
2013-04-06 6:46 ` [PATCH 2/3] Input: ad7877 " Jingoo Han
2013-04-06 6:47 ` [PATCH 3/3] Input: adxl34x - use spi_get_drvdata() Jingoo Han
@ 2013-04-08 4:08 ` Dmitry Torokhov
2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2013-04-08 4:08 UTC (permalink / raw)
To: Jingoo Han; +Cc: linux-input
On Sat, Apr 06, 2013 at 03:46:23PM +0900, Jingoo Han 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>
Applied all 3, thank you Jingoo.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-08 4:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-06 6:46 [PATCH 1/3] Input: ads7846 - use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
2013-04-06 6:46 ` [PATCH 2/3] Input: ad7877 " Jingoo Han
2013-04-06 6:47 ` [PATCH 3/3] Input: adxl34x - use spi_get_drvdata() Jingoo Han
2013-04-08 4:08 ` [PATCH 1/3] Input: ads7846 - use spi_get_drvdata() and spi_set_drvdata() Dmitry Torokhov
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).