misc: atsha204a: remove broken for loop

Some previous commit changed the continue statement to return,
making the for loop used to retry waking up the chip to always
return after one iteration. This commit removes the loop, cleaning
the code a little.

Signed-off-by: Michał Barnaś <barnas@google.com>
This commit is contained in:
Michał Barnaś
2024-02-19 16:32:02 +00:00
committed by Tom Rini
parent 0cfc2e9225
commit c4841ae405

View File

@@ -96,13 +96,10 @@ int atsha204a_wakeup(struct udevice *dev)
{ {
u8 req[4]; u8 req[4];
struct atsha204a_resp resp; struct atsha204a_resp resp;
int try, res; int res;
debug("Waking up ATSHA204A\n"); debug("Waking up ATSHA204A\n");
for (try = 1; try <= 10; ++try) {
debug("Try %i... ", try);
/* /*
* The device ignores any levels or transitions on the SCL pin * The device ignores any levels or transitions on the SCL pin
* when the device is idle, asleep or during waking up. * when the device is idle, asleep or during waking up.
@@ -120,16 +117,12 @@ int atsha204a_wakeup(struct udevice *dev)
} }
if (resp.code != ATSHA204A_STATUS_AFTER_WAKE) { if (resp.code != ATSHA204A_STATUS_AFTER_WAKE) {
debug ("failed (responce code = %02x), ending\n", debug("failed (response code = %02x), ending\n", resp.code);
resp.code);
return -EBADMSG; return -EBADMSG;
} }
debug("success\n"); debug("success\n");
return 0; return 0;
}
return -ETIMEDOUT;
} }
int atsha204a_idle(struct udevice *dev) int atsha204a_idle(struct udevice *dev)