Lines Matching refs:r

313 	int r;  in pn544_hci_i2c_write()  local
326 r = i2c_master_send(client, skb->data, skb->len); in pn544_hci_i2c_write()
328 if (r == -EREMOTEIO) { /* Retry, chip was in standby */ in pn544_hci_i2c_write()
330 r = i2c_master_send(client, skb->data, skb->len); in pn544_hci_i2c_write()
333 if (r >= 0) { in pn544_hci_i2c_write()
334 if (r != skb->len) in pn544_hci_i2c_write()
335 r = -EREMOTEIO; in pn544_hci_i2c_write()
337 r = 0; in pn544_hci_i2c_write()
342 return r; in pn544_hci_i2c_write()
376 int r; in pn544_hci_i2c_read() local
381 r = i2c_master_recv(client, &len, 1); in pn544_hci_i2c_read()
382 if (r != 1) { in pn544_hci_i2c_read()
390 r = -EBADMSG; in pn544_hci_i2c_read()
396 r = -ENOMEM; in pn544_hci_i2c_read()
402 r = i2c_master_recv(client, skb_put(*skb, len), len); in pn544_hci_i2c_read()
403 if (r != len) { in pn544_hci_i2c_read()
410 r = check_crc((*skb)->data, (*skb)->len); in pn544_hci_i2c_read()
411 if (r != 0) { in pn544_hci_i2c_read()
413 r = -EBADMSG; in pn544_hci_i2c_read()
426 r = -EREMOTEIO; in pn544_hci_i2c_read()
430 return r; in pn544_hci_i2c_read()
435 int r; in pn544_hci_i2c_fw_read_status() local
439 r = i2c_master_recv(client, (char *) &response, sizeof(response)); in pn544_hci_i2c_fw_read_status()
440 if (r != sizeof(response)) { in pn544_hci_i2c_fw_read_status()
503 int r; in pn544_hci_i2c_irq_thread_fn() local
520 r = pn544_hci_i2c_read(phy, &skb); in pn544_hci_i2c_irq_thread_fn()
521 if (r == -EREMOTEIO) { in pn544_hci_i2c_irq_thread_fn()
522 phy->hard_fault = r; in pn544_hci_i2c_irq_thread_fn()
527 } else if ((r == -ENOMEM) || (r == -EBADMSG)) { in pn544_hci_i2c_irq_thread_fn()
583 int r; in pn544_hci_i2c_fw_write_cmd() local
607 r = i2c_master_send(client, frame, framelen); in pn544_hci_i2c_fw_write_cmd()
609 if (r == framelen) in pn544_hci_i2c_fw_write_cmd()
611 else if (r < 0) in pn544_hci_i2c_fw_write_cmd()
612 return r; in pn544_hci_i2c_fw_write_cmd()
621 int r; in pn544_hci_i2c_fw_check_cmd() local
646 r = i2c_master_send(client, (const char *) &frame, sizeof(frame)); in pn544_hci_i2c_fw_check_cmd()
648 if (r == sizeof(frame)) in pn544_hci_i2c_fw_check_cmd()
650 else if (r < 0) in pn544_hci_i2c_fw_check_cmd()
651 return r; in pn544_hci_i2c_fw_check_cmd()
658 int r; in pn544_hci_i2c_fw_write_chunk() local
660 r = pn544_hci_i2c_fw_write_cmd(phy->i2c_dev, in pn544_hci_i2c_fw_write_chunk()
664 if (r < 0) in pn544_hci_i2c_fw_write_chunk()
665 return r; in pn544_hci_i2c_fw_write_chunk()
667 phy->fw_written += r; in pn544_hci_i2c_fw_write_chunk()
679 int r; in pn544_hci_i2c_fw_secure_write_frame_cmd() local
694 r = i2c_master_send(phy->i2c_dev, buf, chunklen); in pn544_hci_i2c_fw_secure_write_frame_cmd()
696 if (r == chunklen) in pn544_hci_i2c_fw_secure_write_frame_cmd()
698 else if (r < 0) in pn544_hci_i2c_fw_secure_write_frame_cmd()
699 return r; in pn544_hci_i2c_fw_secure_write_frame_cmd()
708 int r; in pn544_hci_i2c_fw_secure_write_frame() local
722 r = i2c_master_send(phy->i2c_dev, in pn544_hci_i2c_fw_secure_write_frame()
725 if (r == phy->fw_blob_size) in pn544_hci_i2c_fw_secure_write_frame()
727 else if (r < 0) in pn544_hci_i2c_fw_secure_write_frame()
728 return r; in pn544_hci_i2c_fw_secure_write_frame()
733 r = pn544_hci_i2c_fw_secure_write_frame_cmd(phy, in pn544_hci_i2c_fw_secure_write_frame()
736 if (r < 0) in pn544_hci_i2c_fw_secure_write_frame()
737 return r; in pn544_hci_i2c_fw_secure_write_frame()
740 phy->fw_written += r; in pn544_hci_i2c_fw_secure_write_frame()
757 int r; in pn544_hci_i2c_fw_work() local
765 r = request_firmware(&phy->fw, phy->firmware_name, in pn544_hci_i2c_fw_work()
767 if (r < 0) in pn544_hci_i2c_fw_work()
780 r = pn544_hci_i2c_fw_write_chunk(phy); in pn544_hci_i2c_fw_work()
787 r = pn544_hci_i2c_fw_secure_write_frame(phy); in pn544_hci_i2c_fw_work()
790 r = -ENOTSUPP; in pn544_hci_i2c_fw_work()
795 if (r < 0) in pn544_hci_i2c_fw_work()
796 pn544_hci_i2c_fw_work_complete(phy, r); in pn544_hci_i2c_fw_work()
800 r = phy->fw_cmd_result; in pn544_hci_i2c_fw_work()
801 if (r < 0) in pn544_hci_i2c_fw_work()
805 r = pn544_hci_i2c_fw_check_cmd(phy->i2c_dev, in pn544_hci_i2c_fw_work()
809 if (r < 0) in pn544_hci_i2c_fw_work()
815 r = pn544_hci_i2c_fw_write_chunk(phy); in pn544_hci_i2c_fw_work()
818 if (r < 0) in pn544_hci_i2c_fw_work()
819 pn544_hci_i2c_fw_work_complete(phy, r); in pn544_hci_i2c_fw_work()
823 r = phy->fw_cmd_result; in pn544_hci_i2c_fw_work()
824 if (r < 0) in pn544_hci_i2c_fw_work()
836 r = pn544_hci_i2c_fw_write_chunk(phy); in pn544_hci_i2c_fw_work()
840 if (r < 0 || phy->fw_blob_size == 0) in pn544_hci_i2c_fw_work()
841 pn544_hci_i2c_fw_work_complete(phy, r); in pn544_hci_i2c_fw_work()
845 r = phy->fw_cmd_result; in pn544_hci_i2c_fw_work()
846 if (r < 0) in pn544_hci_i2c_fw_work()
849 if (r == PN544_FW_CMD_RESULT_CHUNK_OK) { in pn544_hci_i2c_fw_work()
850 r = pn544_hci_i2c_fw_secure_write_frame(phy); in pn544_hci_i2c_fw_work()
864 r = pn544_hci_i2c_fw_secure_write_frame(phy); in pn544_hci_i2c_fw_work()
869 if (r < 0 || phy->fw_size == 0) in pn544_hci_i2c_fw_work()
870 pn544_hci_i2c_fw_work_complete(phy, r); in pn544_hci_i2c_fw_work()
1032 int r = 0; in pn544_hci_i2c_probe() local
1057 r = pn544_hci_i2c_of_request_resources(client); in pn544_hci_i2c_probe()
1058 if (r) { in pn544_hci_i2c_probe()
1060 return r; in pn544_hci_i2c_probe()
1070 r = pdata->request_resources(client); in pn544_hci_i2c_probe()
1071 if (r) { in pn544_hci_i2c_probe()
1074 return r; in pn544_hci_i2c_probe()
1082 r = pn544_hci_i2c_acpi_request_resources(client); in pn544_hci_i2c_probe()
1083 if (r) { in pn544_hci_i2c_probe()
1086 return r; in pn544_hci_i2c_probe()
1095 r = request_threaded_irq(client->irq, NULL, pn544_hci_i2c_irq_thread_fn, in pn544_hci_i2c_probe()
1098 if (r < 0) { in pn544_hci_i2c_probe()
1103 r = pn544_hci_probe(phy, &i2c_phy_ops, LLC_SHDLC_NAME, in pn544_hci_i2c_probe()
1107 if (r < 0) in pn544_hci_i2c_probe()
1123 return r; in pn544_hci_i2c_probe()