Lines Matching refs:rc
334 ssize_t rc; in tpm_transmit() local
353 rc = chip->ops->send(chip, (u8 *) buf, count); in tpm_transmit()
354 if (rc < 0) { in tpm_transmit()
356 "tpm_transmit: tpm_send: error %zd\n", rc); in tpm_transmit()
375 rc = -ECANCELED; in tpm_transmit()
385 rc = -ETIME; in tpm_transmit()
389 rc = chip->ops->recv(chip, (u8 *) buf, bufsiz); in tpm_transmit()
390 if (rc < 0) in tpm_transmit()
392 "tpm_transmit: tpm_recv: error %zd\n", rc); in tpm_transmit()
395 return rc; in tpm_transmit()
437 int rc; in tpm_getcap() local
455 rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, desc); in tpm_getcap()
456 if (!rc) in tpm_getcap()
458 return rc; in tpm_getcap()
464 ssize_t rc; in tpm_gen_interrupt() local
471 rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, in tpm_gen_interrupt()
502 ssize_t rc; in tpm_get_timeouts() local
508 rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, NULL); in tpm_get_timeouts()
510 if (rc == TPM_ERR_INVALID_POSTINIT) { in tpm_get_timeouts()
515 return rc; in tpm_get_timeouts()
521 rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, in tpm_get_timeouts()
524 if (rc) { in tpm_get_timeouts()
527 rc); in tpm_get_timeouts()
583 rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, in tpm_get_timeouts()
585 if (rc) in tpm_get_timeouts()
586 return rc; in tpm_get_timeouts()
635 int rc; in tpm_continue_selftest() local
639 rc = tpm_transmit_cmd(chip, &cmd, CONTINUE_SELFTEST_RESULT_SIZE, in tpm_continue_selftest()
641 return rc; in tpm_continue_selftest()
654 int rc; in tpm_pcr_read_dev() local
659 rc = tpm_transmit_cmd(chip, &cmd, READ_PCR_RESULT_SIZE, in tpm_pcr_read_dev()
662 if (rc == 0) in tpm_pcr_read_dev()
665 return rc; in tpm_pcr_read_dev()
682 int rc; in tpm_pcr_read() local
688 rc = tpm2_pcr_read(chip, pcr_idx, res_buf); in tpm_pcr_read()
690 rc = tpm_pcr_read_dev(chip, pcr_idx, res_buf); in tpm_pcr_read()
692 return rc; in tpm_pcr_read()
717 int rc; in tpm_pcr_extend() local
725 rc = tpm2_pcr_extend(chip, pcr_idx, hash); in tpm_pcr_extend()
727 return rc; in tpm_pcr_extend()
733 rc = tpm_transmit_cmd(chip, &cmd, EXTEND_PCR_RESULT_SIZE, in tpm_pcr_extend()
737 return rc; in tpm_pcr_extend()
751 int rc; in tpm_do_selftest() local
761 rc = tpm_continue_selftest(chip); in tpm_do_selftest()
765 if (rc) in tpm_do_selftest()
766 return rc; in tpm_do_selftest()
772 rc = tpm_transmit(chip, (u8 *) &cmd, READ_PCR_RESULT_SIZE); in tpm_do_selftest()
776 if (rc == -ETIME) { in tpm_do_selftest()
782 if (rc < TPM_HEADER_SIZE) in tpm_do_selftest()
785 rc = be32_to_cpu(cmd.header.out.return_code); in tpm_do_selftest()
786 if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) { in tpm_do_selftest()
788 "TPM is disabled/deactivated (0x%X)\n", rc); in tpm_do_selftest()
795 if (rc != TPM_WARN_DOING_SELFTEST) in tpm_do_selftest()
796 return rc; in tpm_do_selftest()
800 return rc; in tpm_do_selftest()
807 int rc; in tpm_send() local
813 rc = tpm_transmit_cmd(chip, cmd, buflen, "attempting tpm_cmd"); in tpm_send()
816 return rc; in tpm_send()
839 long rc; in wait_for_tpm_stat() local
855 rc = wait_event_interruptible_timeout(*queue, in wait_for_tpm_stat()
859 if (rc > 0) { in wait_for_tpm_stat()
864 if (rc == -ERESTARTSYS && freezing(current)) { in wait_for_tpm_stat()
897 int rc, try; in tpm_pm_suspend() local
915 rc = tpm_transmit_cmd(chip, &cmd, EXTEND_PCR_RESULT_SIZE, in tpm_pm_suspend()
922 rc = tpm_transmit_cmd(chip, &cmd, SAVESTATE_RESULT_SIZE, NULL); in tpm_pm_suspend()
934 if (rc != TPM_WARN_RETRY) in tpm_pm_suspend()
939 if (rc) in tpm_pm_suspend()
941 "Error (%d) sending savestate before suspend\n", rc); in tpm_pm_suspend()
946 return rc; in tpm_pm_suspend()
1026 int rc; in tpm_init() local
1034 rc = alloc_chrdev_region(&tpm_devt, 0, TPM_NUM_DEVICES, "tpm"); in tpm_init()
1035 if (rc < 0) { in tpm_init()
1038 return rc; in tpm_init()