diff options
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/card/block.c | 5 | ||||
-rw-r--r-- | drivers/mmc/card/queue.c | 15 | ||||
-rw-r--r-- | drivers/mmc/card/queue.h | 3 | ||||
-rw-r--r-- | drivers/mmc/core/core.c | 2 | ||||
-rw-r--r-- | drivers/mmc/core/sdio.c | 39 | ||||
-rw-r--r-- | drivers/mmc/core/sdio_bus.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/mmci.c | 14 | ||||
-rw-r--r-- | drivers/mmc/host/mmci.h | 5 | ||||
-rw-r--r-- | drivers/mmc/host/of_mmc_spi.c | 5 | ||||
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 6 | ||||
-rw-r--r-- | drivers/mmc/host/sh_mobile_sdhi.c | 5 | ||||
-rw-r--r-- | drivers/mmc/host/tmio_mmc_pio.c | 4 | ||||
-rw-r--r-- | drivers/mmc/host/vub300.c | 11 |
13 files changed, 86 insertions, 30 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 71da5641e258..f85e42224559 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -1024,7 +1024,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, | |||
1024 | INIT_LIST_HEAD(&md->part); | 1024 | INIT_LIST_HEAD(&md->part); |
1025 | md->usage = 1; | 1025 | md->usage = 1; |
1026 | 1026 | ||
1027 | ret = mmc_init_queue(&md->queue, card, &md->lock); | 1027 | ret = mmc_init_queue(&md->queue, card, &md->lock, subname); |
1028 | if (ret) | 1028 | if (ret) |
1029 | goto err_putdisk; | 1029 | goto err_putdisk; |
1030 | 1030 | ||
@@ -1297,6 +1297,9 @@ static void mmc_blk_remove(struct mmc_card *card) | |||
1297 | struct mmc_blk_data *md = mmc_get_drvdata(card); | 1297 | struct mmc_blk_data *md = mmc_get_drvdata(card); |
1298 | 1298 | ||
1299 | mmc_blk_remove_parts(card, md); | 1299 | mmc_blk_remove_parts(card, md); |
1300 | mmc_claim_host(card->host); | ||
1301 | mmc_blk_part_switch(card, md); | ||
1302 | mmc_release_host(card->host); | ||
1300 | mmc_blk_remove_req(md); | 1303 | mmc_blk_remove_req(md); |
1301 | mmc_set_drvdata(card, NULL); | 1304 | mmc_set_drvdata(card, NULL); |
1302 | } | 1305 | } |
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index c07322c2658c..6413afa318d2 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c | |||
@@ -106,10 +106,12 @@ static void mmc_request(struct request_queue *q) | |||
106 | * @mq: mmc queue | 106 | * @mq: mmc queue |
107 | * @card: mmc card to attach this queue | 107 | * @card: mmc card to attach this queue |
108 | * @lock: queue lock | 108 | * @lock: queue lock |
109 | * @subname: partition subname | ||
109 | * | 110 | * |
110 | * Initialise a MMC card request queue. | 111 | * Initialise a MMC card request queue. |
111 | */ | 112 | */ |
112 | int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock) | 113 | int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, |
114 | spinlock_t *lock, const char *subname) | ||
113 | { | 115 | { |
114 | struct mmc_host *host = card->host; | 116 | struct mmc_host *host = card->host; |
115 | u64 limit = BLK_BOUNCE_HIGH; | 117 | u64 limit = BLK_BOUNCE_HIGH; |
@@ -133,12 +135,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock | |||
133 | mq->queue->limits.max_discard_sectors = UINT_MAX; | 135 | mq->queue->limits.max_discard_sectors = UINT_MAX; |
134 | if (card->erased_byte == 0) | 136 | if (card->erased_byte == 0) |
135 | mq->queue->limits.discard_zeroes_data = 1; | 137 | mq->queue->limits.discard_zeroes_data = 1; |
136 | if (!mmc_can_trim(card) && is_power_of_2(card->erase_size)) { | 138 | mq->queue->limits.discard_granularity = card->pref_erase << 9; |
137 | mq->queue->limits.discard_granularity = | ||
138 | card->erase_size << 9; | ||
139 | mq->queue->limits.discard_alignment = | ||
140 | card->erase_size << 9; | ||
141 | } | ||
142 | if (mmc_can_secure_erase_trim(card)) | 139 | if (mmc_can_secure_erase_trim(card)) |
143 | queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD, | 140 | queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD, |
144 | mq->queue); | 141 | mq->queue); |
@@ -209,8 +206,8 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock | |||
209 | 206 | ||
210 | sema_init(&mq->thread_sem, 1); | 207 | sema_init(&mq->thread_sem, 1); |
211 | 208 | ||
212 | mq->thread = kthread_run(mmc_queue_thread, mq, "mmcqd/%d", | 209 | mq->thread = kthread_run(mmc_queue_thread, mq, "mmcqd/%d%s", |
213 | host->index); | 210 | host->index, subname ? subname : ""); |
214 | 211 | ||
215 | if (IS_ERR(mq->thread)) { | 212 | if (IS_ERR(mq->thread)) { |
216 | ret = PTR_ERR(mq->thread); | 213 | ret = PTR_ERR(mq->thread); |
diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h index 64e66e0d4994..6223ef8dc9cd 100644 --- a/drivers/mmc/card/queue.h +++ b/drivers/mmc/card/queue.h | |||
@@ -19,7 +19,8 @@ struct mmc_queue { | |||
19 | unsigned int bounce_sg_len; | 19 | unsigned int bounce_sg_len; |
20 | }; | 20 | }; |
21 | 21 | ||
22 | extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *); | 22 | extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *, |
23 | const char *); | ||
23 | extern void mmc_cleanup_queue(struct mmc_queue *); | 24 | extern void mmc_cleanup_queue(struct mmc_queue *); |
24 | extern void mmc_queue_suspend(struct mmc_queue *); | 25 | extern void mmc_queue_suspend(struct mmc_queue *); |
25 | extern void mmc_queue_resume(struct mmc_queue *); | 26 | extern void mmc_queue_resume(struct mmc_queue *); |
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 68091dda3f31..7843efe22359 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -1245,7 +1245,7 @@ static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card, | |||
1245 | */ | 1245 | */ |
1246 | timeout_clks <<= 1; | 1246 | timeout_clks <<= 1; |
1247 | timeout_us += (timeout_clks * 1000) / | 1247 | timeout_us += (timeout_clks * 1000) / |
1248 | (card->host->ios.clock / 1000); | 1248 | (mmc_host_clk_rate(card->host) / 1000); |
1249 | 1249 | ||
1250 | erase_timeout = timeout_us / 1000; | 1250 | erase_timeout = timeout_us / 1000; |
1251 | 1251 | ||
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 4d0c15bfa514..262fff019177 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c | |||
@@ -691,15 +691,54 @@ static int mmc_sdio_resume(struct mmc_host *host) | |||
691 | static int mmc_sdio_power_restore(struct mmc_host *host) | 691 | static int mmc_sdio_power_restore(struct mmc_host *host) |
692 | { | 692 | { |
693 | int ret; | 693 | int ret; |
694 | u32 ocr; | ||
694 | 695 | ||
695 | BUG_ON(!host); | 696 | BUG_ON(!host); |
696 | BUG_ON(!host->card); | 697 | BUG_ON(!host->card); |
697 | 698 | ||
698 | mmc_claim_host(host); | 699 | mmc_claim_host(host); |
700 | |||
701 | /* | ||
702 | * Reset the card by performing the same steps that are taken by | ||
703 | * mmc_rescan_try_freq() and mmc_attach_sdio() during a "normal" probe. | ||
704 | * | ||
705 | * sdio_reset() is technically not needed. Having just powered up the | ||
706 | * hardware, it should already be in reset state. However, some | ||
707 | * platforms (such as SD8686 on OLPC) do not instantly cut power, | ||
708 | * meaning that a reset is required when restoring power soon after | ||
709 | * powering off. It is harmless in other cases. | ||
710 | * | ||
711 | * The CMD5 reset (mmc_send_io_op_cond()), according to the SDIO spec, | ||
712 | * is not necessary for non-removable cards. However, it is required | ||
713 | * for OLPC SD8686 (which expects a [CMD5,5,3,7] init sequence), and | ||
714 | * harmless in other situations. | ||
715 | * | ||
716 | * With these steps taken, mmc_select_voltage() is also required to | ||
717 | * restore the correct voltage setting of the card. | ||
718 | */ | ||
719 | sdio_reset(host); | ||
720 | mmc_go_idle(host); | ||
721 | mmc_send_if_cond(host, host->ocr_avail); | ||
722 | |||
723 | ret = mmc_send_io_op_cond(host, 0, &ocr); | ||
724 | if (ret) | ||
725 | goto out; | ||
726 | |||
727 | if (host->ocr_avail_sdio) | ||
728 | host->ocr_avail = host->ocr_avail_sdio; | ||
729 | |||
730 | host->ocr = mmc_select_voltage(host, ocr & ~0x7F); | ||
731 | if (!host->ocr) { | ||
732 | ret = -EINVAL; | ||
733 | goto out; | ||
734 | } | ||
735 | |||
699 | ret = mmc_sdio_init_card(host, host->ocr, host->card, | 736 | ret = mmc_sdio_init_card(host, host->ocr, host->card, |
700 | mmc_card_keep_power(host)); | 737 | mmc_card_keep_power(host)); |
701 | if (!ret && host->sdio_irqs) | 738 | if (!ret && host->sdio_irqs) |
702 | mmc_signal_sdio_irq(host); | 739 | mmc_signal_sdio_irq(host); |
740 | |||
741 | out: | ||
703 | mmc_release_host(host); | 742 | mmc_release_host(host); |
704 | 743 | ||
705 | return ret; | 744 | return ret; |
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c index d29b9c36919a..d2565df8a7fb 100644 --- a/drivers/mmc/core/sdio_bus.c +++ b/drivers/mmc/core/sdio_bus.c | |||
@@ -189,7 +189,7 @@ static int sdio_bus_remove(struct device *dev) | |||
189 | 189 | ||
190 | /* Then undo the runtime PM settings in sdio_bus_probe() */ | 190 | /* Then undo the runtime PM settings in sdio_bus_probe() */ |
191 | if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) | 191 | if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) |
192 | pm_runtime_put_noidle(dev); | 192 | pm_runtime_put_sync(dev); |
193 | 193 | ||
194 | out: | 194 | out: |
195 | return ret; | 195 | return ret; |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 5da5bea0f9f0..fe140724a02e 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -582,6 +582,8 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data, | |||
582 | data->error = -EILSEQ; | 582 | data->error = -EILSEQ; |
583 | } else if (status & MCI_DATATIMEOUT) { | 583 | } else if (status & MCI_DATATIMEOUT) { |
584 | data->error = -ETIMEDOUT; | 584 | data->error = -ETIMEDOUT; |
585 | } else if (status & MCI_STARTBITERR) { | ||
586 | data->error = -ECOMM; | ||
585 | } else if (status & MCI_TXUNDERRUN) { | 587 | } else if (status & MCI_TXUNDERRUN) { |
586 | data->error = -EIO; | 588 | data->error = -EIO; |
587 | } else if (status & MCI_RXOVERRUN) { | 589 | } else if (status & MCI_RXOVERRUN) { |
@@ -1144,9 +1146,17 @@ static int __devinit mmci_probe(struct amba_device *dev, | |||
1144 | else if (ret != -ENOSYS) | 1146 | else if (ret != -ENOSYS) |
1145 | goto err_gpio_cd; | 1147 | goto err_gpio_cd; |
1146 | 1148 | ||
1149 | /* | ||
1150 | * A gpio pin that will detect cards when inserted and removed | ||
1151 | * will most likely want to trigger on the edges if it is | ||
1152 | * 0 when ejected and 1 when inserted (or mutatis mutandis | ||
1153 | * for the inverted case) so we request triggers on both | ||
1154 | * edges. | ||
1155 | */ | ||
1147 | ret = request_any_context_irq(gpio_to_irq(plat->gpio_cd), | 1156 | ret = request_any_context_irq(gpio_to_irq(plat->gpio_cd), |
1148 | mmci_cd_irq, 0, | 1157 | mmci_cd_irq, |
1149 | DRIVER_NAME " (cd)", host); | 1158 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, |
1159 | DRIVER_NAME " (cd)", host); | ||
1150 | if (ret >= 0) | 1160 | if (ret >= 0) |
1151 | host->gpio_cd_irq = gpio_to_irq(plat->gpio_cd); | 1161 | host->gpio_cd_irq = gpio_to_irq(plat->gpio_cd); |
1152 | } | 1162 | } |
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index bb32e21c09db..2164e8c6476c 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h | |||
@@ -86,6 +86,7 @@ | |||
86 | #define MCI_CMDRESPEND (1 << 6) | 86 | #define MCI_CMDRESPEND (1 << 6) |
87 | #define MCI_CMDSENT (1 << 7) | 87 | #define MCI_CMDSENT (1 << 7) |
88 | #define MCI_DATAEND (1 << 8) | 88 | #define MCI_DATAEND (1 << 8) |
89 | #define MCI_STARTBITERR (1 << 9) | ||
89 | #define MCI_DATABLOCKEND (1 << 10) | 90 | #define MCI_DATABLOCKEND (1 << 10) |
90 | #define MCI_CMDACTIVE (1 << 11) | 91 | #define MCI_CMDACTIVE (1 << 11) |
91 | #define MCI_TXACTIVE (1 << 12) | 92 | #define MCI_TXACTIVE (1 << 12) |
@@ -112,6 +113,7 @@ | |||
112 | #define MCI_CMDRESPENDCLR (1 << 6) | 113 | #define MCI_CMDRESPENDCLR (1 << 6) |
113 | #define MCI_CMDSENTCLR (1 << 7) | 114 | #define MCI_CMDSENTCLR (1 << 7) |
114 | #define MCI_DATAENDCLR (1 << 8) | 115 | #define MCI_DATAENDCLR (1 << 8) |
116 | #define MCI_STARTBITERRCLR (1 << 9) | ||
115 | #define MCI_DATABLOCKENDCLR (1 << 10) | 117 | #define MCI_DATABLOCKENDCLR (1 << 10) |
116 | /* Extended status bits for the ST Micro variants */ | 118 | /* Extended status bits for the ST Micro variants */ |
117 | #define MCI_ST_SDIOITC (1 << 22) | 119 | #define MCI_ST_SDIOITC (1 << 22) |
@@ -127,6 +129,7 @@ | |||
127 | #define MCI_CMDRESPENDMASK (1 << 6) | 129 | #define MCI_CMDRESPENDMASK (1 << 6) |
128 | #define MCI_CMDSENTMASK (1 << 7) | 130 | #define MCI_CMDSENTMASK (1 << 7) |
129 | #define MCI_DATAENDMASK (1 << 8) | 131 | #define MCI_DATAENDMASK (1 << 8) |
132 | #define MCI_STARTBITERRMASK (1 << 9) | ||
130 | #define MCI_DATABLOCKENDMASK (1 << 10) | 133 | #define MCI_DATABLOCKENDMASK (1 << 10) |
131 | #define MCI_CMDACTIVEMASK (1 << 11) | 134 | #define MCI_CMDACTIVEMASK (1 << 11) |
132 | #define MCI_TXACTIVEMASK (1 << 12) | 135 | #define MCI_TXACTIVEMASK (1 << 12) |
@@ -150,7 +153,7 @@ | |||
150 | #define MCI_IRQENABLE \ | 153 | #define MCI_IRQENABLE \ |
151 | (MCI_CMDCRCFAILMASK|MCI_DATACRCFAILMASK|MCI_CMDTIMEOUTMASK| \ | 154 | (MCI_CMDCRCFAILMASK|MCI_DATACRCFAILMASK|MCI_CMDTIMEOUTMASK| \ |
152 | MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \ | 155 | MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \ |
153 | MCI_CMDRESPENDMASK|MCI_CMDSENTMASK) | 156 | MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_STARTBITERRMASK) |
154 | 157 | ||
155 | /* These interrupts are directed to IRQ1 when two IRQ lines are available */ | 158 | /* These interrupts are directed to IRQ1 when two IRQ lines are available */ |
156 | #define MCI_IRQ1MASK \ | 159 | #define MCI_IRQ1MASK \ |
diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c index e2aecb7f1d5c..ab66f2454dc4 100644 --- a/drivers/mmc/host/of_mmc_spi.c +++ b/drivers/mmc/host/of_mmc_spi.c | |||
@@ -25,6 +25,11 @@ | |||
25 | #include <linux/mmc/core.h> | 25 | #include <linux/mmc/core.h> |
26 | #include <linux/mmc/host.h> | 26 | #include <linux/mmc/host.h> |
27 | 27 | ||
28 | /* For archs that don't support NO_IRQ (such as mips), provide a dummy value */ | ||
29 | #ifndef NO_IRQ | ||
30 | #define NO_IRQ 0 | ||
31 | #endif | ||
32 | |||
28 | MODULE_LICENSE("GPL"); | 33 | MODULE_LICENSE("GPL"); |
29 | 34 | ||
30 | enum { | 35 | enum { |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 5b2e2155b413..dedf3dab8a3b 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -429,7 +429,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) | |||
429 | return -EINVAL; | 429 | return -EINVAL; |
430 | } | 430 | } |
431 | } | 431 | } |
432 | mmc_slot(host).ocr_mask = mmc_regulator_get_ocrmask(reg); | ||
433 | 432 | ||
434 | /* Allow an aux regulator */ | 433 | /* Allow an aux regulator */ |
435 | reg = regulator_get(host->dev, "vmmc_aux"); | 434 | reg = regulator_get(host->dev, "vmmc_aux"); |
@@ -962,7 +961,8 @@ static void omap_hsmmc_dma_cleanup(struct omap_hsmmc_host *host, int errno) | |||
962 | spin_unlock(&host->irq_lock); | 961 | spin_unlock(&host->irq_lock); |
963 | 962 | ||
964 | if (host->use_dma && dma_ch != -1) { | 963 | if (host->use_dma && dma_ch != -1) { |
965 | dma_unmap_sg(mmc_dev(host->mmc), host->data->sg, host->dma_len, | 964 | dma_unmap_sg(mmc_dev(host->mmc), host->data->sg, |
965 | host->data->sg_len, | ||
966 | omap_hsmmc_get_dma_dir(host, host->data)); | 966 | omap_hsmmc_get_dma_dir(host, host->data)); |
967 | omap_free_dma(dma_ch); | 967 | omap_free_dma(dma_ch); |
968 | } | 968 | } |
@@ -1346,7 +1346,7 @@ static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *cb_data) | |||
1346 | return; | 1346 | return; |
1347 | } | 1347 | } |
1348 | 1348 | ||
1349 | dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->dma_len, | 1349 | dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, |
1350 | omap_hsmmc_get_dma_dir(host, data)); | 1350 | omap_hsmmc_get_dma_dir(host, data)); |
1351 | 1351 | ||
1352 | req_in_progress = host->req_in_progress; | 1352 | req_in_progress = host->req_in_progress; |
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index b3654293017b..ce500f03df85 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c | |||
@@ -92,7 +92,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev) | |||
92 | mmc_data->ocr_mask = p->tmio_ocr_mask; | 92 | mmc_data->ocr_mask = p->tmio_ocr_mask; |
93 | mmc_data->capabilities |= p->tmio_caps; | 93 | mmc_data->capabilities |= p->tmio_caps; |
94 | 94 | ||
95 | if (p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) { | 95 | if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0) { |
96 | priv->param_tx.slave_id = p->dma_slave_tx; | 96 | priv->param_tx.slave_id = p->dma_slave_tx; |
97 | priv->param_rx.slave_id = p->dma_slave_rx; | 97 | priv->param_rx.slave_id = p->dma_slave_rx; |
98 | priv->dma_priv.chan_priv_tx = &priv->param_tx; | 98 | priv->dma_priv.chan_priv_tx = &priv->param_tx; |
@@ -165,13 +165,14 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev) | |||
165 | 165 | ||
166 | p->pdata = NULL; | 166 | p->pdata = NULL; |
167 | 167 | ||
168 | tmio_mmc_host_remove(host); | ||
169 | |||
168 | for (i = 0; i < 3; i++) { | 170 | for (i = 0; i < 3; i++) { |
169 | irq = platform_get_irq(pdev, i); | 171 | irq = platform_get_irq(pdev, i); |
170 | if (irq >= 0) | 172 | if (irq >= 0) |
171 | free_irq(irq, host); | 173 | free_irq(irq, host); |
172 | } | 174 | } |
173 | 175 | ||
174 | tmio_mmc_host_remove(host); | ||
175 | clk_disable(priv->clk); | 176 | clk_disable(priv->clk); |
176 | clk_put(priv->clk); | 177 | clk_put(priv->clk); |
177 | kfree(priv); | 178 | kfree(priv); |
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index ad6347bb02dd..0b09e8239aa0 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c | |||
@@ -824,8 +824,8 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc) | |||
824 | struct tmio_mmc_host *host = mmc_priv(mmc); | 824 | struct tmio_mmc_host *host = mmc_priv(mmc); |
825 | struct tmio_mmc_data *pdata = host->pdata; | 825 | struct tmio_mmc_data *pdata = host->pdata; |
826 | 826 | ||
827 | return ((pdata->flags & TMIO_MMC_WRPROTECT_DISABLE) || | 827 | return !((pdata->flags & TMIO_MMC_WRPROTECT_DISABLE) || |
828 | !(sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT)); | 828 | (sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT)); |
829 | } | 829 | } |
830 | 830 | ||
831 | static int tmio_mmc_get_cd(struct mmc_host *mmc) | 831 | static int tmio_mmc_get_cd(struct mmc_host *mmc) |
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c index 147f28f10946..e8f6e65183d7 100644 --- a/drivers/mmc/host/vub300.c +++ b/drivers/mmc/host/vub300.c | |||
@@ -2096,7 +2096,7 @@ static struct mmc_host_ops vub300_mmc_ops = { | |||
2096 | static int vub300_probe(struct usb_interface *interface, | 2096 | static int vub300_probe(struct usb_interface *interface, |
2097 | const struct usb_device_id *id) | 2097 | const struct usb_device_id *id) |
2098 | { /* NOT irq */ | 2098 | { /* NOT irq */ |
2099 | struct vub300_mmc_host *vub300 = NULL; | 2099 | struct vub300_mmc_host *vub300; |
2100 | struct usb_host_interface *iface_desc; | 2100 | struct usb_host_interface *iface_desc; |
2101 | struct usb_device *udev = usb_get_dev(interface_to_usbdev(interface)); | 2101 | struct usb_device *udev = usb_get_dev(interface_to_usbdev(interface)); |
2102 | int i; | 2102 | int i; |
@@ -2118,23 +2118,20 @@ static int vub300_probe(struct usb_interface *interface, | |||
2118 | command_out_urb = usb_alloc_urb(0, GFP_KERNEL); | 2118 | command_out_urb = usb_alloc_urb(0, GFP_KERNEL); |
2119 | if (!command_out_urb) { | 2119 | if (!command_out_urb) { |
2120 | retval = -ENOMEM; | 2120 | retval = -ENOMEM; |
2121 | dev_err(&vub300->udev->dev, | 2121 | dev_err(&udev->dev, "not enough memory for command_out_urb\n"); |
2122 | "not enough memory for the command_out_urb\n"); | ||
2123 | goto error0; | 2122 | goto error0; |
2124 | } | 2123 | } |
2125 | command_res_urb = usb_alloc_urb(0, GFP_KERNEL); | 2124 | command_res_urb = usb_alloc_urb(0, GFP_KERNEL); |
2126 | if (!command_res_urb) { | 2125 | if (!command_res_urb) { |
2127 | retval = -ENOMEM; | 2126 | retval = -ENOMEM; |
2128 | dev_err(&vub300->udev->dev, | 2127 | dev_err(&udev->dev, "not enough memory for command_res_urb\n"); |
2129 | "not enough memory for the command_res_urb\n"); | ||
2130 | goto error1; | 2128 | goto error1; |
2131 | } | 2129 | } |
2132 | /* this also allocates memory for our VUB300 mmc host device */ | 2130 | /* this also allocates memory for our VUB300 mmc host device */ |
2133 | mmc = mmc_alloc_host(sizeof(struct vub300_mmc_host), &udev->dev); | 2131 | mmc = mmc_alloc_host(sizeof(struct vub300_mmc_host), &udev->dev); |
2134 | if (!mmc) { | 2132 | if (!mmc) { |
2135 | retval = -ENOMEM; | 2133 | retval = -ENOMEM; |
2136 | dev_err(&vub300->udev->dev, | 2134 | dev_err(&udev->dev, "not enough memory for the mmc_host\n"); |
2137 | "not enough memory for the mmc_host\n"); | ||
2138 | goto error4; | 2135 | goto error4; |
2139 | } | 2136 | } |
2140 | /* MMC core transfer sizes tunable parameters */ | 2137 | /* MMC core transfer sizes tunable parameters */ |