Lines Matching refs:rc

76 	int rc;  in tpm_tis_i2c_read()  local
83 rc = dm_i2c_write(dev, 0, (uchar *)&addrbuf, 1); in tpm_tis_i2c_read()
84 if (rc == 0) in tpm_tis_i2c_read()
88 if (rc) in tpm_tis_i2c_read()
89 return rc; in tpm_tis_i2c_read()
97 rc = dm_i2c_read(dev, 0, buffer, len); in tpm_tis_i2c_read()
98 if (rc == 0) in tpm_tis_i2c_read()
110 rc = dm_i2c_read(dev, addr, buffer, len); in tpm_tis_i2c_read()
111 if (rc == 0) in tpm_tis_i2c_read()
119 if (rc) in tpm_tis_i2c_read()
120 return rc; in tpm_tis_i2c_read()
131 int rc = 0; in tpm_tis_i2c_write_generic() local
144 rc = dm_i2c_write(dev, addr, buffer, len); in tpm_tis_i2c_write_generic()
145 if (rc == 0) in tpm_tis_i2c_write_generic()
152 if (rc) in tpm_tis_i2c_write_generic()
153 return rc; in tpm_tis_i2c_write_generic()
198 int rc; in tpm_tis_i2c_check_locality() local
200 rc = tpm_tis_i2c_read(dev, TPM_ACCESS(loc), &buf, 1); in tpm_tis_i2c_check_locality()
201 if (rc < 0) in tpm_tis_i2c_check_locality()
202 return rc; in tpm_tis_i2c_check_locality()
232 int rc; in tpm_tis_i2c_request_locality() local
234 rc = tpm_tis_i2c_check_locality(dev, loc); in tpm_tis_i2c_request_locality()
235 if (rc >= 0) { in tpm_tis_i2c_request_locality()
238 } else if (rc != -ENOENT) { in tpm_tis_i2c_request_locality()
239 debug("%s: Failed to get locality: %d\n", __func__, rc); in tpm_tis_i2c_request_locality()
240 return rc; in tpm_tis_i2c_request_locality()
243 rc = tpm_tis_i2c_write(dev, TPM_ACCESS(loc), &buf, 1); in tpm_tis_i2c_request_locality()
244 if (rc) { in tpm_tis_i2c_request_locality()
245 debug("%s: Failed to write to TPM: %d\n", __func__, rc); in tpm_tis_i2c_request_locality()
246 return rc; in tpm_tis_i2c_request_locality()
253 rc = tpm_tis_i2c_check_locality(dev, loc); in tpm_tis_i2c_request_locality()
254 if (rc >= 0) { in tpm_tis_i2c_request_locality()
257 } else if (rc != -ENOENT) { in tpm_tis_i2c_request_locality()
258 debug("%s: Failed to get locality: %d\n", __func__, rc); in tpm_tis_i2c_request_locality()
259 return rc; in tpm_tis_i2c_request_locality()
263 debug("%s: Timeout getting locality: %d\n", __func__, rc); in tpm_tis_i2c_request_locality()
265 return rc; in tpm_tis_i2c_request_locality()
283 int rc; in tpm_tis_i2c_ready() local
289 rc = tpm_tis_i2c_write_long(dev, TPM_STS(chip->locality), &buf, 1); in tpm_tis_i2c_ready()
290 if (rc) in tpm_tis_i2c_ready()
291 debug("%s: rc=%d\n", __func__, rc); in tpm_tis_i2c_ready()
293 return rc; in tpm_tis_i2c_ready()
350 int rc; in tpm_tis_i2c_recv_data() local
363 rc = tpm_tis_i2c_read(dev, TPM_DATA_FIFO(chip->locality), in tpm_tis_i2c_recv_data()
365 if (rc == 0) in tpm_tis_i2c_recv_data()
378 int rc; in tpm_tis_i2c_recv() local
410 rc = tpm_tis_i2c_wait_for_stat(dev, TPM_STS_VALID, chip->timeout_c, in tpm_tis_i2c_recv()
412 if (rc) in tpm_tis_i2c_recv()
413 return rc; in tpm_tis_i2c_recv()
425 int rc, status; in tpm_tis_i2c_send() local
440 rc = tpm_tis_i2c_ready(dev); in tpm_tis_i2c_send()
441 if (rc) in tpm_tis_i2c_send()
442 return rc; in tpm_tis_i2c_send()
443 rc = tpm_tis_i2c_wait_for_stat(dev, TPM_STS_COMMAND_READY, in tpm_tis_i2c_send()
445 if (rc) in tpm_tis_i2c_send()
446 return rc; in tpm_tis_i2c_send()
465 rc = tpm_tis_i2c_write(dev, TPM_DATA_FIFO(chip->locality), in tpm_tis_i2c_send()
467 if (rc == 0) in tpm_tis_i2c_send()
473 rc = tpm_tis_i2c_wait_for_stat(dev, TPM_STS_VALID, in tpm_tis_i2c_send()
476 if (rc) in tpm_tis_i2c_send()
477 return rc; in tpm_tis_i2c_send()
485 rc = tpm_tis_i2c_write(dev, TPM_STS(chip->locality), &sts, 1); in tpm_tis_i2c_send()
486 if (rc < 0) in tpm_tis_i2c_send()
487 return rc; in tpm_tis_i2c_send()
488 debug("%s: done, rc=%d\n", __func__, rc); in tpm_tis_i2c_send()
513 int rc; in tpm_tis_i2c_init() local
523 rc = tpm_tis_i2c_request_locality(dev, 0); in tpm_tis_i2c_init()
524 if (rc < 0) in tpm_tis_i2c_init()
525 return rc; in tpm_tis_i2c_init()
561 int rc; in tpm_tis_i2c_open() local
566 rc = tpm_tis_i2c_init(dev); in tpm_tis_i2c_open()
567 if (rc < 0) in tpm_tis_i2c_open()
570 return rc; in tpm_tis_i2c_open()