Hi Wolfgang, On Mon, Mar 4, 2013 at 7:21 PM, Wolfgang Denk <w...@denx.de> wrote: > Dear Sonic Zhang, > > In message > <cajxxz0o_ozk7w_cdfjkzpwdmfqwt1m-yn_bz6yzhrdfqt6w...@mail.gmail.com> you > wrote: >> >> Maybe I didn't describe it clearly. Yes, I return 0 at the end of this >> function. But, the same function may return UNUSABLE_ERR(-17) at the >> beginning if the data flags match MMC_DATA_WRITE. That's why the >> function can't return void. Is anything contradicting in my >> explanation? > > I see. Sorry, I missed that other return. > > One additional question, though: > >> /* kick off transfer */ >> bfin_write_SDH_DATA_CTL(bfin_read_SDH_DATA_CTL() | DTX_DMA_E | >> DTX_E); >> >> - return ret; >> + return 0; > > Are the bfin_read_SDH_DATA_CTL() and bfin_write_SDH_DATA_CTL() > supposed to always work, i. e. are we positively sure that these can > never fail, so there is no need to test the return code and handle > error conditions?
Yes, bfin_write_XXX and bfin_read_XXX are simply defined as memory access operations. They either succeed or cause hardware error exception. #define bfin_read_SDH_DATA_CTL() bfin_read16(SDH_DATA_CTL) #define _bfin_readX(addr, size, asm_size, asm_ext) ({ \ u32 __v; \ __asm__ __volatile__( \ "%0 = " #asm_size "[%1]" #asm_ext ";" \ : "=d" (__v) \ : "a" (addr) \ ); \ __v; }) Regards, Sonic _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot