hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/mmc/core/sd_ops.c
....@@ -1,12 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * linux/drivers/mmc/core/sd_ops.h
34 *
45 * Copyright 2006-2007 Pierre Ossman
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or (at
9
- * your option) any later version.
106 */
117
128 #include <linux/slab.h>
....@@ -52,36 +48,17 @@
5248 }
5349 EXPORT_SYMBOL_GPL(mmc_app_cmd);
5450
55
-/**
56
- * mmc_wait_for_app_cmd - start an application command and wait for
57
- completion
58
- * @host: MMC host to start command
59
- * @card: Card to send MMC_APP_CMD to
60
- * @cmd: MMC command to start
61
- * @retries: maximum number of retries
62
- *
63
- * Sends a MMC_APP_CMD, checks the card response, sends the command
64
- * in the parameter and waits for it to complete. Return any error
65
- * that occurred while the command was executing. Do not attempt to
66
- * parse the response.
67
- */
68
-int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card,
69
- struct mmc_command *cmd, int retries)
51
+static int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card,
52
+ struct mmc_command *cmd)
7053 {
7154 struct mmc_request mrq = {};
72
-
73
- int i, err;
74
-
75
- if (retries < 0)
76
- retries = MMC_CMD_RETRIES;
77
-
78
- err = -EIO;
55
+ int i, err = -EIO;
7956
8057 /*
8158 * We have to resend MMC_APP_CMD for each attempt so
8259 * we cannot use the retries field in mmc_command.
8360 */
84
- for (i = 0;i <= retries;i++) {
61
+ for (i = 0; i <= MMC_CMD_RETRIES; i++) {
8562 err = mmc_app_cmd(host, card);
8663 if (err) {
8764 /* no point in retrying; no APP commands allowed */
....@@ -116,8 +93,6 @@
11693 return err;
11794 }
11895
119
-EXPORT_SYMBOL(mmc_wait_for_app_cmd);
120
-
12196 int mmc_app_set_bus_width(struct mmc_card *card, int width)
12297 {
12398 struct mmc_command cmd = {};
....@@ -136,7 +111,7 @@
136111 return -EINVAL;
137112 }
138113
139
- return mmc_wait_for_app_cmd(card->host, card, &cmd, MMC_CMD_RETRIES);
114
+ return mmc_wait_for_app_cmd(card->host, card, &cmd);
140115 }
141116
142117 int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
....@@ -152,7 +127,7 @@
152127 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR;
153128
154129 for (i = 100; i; i--) {
155
- err = mmc_wait_for_app_cmd(host, NULL, &cmd, MMC_CMD_RETRIES);
130
+ err = mmc_wait_for_app_cmd(host, NULL, &cmd);
156131 if (err)
157132 break;
158133