Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: sdio: Parse CISTPL_VERS_1 major and minor revision numbers

They should indicate compliance of standard.

Signed-off-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20200727133837.19086-3-pali@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Pali Rohár and committed by
Ulf Hansson
78366e9c 8ebe2607

+12
+8
drivers/mmc/core/sdio_cis.c
··· 23 23 static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func, 24 24 const unsigned char *buf, unsigned size) 25 25 { 26 + u8 major_rev, minor_rev; 26 27 unsigned i, nr_strings; 27 28 char **buffer, *string; 28 29 29 30 if (size < 2) 30 31 return 0; 32 + 33 + major_rev = buf[0]; 34 + minor_rev = buf[1]; 31 35 32 36 /* Find all null-terminated (including zero length) strings in 33 37 the TPLLV1_INFO field. Trailing garbage is ignored. */ ··· 64 60 } 65 61 66 62 if (func) { 63 + func->major_rev = major_rev; 64 + func->minor_rev = minor_rev; 67 65 func->num_info = nr_strings; 68 66 func->info = (const char**)buffer; 69 67 } else { 68 + card->major_rev = major_rev; 69 + card->minor_rev = minor_rev; 70 70 card->num_info = nr_strings; 71 71 card->info = (const char**)buffer; 72 72 }
+2
include/linux/mmc/card.h
··· 297 297 struct sdio_cis cis; /* common tuple info */ 298 298 struct sdio_func *sdio_func[SDIO_MAX_FUNCS]; /* SDIO functions (devices) */ 299 299 struct sdio_func *sdio_single_irq; /* SDIO function when only one IRQ active */ 300 + u8 major_rev; /* major revision number */ 301 + u8 minor_rev; /* minor revision number */ 300 302 unsigned num_info; /* number of info strings */ 301 303 const char **info; /* info strings */ 302 304 struct sdio_func_tuple *tuples; /* unknown common tuples */
+2
include/linux/mmc/sdio_func.h
··· 51 51 52 52 u8 *tmpbuf; /* DMA:able scratch buffer */ 53 53 54 + u8 major_rev; /* major revision number */ 55 + u8 minor_rev; /* minor revision number */ 54 56 unsigned num_info; /* number of info strings */ 55 57 const char **info; /* info strings */ 56 58