提交 5c0a95c7 编写于 作者: L Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
  mmc_test: initialize mmc_test_lock statically
  mmc_block: handle error from mmc_register_driver()
  atmel-mci: Set MMC_CAP_NEEDS_POLL if no detect_pin
  atmel-mci: Fix bogus debugfs file size
  atmel-mci: Fix memory leak in atmci_regs_show
  atmel-mci: debugfs: enable clock before dumping regs
  tmio_mmc: fix compilation with debug enabled
...@@ -615,14 +615,19 @@ static struct mmc_driver mmc_driver = { ...@@ -615,14 +615,19 @@ static struct mmc_driver mmc_driver = {
static int __init mmc_blk_init(void) static int __init mmc_blk_init(void)
{ {
int res = -ENOMEM; int res;
res = register_blkdev(MMC_BLOCK_MAJOR, "mmc"); res = register_blkdev(MMC_BLOCK_MAJOR, "mmc");
if (res) if (res)
goto out; goto out;
return mmc_register_driver(&mmc_driver); res = mmc_register_driver(&mmc_driver);
if (res)
goto out2;
return 0;
out2:
unregister_blkdev(MMC_BLOCK_MAJOR, "mmc");
out: out:
return res; return res;
} }
......
...@@ -1040,7 +1040,7 @@ static const struct mmc_test_case mmc_test_cases[] = { ...@@ -1040,7 +1040,7 @@ static const struct mmc_test_case mmc_test_cases[] = {
}; };
static struct mutex mmc_test_lock; static DEFINE_MUTEX(mmc_test_lock);
static void mmc_test_run(struct mmc_test_card *test, int testcase) static void mmc_test_run(struct mmc_test_card *test, int testcase)
{ {
...@@ -1171,8 +1171,6 @@ static int mmc_test_probe(struct mmc_card *card) ...@@ -1171,8 +1171,6 @@ static int mmc_test_probe(struct mmc_card *card)
if ((card->type != MMC_TYPE_MMC) && (card->type != MMC_TYPE_SD)) if ((card->type != MMC_TYPE_MMC) && (card->type != MMC_TYPE_SD))
return -ENODEV; return -ENODEV;
mutex_init(&mmc_test_lock);
ret = device_create_file(&card->dev, &dev_attr_test); ret = device_create_file(&card->dev, &dev_attr_test);
if (ret) if (ret)
return ret; return ret;
......
...@@ -195,7 +195,9 @@ static int atmci_regs_show(struct seq_file *s, void *v) ...@@ -195,7 +195,9 @@ static int atmci_regs_show(struct seq_file *s, void *v)
/* Grab a more or less consistent snapshot */ /* Grab a more or less consistent snapshot */
spin_lock_irq(&host->mmc->lock); spin_lock_irq(&host->mmc->lock);
clk_enable(host->mck);
memcpy_fromio(buf, host->regs, MCI_REGS_SIZE); memcpy_fromio(buf, host->regs, MCI_REGS_SIZE);
clk_disable(host->mck);
spin_unlock_irq(&host->mmc->lock); spin_unlock_irq(&host->mmc->lock);
seq_printf(s, "MR:\t0x%08x%s%s CLKDIV=%u\n", seq_printf(s, "MR:\t0x%08x%s%s CLKDIV=%u\n",
...@@ -216,6 +218,8 @@ static int atmci_regs_show(struct seq_file *s, void *v) ...@@ -216,6 +218,8 @@ static int atmci_regs_show(struct seq_file *s, void *v)
atmci_show_status_reg(s, "SR", buf[MCI_SR / 4]); atmci_show_status_reg(s, "SR", buf[MCI_SR / 4]);
atmci_show_status_reg(s, "IMR", buf[MCI_IMR / 4]); atmci_show_status_reg(s, "IMR", buf[MCI_IMR / 4]);
kfree(buf);
return 0; return 0;
} }
...@@ -237,7 +241,6 @@ static void atmci_init_debugfs(struct atmel_mci *host) ...@@ -237,7 +241,6 @@ static void atmci_init_debugfs(struct atmel_mci *host)
struct mmc_host *mmc; struct mmc_host *mmc;
struct dentry *root; struct dentry *root;
struct dentry *node; struct dentry *node;
struct resource *res;
mmc = host->mmc; mmc = host->mmc;
root = mmc->debugfs_root; root = mmc->debugfs_root;
...@@ -251,9 +254,6 @@ static void atmci_init_debugfs(struct atmel_mci *host) ...@@ -251,9 +254,6 @@ static void atmci_init_debugfs(struct atmel_mci *host)
if (!node) if (!node)
goto err; goto err;
res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
node->d_inode->i_size = res->end - res->start + 1;
node = debugfs_create_file("req", S_IRUSR, root, host, &atmci_req_fops); node = debugfs_create_file("req", S_IRUSR, root, host, &atmci_req_fops);
if (!node) if (!node)
goto err; goto err;
...@@ -1059,6 +1059,10 @@ static int __init atmci_probe(struct platform_device *pdev) ...@@ -1059,6 +1059,10 @@ static int __init atmci_probe(struct platform_device *pdev)
host->present = !gpio_get_value(host->detect_pin); host->present = !gpio_get_value(host->detect_pin);
} }
} }
if (!gpio_is_valid(host->detect_pin))
mmc->caps |= MMC_CAP_NEEDS_POLL;
if (gpio_is_valid(host->wp_pin)) { if (gpio_is_valid(host->wp_pin)) {
if (gpio_request(host->wp_pin, "mmc_wp")) { if (gpio_request(host->wp_pin, "mmc_wp")) {
dev_dbg(&mmc->class_dev, "no WP pin available\n"); dev_dbg(&mmc->class_dev, "no WP pin available\n");
......
...@@ -159,10 +159,10 @@ static inline void tmio_mmc_kunmap_atomic(struct tmio_mmc_host *host, ...@@ -159,10 +159,10 @@ static inline void tmio_mmc_kunmap_atomic(struct tmio_mmc_host *host,
#define STATUS_TO_TEXT(a) \ #define STATUS_TO_TEXT(a) \
do { \ do { \
if (status & TMIO_STAT_##a) \ if (status & TMIO_STAT_##a) \
printf(#a); \ printk(#a); \
} while (0) } while (0)
void debug_status(u32 status) void pr_debug_status(u32 status)
{ {
printk(KERN_DEBUG "status: %08x = ", status); printk(KERN_DEBUG "status: %08x = ", status);
STATUS_TO_TEXT(CARD_REMOVE); STATUS_TO_TEXT(CARD_REMOVE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册