diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2018-08-23 13:47:30 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-09-17 21:39:02 -0500 |
commit | eb146fac9685513ce23e57cf691da75e6c796d79 (patch) | |
tree | 2af386b568911c9c9694388e259c7bd1ba9884ee /core/i2c.c | |
parent | 1317448ddd1a872e93a6f421ba5cd5d9b3b6ea7a (diff) | |
download | skiboot-eb146fac9685513ce23e57cf691da75e6c796d79.zip skiboot-eb146fac9685513ce23e57cf691da75e6c796d79.tar.gz skiboot-eb146fac9685513ce23e57cf691da75e6c796d79.tar.bz2 |
core/i2c: Move the timeout field into i2c_request
Currently to set a per-request timeout you need to use
i2c_req_set_timeout() which is a wrapper for a per-bus method that sets the
actual timeout. This design doesn't make a whole lot of sense, so move
the timeout field into the generic i2c_request structure and set the
timeout to be set using that.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core/i2c.c')
-rw-r--r-- | core/i2c.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -208,12 +208,13 @@ int i2c_request_send(int bus_id, int dev_addr, int read_write, req->rw_buf = (void*) buf; req->rw_len = buflen; req->completion = i2c_sync_request_complete; + req->timeout = timeout; ud.done = false; req->user_data = &ud; for (retries = 0; retries <= MAX_NACK_RETRIES; retries++) { waited = 0; - i2c_set_req_timeout(req, timeout); + i2c_queue_req(req); do { |