* [PATCH V2] mmc: host: use platform_{get,set}_drvdata()
@ 2013-06-03 4:41 Jingoo Han
2013-06-27 15:13 ` Chris Ball
0 siblings, 1 reply; 2+ messages in thread
From: Jingoo Han @ 2013-06-03 4:41 UTC (permalink / raw)
To: 'Chris Ball'
Cc: linux-mmc, 'Jingoo Han',
' Michał Mirosław ', Guennadi Liakhovetski,
Ian Molton
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
Changes since v1:
- Fixed the missed counterpart - cb710_slot_to_mmc() in cb710-mmc.h.
drivers/mmc/host/cb710-mmc.c | 2 +-
drivers/mmc/host/cb710-mmc.h | 2 +-
drivers/mmc/host/sh_mobile_sdhi.c | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
index 777ca20..9d6e2b8 100644
--- a/drivers/mmc/host/cb710-mmc.c
+++ b/drivers/mmc/host/cb710-mmc.c
@@ -703,7 +703,7 @@ static int cb710_mmc_init(struct platform_device *pdev)
if (!mmc)
return -ENOMEM;
- dev_set_drvdata(&pdev->dev, mmc);
+ platform_set_drvdata(pdev, mmc);
/* harmless (maybe) magic */
pci_read_config_dword(chip->pdev, 0x48, &val);
diff --git a/drivers/mmc/host/cb710-mmc.h b/drivers/mmc/host/cb710-mmc.h
index e845c77..8984ec8 100644
--- a/drivers/mmc/host/cb710-mmc.h
+++ b/drivers/mmc/host/cb710-mmc.h
@@ -24,7 +24,7 @@ struct cb710_mmc_reader {
static inline struct mmc_host *cb710_slot_to_mmc(struct cb710_slot *slot)
{
- return dev_get_drvdata(&slot->pdev.dev);
+ return platform_get_drvdata(&slot->pdev);
}
static inline struct cb710_slot *cb710_mmc_to_slot(struct mmc_host *mmc)
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index cc4c872..6a5d90e 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -51,7 +51,7 @@ struct sh_mobile_sdhi {
static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int *f)
{
- struct mmc_host *mmc = dev_get_drvdata(&pdev->dev);
+ struct mmc_host *mmc = platform_get_drvdata(pdev);
struct tmio_mmc_host *host = mmc_priv(mmc);
struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data);
int ret = clk_enable(priv->clk);
@@ -64,7 +64,7 @@ static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int
static void sh_mobile_sdhi_clk_disable(struct platform_device *pdev)
{
- struct mmc_host *mmc = dev_get_drvdata(&pdev->dev);
+ struct mmc_host *mmc = platform_get_drvdata(pdev);
struct tmio_mmc_host *host = mmc_priv(mmc);
struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data);
clk_disable(priv->clk);
@@ -119,7 +119,7 @@ static int sh_mobile_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)
static void sh_mobile_sdhi_cd_wakeup(const struct platform_device *pdev)
{
- mmc_detect_change(dev_get_drvdata(&pdev->dev), msecs_to_jiffies(100));
+ mmc_detect_change(platform_get_drvdata(pdev), msecs_to_jiffies(100));
}
static const struct sh_mobile_sdhi_ops sdhi_ops = {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH V2] mmc: host: use platform_{get,set}_drvdata()
2013-06-03 4:41 [PATCH V2] mmc: host: use platform_{get,set}_drvdata() Jingoo Han
@ 2013-06-27 15:13 ` Chris Ball
0 siblings, 0 replies; 2+ messages in thread
From: Chris Ball @ 2013-06-27 15:13 UTC (permalink / raw)
To: Jingoo Han
Cc: linux-mmc, ' Michał Mirosław ',
Guennadi Liakhovetski, Ian Molton
Hi Jingoo,
On Mon, Jun 03 2013, Jingoo Han wrote:
> Use the wrapper functions for getting and setting the driver data using
> platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
> so we can directly pass a struct platform_device.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
> Changes since v1:
> - Fixed the missed counterpart - cb710_slot_to_mmc() in cb710-mmc.h.
Thanks, pushed to mmc-next for 3.11.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-27 15:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-03 4:41 [PATCH V2] mmc: host: use platform_{get,set}_drvdata() Jingoo Han
2013-06-27 15:13 ` Chris Ball
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox