On Tue, Apr 13, 2010 at 8:05 PM, Kalle Valo <kvalo@xxxxxxxxxx> wrote: > Grazvydas Ignotas <notasas@xxxxxxxxx> writes: > >> Some wl1251 hardware configurations (like in WG7210 module) have >> EEPROM attached where NVS data is kept, which includes MAC address. >> >> In such configurations, let's read default MAC address from EEPROM, >> instead of using random one. > > This also looks good, just one comment: > >> +static int wl1251_read_eeprom_byte(struct wl1251 *wl, off_t offset, u8 *data) >> +{ >> + unsigned long timeout; >> + >> + wl1251_reg_write32(wl, EE_ADDR, offset); >> + wl1251_reg_write32(wl, EE_CTL, EE_CTL_READ); >> + >> + /* EE_CTL_READ clears when data is ready */ >> + timeout = jiffies + msecs_to_jiffies(100); >> + while (1) { >> + if (!(wl1251_reg_read32(wl, EE_CTL) & EE_CTL_READ)) >> + break; >> + >> + if (time_after(jiffies, timeout)) >> + return -ETIMEDOUT; >> + >> + udelay(200); >> + } > > Is the udelay() really needed here? In my opinion msleep(), for > example with a value of 5 ms, would be nicer from system point of > view. It doesn't matter if this function takes few milliseconds > longer, because this is called only in op_start(). What do you think? It normally takes something like 700-1000us, so I guess I can replace with msleep(1) if you think it's better. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html