aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card/mmc_test.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-08 18:42:44 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-08 18:42:44 -0800
commitf2fb38049c724558c590c31e57627f6ba8d48a5b (patch)
tree51ff06495a51de92c24d1b9ec7759d61e8560928 /drivers/mmc/card/mmc_test.c
parentLinux 3.18 (diff)
parentmmc: sdhci-msm: Convert to mmc_send_tuning() (diff)
downloadlinux-dev-f2fb38049c724558c590c31e57627f6ba8d48a5b.tar.xz
linux-dev-f2fb38049c724558c590c31e57627f6ba8d48a5b.zip
Merge tag 'mmc-v3.19-1' of git://git.linaro.org/people/ulf.hansson/mmc
Pull MMC updates from Ulf Hansson: "MMC core: - Consolidation and cleanups. - Some improvements regarding error handling. - Increase maximum amount of block devices. - Use correct OCR mask for SDIO when restoring power. - Fix prepared requests while doing BKOPS. - Convert to modern PM ops. - Add mmc_send_tuning() API and convert some hosts to use it. MMC host: - toshsd: New Toshiba PCI SD controller driver. - sdhci: 64-bit ADMA support. - sdhci: Some regulator fixes. - sdhci: HS400 support. - sdhci: Various fixes cleanups. - atmel-mci: Modernization and cleanups. - atmel-mci: Runtime PM support. - omap_hsmmc: Modernization and cleanups. - omap_hsmmc: Fix UHS card with DDR50 support. - dw_mmc: Support for ARM64 and Exynos 7 variant. - dw_mmc: Add support for IMG Pistachio variant. - dw_mmc: Various fixes and cleanups. - mvsdio: DMA fixes. - mxs-mmc: Modernization and cleanups. - mxcmmc: Various fixes" * tag 'mmc-v3.19-1' of git://git.linaro.org/people/ulf.hansson/mmc: (126 commits) mmc: sdhci-msm: Convert to mmc_send_tuning() mmc: sdhci-esdhc-imx: Convert to mmc_send_tuning() mmc: core: Let mmc_send_tuning() to take struct mmc_host* as parameter mmc: queue: Improve error handling during allocation of bounce buffers mmc: sdhci-acpi: Add two host capabilities for Intel mmc: sdhci-pci: Add two host capabilities for BYT mmc: sdhci-acpi: Add SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC mmc: sdhci-pci: Add SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC to BYT mmc: atmel-mci: use probe deferring if dma controller is not ready yet mmc: atmel-mci: stop using specific initcall mmc: atmel-mci: remove __init/__exit attributes mmc: atmel-mci: remove useless DMA stuff for non-dt devices mmc: omap_hsmmc: Fix UHS card with DDR50 support mmc: core: add core-level function for sending tuning commands mmc: core: hold SD Clock before CMD11 during Signal mmc: mxs-mmc: Check for clk_prepare_enable() error mmc: mxs-mmc: Propagate the real error mmc: mxs-mmc: No need to do NULL check on 'iores' mmc: dw_mmc: Add support for IMG Pistachio mmc: mxs-mmc: Simplify PM hooks ...
Diffstat (limited to 'drivers/mmc/card/mmc_test.c')
-rw-r--r--drivers/mmc/card/mmc_test.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index 0c0fc52d42c5..0a7430f94d29 100644
--- a/drivers/mmc/card/mmc_test.c
+++ b/drivers/mmc/card/mmc_test.c
@@ -14,6 +14,7 @@
#include <linux/mmc/host.h>
#include <linux/mmc/mmc.h>
#include <linux/slab.h>
+#include <linux/device.h>
#include <linux/scatterlist.h>
#include <linux/swap.h> /* For nr_free_buffer_pages() */
@@ -32,6 +33,8 @@
#define BUFFER_ORDER 2
#define BUFFER_SIZE (PAGE_SIZE << BUFFER_ORDER)
+#define TEST_ALIGN_END 8
+
/*
* Limit the test area size to the maximum MMC HC erase group size. Note that
* the maximum SD allocation unit size is just 4MiB.
@@ -1174,7 +1177,7 @@ static int mmc_test_align_write(struct mmc_test_card *test)
int ret, i;
struct scatterlist sg;
- for (i = 1;i < 4;i++) {
+ for (i = 1; i < TEST_ALIGN_END; i++) {
sg_init_one(&sg, test->buffer + i, 512);
ret = mmc_test_transfer(test, &sg, 1, 0, 1, 512, 1);
if (ret)
@@ -1189,7 +1192,7 @@ static int mmc_test_align_read(struct mmc_test_card *test)
int ret, i;
struct scatterlist sg;
- for (i = 1;i < 4;i++) {
+ for (i = 1; i < TEST_ALIGN_END; i++) {
sg_init_one(&sg, test->buffer + i, 512);
ret = mmc_test_transfer(test, &sg, 1, 0, 1, 512, 0);
if (ret)
@@ -1216,7 +1219,7 @@ static int mmc_test_align_multi_write(struct mmc_test_card *test)
if (size < 1024)
return RESULT_UNSUP_HOST;
- for (i = 1;i < 4;i++) {
+ for (i = 1; i < TEST_ALIGN_END; i++) {
sg_init_one(&sg, test->buffer + i, size);
ret = mmc_test_transfer(test, &sg, 1, 0, size/512, 512, 1);
if (ret)
@@ -1243,7 +1246,7 @@ static int mmc_test_align_multi_read(struct mmc_test_card *test)
if (size < 1024)
return RESULT_UNSUP_HOST;
- for (i = 1;i < 4;i++) {
+ for (i = 1; i < TEST_ALIGN_END; i++) {
sg_init_one(&sg, test->buffer + i, size);
ret = mmc_test_transfer(test, &sg, 1, 0, size/512, 512, 0);
if (ret)
@@ -2997,8 +3000,9 @@ err:
return ret;
}
-static int mmc_test_probe(struct mmc_card *card)
+static int mmc_test_probe(struct device *dev)
{
+ struct mmc_card *card = mmc_dev_to_card(dev);
int ret;
if (!mmc_card_mmc(card) && !mmc_card_sd(card))
@@ -3013,20 +3017,22 @@ static int mmc_test_probe(struct mmc_card *card)
return 0;
}
-static void mmc_test_remove(struct mmc_card *card)
+static int mmc_test_remove(struct device *dev)
{
+ struct mmc_card *card = mmc_dev_to_card(dev);
+
mmc_test_free_result(card);
mmc_test_free_dbgfs_file(card);
+
+ return 0;
}
-static void mmc_test_shutdown(struct mmc_card *card)
+static void mmc_test_shutdown(struct device *dev)
{
}
-static struct mmc_driver mmc_driver = {
- .drv = {
- .name = "mmc_test",
- },
+static struct device_driver mmc_driver = {
+ .name = "mmc_test",
.probe = mmc_test_probe,
.remove = mmc_test_remove,
.shutdown = mmc_test_shutdown,