Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r a7c552e1ed7f head/sys/dev/flash/mx25l.c
- --- a/head/sys/dev/flash/mx25l.c Wed Dec 05 12:37:28 2012 +0200
- +++ b/head/sys/dev/flash/mx25l.c Wed Dec 05 13:42:00 2012 +0200
- @@ -231,7 +231,7 @@
- uint8_t txBuf[4];//, rxBuf[4];
- uint8_t status;
- struct spi_command cmd;
- - int err;
- + int err, timeout;
- sc = device_get_softc(dev);
- @@ -246,9 +246,15 @@
- cmd.tx_cmd_sz = 1;
- err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd);
- - status = mx25l_get_status(dev);
- -
- - if (writable && !(status & STATUS_WEL))
- + timeout = 1000;
- + while (timeout--) {
- + status = mx25l_get_status(dev);
- + if (writable && (status & STATUS_WEL))
- + break;
- + if (!writable && !(status & STATUS_WEL))
- + break;
- + }
- + if (timeout == 0)
- device_printf(dev, "%s - fail\n", __func__);
- }
Advertisement
Add Comment
Please, Sign In to add comment