MCI/MXS: fix signed/unsigned mismatch
Using the MXS MCI driver with an eight bit capable eMMC results into the 'devinfo' message the interface uses '0' bits for data transfer: barebox:/ devinfo mxs_mci0 resources: num : 0 start : 0x80034000 size : 0x00002000 driver: mxs_mci bus: platform Interface Min. bus clock: 1476 Hz Max. bus clock: 48000000 Hz Current bus clock: 24000000 Hz Bus width: 0 bit The eight bit interface width is stored internally as value '2'. And a two bit '2' ends up into 0xfffffffe when used as an array index. Using an unsigned field instead fixes this issue: barebox:/ devinfo mxs_mci0 resources: num : 0 start : 0x80034000 size : 0x00002000 driver: mxs_mci bus: platform Interface Min. bus clock: 1476 Hz Max. bus clock: 48000000 Hz Current bus clock: 24000000 Hz Bus width: 8 bit Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
a7ae099b36
commit
6a5e4f0c89
|
@ -55,7 +55,7 @@ struct mxs_mci_host {
|
||||||
unsigned f_min;
|
unsigned f_min;
|
||||||
unsigned f_max;
|
unsigned f_max;
|
||||||
#endif
|
#endif
|
||||||
int bus_width:2; /* 0 = 1 bit, 1 = 4 bit, 2 = 8 bit */
|
unsigned bus_width:2; /* 0 = 1 bit, 1 = 4 bit, 2 = 8 bit */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define to_mxs_mci(mxs) container_of(mxs, struct mxs_mci_host, host)
|
#define to_mxs_mci(mxs) container_of(mxs, struct mxs_mci_host, host)
|
||||||
|
|
Loading…
Reference in New Issue