.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * davinci_mmc.c - TI DaVinci MMC/SD/SDIO driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2006 Texas Instruments. |
---|
5 | 6 | * Original author: Purushotam Kumar |
---|
6 | 7 | * 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. |
---|
21 | 8 | */ |
---|
22 | 9 | |
---|
23 | 10 | #include <linux/module.h> |
---|
.. | .. |
---|
313 | 300 | * then it's harmless for us to allow it. |
---|
314 | 301 | */ |
---|
315 | 302 | cmd_reg |= MMCCMD_BSYEXP; |
---|
316 | | - /* FALLTHROUGH */ |
---|
| 303 | + fallthrough; |
---|
317 | 304 | case MMC_RSP_R1: /* 48 bits, CRC */ |
---|
318 | 305 | cmd_reg |= MMCCMD_RSPFMT_R1456; |
---|
319 | 306 | break; |
---|
.. | .. |
---|
1009 | 996 | |
---|
1010 | 997 | if (qstatus & MMCST0_RSPDNE) { |
---|
1011 | 998 | /* End of command phase */ |
---|
1012 | | - end_command = (int) host->cmd; |
---|
| 999 | + end_command = host->cmd ? 1 : 0; |
---|
1013 | 1000 | } |
---|
1014 | 1001 | |
---|
1015 | 1002 | if (end_command) |
---|
.. | .. |
---|
1187 | 1174 | mmc->caps |= pdata->caps; |
---|
1188 | 1175 | |
---|
1189 | 1176 | /* 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); |
---|
1191 | 1178 | if (ret == -EPROBE_DEFER) |
---|
1192 | 1179 | return ret; |
---|
1193 | 1180 | else if (ret) |
---|
1194 | 1181 | mmc->caps |= MMC_CAP_NEEDS_POLL; |
---|
1195 | 1182 | |
---|
1196 | | - ret = mmc_gpiod_request_ro(mmc, "wp", 0, false, 0, NULL); |
---|
| 1183 | + ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0); |
---|
1197 | 1184 | if (ret == -EPROBE_DEFER) |
---|
1198 | 1185 | return ret; |
---|
1199 | 1186 | |
---|
.. | .. |
---|
1253 | 1240 | pdev->id_entry = match->data; |
---|
1254 | 1241 | ret = mmc_of_parse(mmc); |
---|
1255 | 1242 | 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"); |
---|
1259 | 1245 | goto parse_fail; |
---|
1260 | 1246 | } |
---|
1261 | 1247 | } else { |
---|
.. | .. |
---|
1389 | 1375 | static int davinci_mmcsd_resume(struct device *dev) |
---|
1390 | 1376 | { |
---|
1391 | 1377 | struct mmc_davinci_host *host = dev_get_drvdata(dev); |
---|
| 1378 | + int ret; |
---|
1392 | 1379 | |
---|
1393 | | - clk_enable(host->clk); |
---|
| 1380 | + ret = clk_enable(host->clk); |
---|
| 1381 | + if (ret) |
---|
| 1382 | + return ret; |
---|
| 1383 | + |
---|
1394 | 1384 | mmc_davinci_reset_ctrl(host, 0); |
---|
1395 | 1385 | |
---|
1396 | 1386 | return 0; |
---|
.. | .. |
---|
1409 | 1399 | static struct platform_driver davinci_mmcsd_driver = { |
---|
1410 | 1400 | .driver = { |
---|
1411 | 1401 | .name = "davinci_mmc", |
---|
| 1402 | + .probe_type = PROBE_PREFER_ASYNCHRONOUS, |
---|
1412 | 1403 | .pm = davinci_mmcsd_pm_ops, |
---|
1413 | 1404 | .of_match_table = davinci_mmc_dt_ids, |
---|
1414 | 1405 | }, |
---|