hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/mmc/host/davinci_mmc.c
....@@ -1,23 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * davinci_mmc.c - TI DaVinci MMC/SD/SDIO driver
34 *
45 * Copyright (C) 2006 Texas Instruments.
56 * Original author: Purushotam Kumar
67 * Copyright (C) 2009 David Brownell
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
218 */
229
2310 #include <linux/module.h>
....@@ -313,7 +300,7 @@
313300 * then it's harmless for us to allow it.
314301 */
315302 cmd_reg |= MMCCMD_BSYEXP;
316
- /* FALLTHROUGH */
303
+ fallthrough;
317304 case MMC_RSP_R1: /* 48 bits, CRC */
318305 cmd_reg |= MMCCMD_RSPFMT_R1456;
319306 break;
....@@ -1009,7 +996,7 @@
1009996
1010997 if (qstatus & MMCST0_RSPDNE) {
1011998 /* End of command phase */
1012
- end_command = (int) host->cmd;
999
+ end_command = host->cmd ? 1 : 0;
10131000 }
10141001
10151002 if (end_command)
....@@ -1187,13 +1174,13 @@
11871174 mmc->caps |= pdata->caps;
11881175
11891176 /* Register a cd gpio, if there is not one, enable polling */
1190
- ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL);
1177
+ ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0);
11911178 if (ret == -EPROBE_DEFER)
11921179 return ret;
11931180 else if (ret)
11941181 mmc->caps |= MMC_CAP_NEEDS_POLL;
11951182
1196
- ret = mmc_gpiod_request_ro(mmc, "wp", 0, false, 0, NULL);
1183
+ ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0);
11971184 if (ret == -EPROBE_DEFER)
11981185 return ret;
11991186
....@@ -1253,9 +1240,8 @@
12531240 pdev->id_entry = match->data;
12541241 ret = mmc_of_parse(mmc);
12551242 if (ret) {
1256
- if (ret != -EPROBE_DEFER)
1257
- dev_err(&pdev->dev,
1258
- "could not parse of data: %d\n", ret);
1243
+ dev_err_probe(&pdev->dev, ret,
1244
+ "could not parse of data\n");
12591245 goto parse_fail;
12601246 }
12611247 } else {
....@@ -1389,8 +1375,12 @@
13891375 static int davinci_mmcsd_resume(struct device *dev)
13901376 {
13911377 struct mmc_davinci_host *host = dev_get_drvdata(dev);
1378
+ int ret;
13921379
1393
- clk_enable(host->clk);
1380
+ ret = clk_enable(host->clk);
1381
+ if (ret)
1382
+ return ret;
1383
+
13941384 mmc_davinci_reset_ctrl(host, 0);
13951385
13961386 return 0;
....@@ -1409,6 +1399,7 @@
14091399 static struct platform_driver davinci_mmcsd_driver = {
14101400 .driver = {
14111401 .name = "davinci_mmc",
1402
+ .probe_type = PROBE_PREFER_ASYNCHRONOUS,
14121403 .pm = davinci_mmcsd_pm_ops,
14131404 .of_match_table = davinci_mmc_dt_ids,
14141405 },