
On Tue, Apr 26, 2011 at 01:42, Shaohui Xie wrote:
+struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
- unsigned int max_hz, unsigned int mode) {
- fsl = malloc(sizeof(struct fsl_spi_slave));
personally, i like to use sizeof(*fsl). up to you.
- int numBlks
i believe camel case is banned in u-boot, so use "num_blks"
[Xie Shaohui] OK.
default:
printf("Unsupported flags: %ld\n", flags);
return 1;
no one else bothers checking flags, so you dont really need to either. but if you keep this, the printf should have a prefix (such as __func__), and the flags should be shown with %#lx.
[Xie Shaohui] OK, I'll remove the flag check.
otherwise, the actual arch-specific pieces dont jump out at me ... not that i know anything about programming ppc ...
[Xie Shaohui] This is also hard to me, the hardware is so different, and I cannot add specific controller code in common part, it's easier for software to handle transaction in common part, I've to consider many situations when handle transactions in spi_xfer().
Best Regards, Shaohui Xie