* [PATCH 1/3] mmc: mmc_spi: use spi_get_drvdata() and spi_set_drvdata()
@ 2014-01-08 1:49 Jingoo Han
2014-01-08 1:51 ` [PATCH 2/3] mmc: mmc_spi: remove unnecessary spi_set_drvdata() Jingoo Han
2014-01-08 1:52 ` [PATCH 3/3] mmc: sdhci-pci: remove unnecessary pci_set_drvdata() Jingoo Han
0 siblings, 2 replies; 3+ messages in thread
From: Jingoo Han @ 2014-01-08 1:49 UTC (permalink / raw)
To: 'Jiri Kosina'
Cc: trivial, 'Chris Ball', linux-mmc, 'Sonic Zhang',
'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>
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
---
drivers/mmc/host/mmc_spi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 0a87e56..40770a5 100644
--- a/drivers/mmc/host/mmc_spi.c
+++ b/drivers/mmc/host/mmc_spi.c
@@ -1386,7 +1386,7 @@ static int mmc_spi_probe(struct spi_device *spi)
host->powerup_msecs = 250;
}
- dev_set_drvdata(&spi->dev, mmc);
+ spi_set_drvdata(spi, mmc);
/* preallocate dma buffers */
host->data = kmalloc(sizeof(*host->data), GFP_KERNEL);
@@ -1472,7 +1472,7 @@ fail_glue_init:
fail_nobuf1:
mmc_free_host(mmc);
mmc_spi_put_pdata(spi);
- dev_set_drvdata(&spi->dev, NULL);
+ spi_set_drvdata(spi, NULL);
nomem:
kfree(ones);
@@ -1482,7 +1482,7 @@ nomem:
static int mmc_spi_remove(struct spi_device *spi)
{
- struct mmc_host *mmc = dev_get_drvdata(&spi->dev);
+ struct mmc_host *mmc = spi_get_drvdata(spi);
struct mmc_spi_host *host;
if (mmc) {
@@ -1507,7 +1507,7 @@ static int mmc_spi_remove(struct spi_device *spi)
spi->max_speed_hz = mmc->f_max;
mmc_free_host(mmc);
mmc_spi_put_pdata(spi);
- dev_set_drvdata(&spi->dev, NULL);
+ spi_set_drvdata(spi, NULL);
}
return 0;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/3] mmc: mmc_spi: remove unnecessary spi_set_drvdata()
2014-01-08 1:49 [PATCH 1/3] mmc: mmc_spi: use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
@ 2014-01-08 1:51 ` Jingoo Han
2014-01-08 1:52 ` [PATCH 3/3] mmc: sdhci-pci: remove unnecessary pci_set_drvdata() Jingoo Han
1 sibling, 0 replies; 3+ messages in thread
From: Jingoo Han @ 2014-01-08 1:51 UTC (permalink / raw)
To: 'Jiri Kosina'
Cc: trivial, 'Chris Ball', linux-mmc, 'Sonic Zhang',
'Jingoo Han'
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
---
drivers/mmc/host/mmc_spi.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 40770a5..4c5e279 100644
--- a/drivers/mmc/host/mmc_spi.c
+++ b/drivers/mmc/host/mmc_spi.c
@@ -1472,7 +1472,6 @@ fail_glue_init:
fail_nobuf1:
mmc_free_host(mmc);
mmc_spi_put_pdata(spi);
- spi_set_drvdata(spi, NULL);
nomem:
kfree(ones);
@@ -1507,7 +1506,6 @@ static int mmc_spi_remove(struct spi_device *spi)
spi->max_speed_hz = mmc->f_max;
mmc_free_host(mmc);
mmc_spi_put_pdata(spi);
- spi_set_drvdata(spi, NULL);
}
return 0;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 3/3] mmc: sdhci-pci: remove unnecessary pci_set_drvdata()
2014-01-08 1:49 [PATCH 1/3] mmc: mmc_spi: use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
2014-01-08 1:51 ` [PATCH 2/3] mmc: mmc_spi: remove unnecessary spi_set_drvdata() Jingoo Han
@ 2014-01-08 1:52 ` Jingoo Han
1 sibling, 0 replies; 3+ messages in thread
From: Jingoo Han @ 2014-01-08 1:52 UTC (permalink / raw)
To: 'Jiri Kosina'
Cc: trivial, 'Chris Ball', linux-mmc, 'Sonic Zhang',
'Adrian Hunter', 'David Cohen',
'Jingoo Han'
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/mmc/host/sdhci-pci.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 8f75381..9f66f73 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -1609,7 +1609,6 @@ static int sdhci_pci_probe(struct pci_dev *pdev,
return 0;
free:
- pci_set_drvdata(pdev, NULL);
kfree(chip);
err:
@@ -1631,7 +1630,6 @@ static void sdhci_pci_remove(struct pci_dev *pdev)
for (i = 0; i < chip->num_slots; i++)
sdhci_pci_remove_slot(chip->slots[i]);
- pci_set_drvdata(pdev, NULL);
kfree(chip);
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-08 1:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-08 1:49 [PATCH 1/3] mmc: mmc_spi: use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
2014-01-08 1:51 ` [PATCH 2/3] mmc: mmc_spi: remove unnecessary spi_set_drvdata() Jingoo Han
2014-01-08 1:52 ` [PATCH 3/3] mmc: sdhci-pci: remove unnecessary pci_set_drvdata() Jingoo Han
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.