| .. | .. |
|---|
| 1317 | 1317 | return ret; |
|---|
| 1318 | 1318 | |
|---|
| 1319 | 1319 | host->irq = platform_get_irq(pdev, 0); |
|---|
| 1320 | | - if (host->irq <= 0) { |
|---|
| 1321 | | - ret = -EINVAL; |
|---|
| 1320 | + if (host->irq < 0) { |
|---|
| 1321 | + ret = host->irq; |
|---|
| 1322 | 1322 | goto error_disable_mmc; |
|---|
| 1323 | 1323 | } |
|---|
| 1324 | 1324 | |
|---|
| .. | .. |
|---|
| 1459 | 1459 | struct sunxi_mmc_host *host = mmc_priv(mmc); |
|---|
| 1460 | 1460 | |
|---|
| 1461 | 1461 | mmc_remove_host(mmc); |
|---|
| 1462 | | - pm_runtime_force_suspend(&pdev->dev); |
|---|
| 1463 | | - disable_irq(host->irq); |
|---|
| 1464 | | - sunxi_mmc_disable(host); |
|---|
| 1462 | + pm_runtime_disable(&pdev->dev); |
|---|
| 1463 | + if (!pm_runtime_status_suspended(&pdev->dev)) { |
|---|
| 1464 | + disable_irq(host->irq); |
|---|
| 1465 | + sunxi_mmc_disable(host); |
|---|
| 1466 | + } |
|---|
| 1465 | 1467 | dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); |
|---|
| 1466 | 1468 | mmc_free_host(mmc); |
|---|
| 1467 | 1469 | |
|---|