| .. | .. |
|---|
| 1818 | 1818 | atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY); |
|---|
| 1819 | 1819 | state = STATE_WAITING_NOTBUSY; |
|---|
| 1820 | 1820 | } else if (host->mrq->stop) { |
|---|
| 1821 | | - atmci_writel(host, ATMCI_IER, ATMCI_CMDRDY); |
|---|
| 1822 | 1821 | atmci_send_stop_cmd(host, data); |
|---|
| 1823 | 1822 | state = STATE_SENDING_STOP; |
|---|
| 1824 | 1823 | } else { |
|---|
| .. | .. |
|---|
| 1851 | 1850 | * command to send. |
|---|
| 1852 | 1851 | */ |
|---|
| 1853 | 1852 | if (host->mrq->stop) { |
|---|
| 1854 | | - atmci_writel(host, ATMCI_IER, |
|---|
| 1855 | | - ATMCI_CMDRDY); |
|---|
| 1856 | 1853 | atmci_send_stop_cmd(host, data); |
|---|
| 1857 | 1854 | state = STATE_SENDING_STOP; |
|---|
| 1858 | 1855 | } else { |
|---|
| .. | .. |
|---|
| 2223 | 2220 | { |
|---|
| 2224 | 2221 | struct mmc_host *mmc; |
|---|
| 2225 | 2222 | struct atmel_mci_slot *slot; |
|---|
| 2223 | + int ret; |
|---|
| 2226 | 2224 | |
|---|
| 2227 | 2225 | mmc = mmc_alloc_host(sizeof(struct atmel_mci_slot), &host->pdev->dev); |
|---|
| 2228 | 2226 | if (!mmc) |
|---|
| .. | .. |
|---|
| 2306 | 2304 | |
|---|
| 2307 | 2305 | host->slot[id] = slot; |
|---|
| 2308 | 2306 | mmc_regulator_get_supply(mmc); |
|---|
| 2309 | | - mmc_add_host(mmc); |
|---|
| 2307 | + ret = mmc_add_host(mmc); |
|---|
| 2308 | + if (ret) { |
|---|
| 2309 | + mmc_free_host(mmc); |
|---|
| 2310 | + return ret; |
|---|
| 2311 | + } |
|---|
| 2310 | 2312 | |
|---|
| 2311 | 2313 | if (gpio_is_valid(slot->detect_pin)) { |
|---|
| 2312 | | - int ret; |
|---|
| 2313 | | - |
|---|
| 2314 | 2314 | timer_setup(&slot->detect_timer, atmci_detect_change, 0); |
|---|
| 2315 | 2315 | |
|---|
| 2316 | 2316 | ret = request_irq(gpio_to_irq(slot->detect_pin), |
|---|