aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/s3cmci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/s3cmci.c')
-rw-r--r--drivers/mmc/host/s3cmci.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index 99b74a351020..2fdf7689ae6c 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -820,7 +820,7 @@ fail_request:
820static void finalize_request(struct s3cmci_host *host) 820static void finalize_request(struct s3cmci_host *host)
821{ 821{
822 struct mmc_request *mrq = host->mrq; 822 struct mmc_request *mrq = host->mrq;
823 struct mmc_command *cmd = host->cmd_is_stop ? mrq->stop : mrq->cmd; 823 struct mmc_command *cmd;
824 int debug_as_failure = 0; 824 int debug_as_failure = 0;
825 825
826 if (host->complete_what != COMPLETION_FINALIZE) 826 if (host->complete_what != COMPLETION_FINALIZE)
@@ -828,6 +828,7 @@ static void finalize_request(struct s3cmci_host *host)
828 828
829 if (!mrq) 829 if (!mrq)
830 return; 830 return;
831 cmd = host->cmd_is_stop ? mrq->stop : mrq->cmd;
831 832
832 if (cmd->data && (cmd->error == 0) && 833 if (cmd->data && (cmd->error == 0) &&
833 (cmd->data->error == 0)) { 834 (cmd->data->error == 0)) {
@@ -1178,7 +1179,7 @@ static int s3cmci_card_present(struct mmc_host *mmc)
1178 struct s3c24xx_mci_pdata *pdata = host->pdata; 1179 struct s3c24xx_mci_pdata *pdata = host->pdata;
1179 int ret; 1180 int ret;
1180 1181
1181 if (pdata->gpio_detect == 0) 1182 if (pdata->no_detect)
1182 return -ENOSYS; 1183 return -ENOSYS;
1183 1184
1184 ret = gpio_get_value(pdata->gpio_detect) ? 0 : 1; 1185 ret = gpio_get_value(pdata->gpio_detect) ? 0 : 1;
@@ -1302,10 +1303,8 @@ static int s3cmci_get_ro(struct mmc_host *mmc)
1302 if (pdata->no_wprotect) 1303 if (pdata->no_wprotect)
1303 return 0; 1304 return 0;
1304 1305
1305 ret = s3c2410_gpio_getpin(pdata->gpio_wprotect); 1306 ret = gpio_get_value(pdata->gpio_wprotect) ? 1 : 0;
1306 1307 ret ^= pdata->wprotect_invert;
1307 if (pdata->wprotect_invert)
1308 ret = !ret;
1309 1308
1310 return ret; 1309 return ret;
1311} 1310}
@@ -1360,7 +1359,9 @@ static struct mmc_host_ops s3cmci_ops = {
1360 1359
1361static struct s3c24xx_mci_pdata s3cmci_def_pdata = { 1360static struct s3c24xx_mci_pdata s3cmci_def_pdata = {
1362 /* This is currently here to avoid a number of if (host->pdata) 1361 /* This is currently here to avoid a number of if (host->pdata)
1363 * checks. Any zero fields to ensure reaonable defaults are picked. */ 1362 * checks. Any zero fields to ensure reasonable defaults are picked. */
1363 .no_wprotect = 1,
1364 .no_detect = 1,
1364}; 1365};
1365 1366
1366#ifdef CONFIG_CPU_FREQ 1367#ifdef CONFIG_CPU_FREQ
@@ -1654,7 +1655,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev)
1654 goto probe_free_irq; 1655 goto probe_free_irq;
1655 } 1656 }
1656 1657
1657 host->irq_cd = s3c2410_gpio_getirq(host->pdata->gpio_detect); 1658 host->irq_cd = gpio_to_irq(host->pdata->gpio_detect);
1658 1659
1659 if (host->irq_cd >= 0) { 1660 if (host->irq_cd >= 0) {
1660 if (request_irq(host->irq_cd, s3cmci_irq_cd, 1661 if (request_irq(host->irq_cd, s3cmci_irq_cd,
@@ -1892,7 +1893,7 @@ static int s3cmci_resume(struct device *dev)
1892 return mmc_resume_host(mmc); 1893 return mmc_resume_host(mmc);
1893} 1894}
1894 1895
1895static struct dev_pm_ops s3cmci_pm = { 1896static const struct dev_pm_ops s3cmci_pm = {
1896 .suspend = s3cmci_suspend, 1897 .suspend = s3cmci_suspend,
1897 .resume = s3cmci_resume, 1898 .resume = s3cmci_resume,
1898}; 1899};