forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/mmc/core/sdio_cis.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * linux/drivers/mmc/core/sdio_cis.c
34 *
....@@ -6,11 +7,6 @@
67 * Copyright: MontaVista Software Inc.
78 *
89 * Copyright 2007 Pierre Ossman
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or (at
13
- * your option) any later version.
1410 */
1511
1612 #include <linux/kernel.h>
....@@ -29,11 +25,15 @@
2925 static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func,
3026 const unsigned char *buf, unsigned size)
3127 {
28
+ u8 major_rev, minor_rev;
3229 unsigned i, nr_strings;
3330 char **buffer, *string;
3431
3532 if (size < 2)
3633 return 0;
34
+
35
+ major_rev = buf[0];
36
+ minor_rev = buf[1];
3737
3838 /* Find all null-terminated (including zero length) strings in
3939 the TPLLV1_INFO field. Trailing garbage is ignored. */
....@@ -66,9 +66,13 @@
6666 }
6767
6868 if (func) {
69
+ func->major_rev = major_rev;
70
+ func->minor_rev = minor_rev;
6971 func->num_info = nr_strings;
7072 func->info = (const char**)buffer;
7173 } else {
74
+ card->major_rev = major_rev;
75
+ card->minor_rev = minor_rev;
7276 card->num_info = nr_strings;
7377 card->info = (const char**)buffer;
7478 }
....@@ -388,12 +392,6 @@
388392 return ret;
389393
390394 /*
391
- * Since we've linked to tuples in the card structure,
392
- * we must make sure we have a reference to it.
393
- */
394
- get_device(&func->card->dev);
395
-
396
- /*
397395 * Vendor/device id is optional for function CIS, so
398396 * copy it from the card structure as needed.
399397 */
....@@ -418,11 +416,5 @@
418416 }
419417
420418 func->tuples = NULL;
421
-
422
- /*
423
- * We have now removed the link to the tuples in the
424
- * card structure, so remove the reference.
425
- */
426
- put_device(&func->card->dev);
427419 }
428420