tpm_ibmvtpm.c (6724af486903df57338c14424e02599e371cf563) tpm_ibmvtpm.c (9d75f08946e8485109458ccf16f714697c207f41)
1/*
2 * Copyright (C) 2012 IBM Corporation
3 *
4 * Author: Ashley Lai <ashleydlai@gmail.com>
5 *
6 * Maintained by: <tpmdd-devel@lists.sourceforge.net>
7 *
8 * Device driver for TCG/TCPA TPM (trusted platform module).

--- 564 unchanged lines hidden (view full) ---

573 return PTR_ERR(chip);
574
575 ibmvtpm = kzalloc(sizeof(struct ibmvtpm_dev), GFP_KERNEL);
576 if (!ibmvtpm) {
577 dev_err(dev, "kzalloc for ibmvtpm failed\n");
578 goto cleanup;
579 }
580
1/*
2 * Copyright (C) 2012 IBM Corporation
3 *
4 * Author: Ashley Lai <ashleydlai@gmail.com>
5 *
6 * Maintained by: <tpmdd-devel@lists.sourceforge.net>
7 *
8 * Device driver for TCG/TCPA TPM (trusted platform module).

--- 564 unchanged lines hidden (view full) ---

573 return PTR_ERR(chip);
574
575 ibmvtpm = kzalloc(sizeof(struct ibmvtpm_dev), GFP_KERNEL);
576 if (!ibmvtpm) {
577 dev_err(dev, "kzalloc for ibmvtpm failed\n");
578 goto cleanup;
579 }
580
581 ibmvtpm->dev = dev;
582 ibmvtpm->vdev = vio_dev;
583
581 crq_q = &ibmvtpm->crq_queue;
582 crq_q->crq_addr = (struct ibmvtpm_crq *)get_zeroed_page(GFP_KERNEL);
583 if (!crq_q->crq_addr) {
584 dev_err(dev, "Unable to allocate memory for crq_addr\n");
585 goto cleanup;
586 }
587
588 crq_q->num_entry = CRQ_RES_BUF_SIZE / sizeof(*crq_q->crq_addr);

--- 28 unchanged lines hidden (view full) ---

617 dev_err(dev, "Error %d enabling interrupts\n", rc);
618 goto init_irq_cleanup;
619 }
620
621 init_waitqueue_head(&ibmvtpm->wq);
622
623 crq_q->index = 0;
624
584 crq_q = &ibmvtpm->crq_queue;
585 crq_q->crq_addr = (struct ibmvtpm_crq *)get_zeroed_page(GFP_KERNEL);
586 if (!crq_q->crq_addr) {
587 dev_err(dev, "Unable to allocate memory for crq_addr\n");
588 goto cleanup;
589 }
590
591 crq_q->num_entry = CRQ_RES_BUF_SIZE / sizeof(*crq_q->crq_addr);

--- 28 unchanged lines hidden (view full) ---

620 dev_err(dev, "Error %d enabling interrupts\n", rc);
621 goto init_irq_cleanup;
622 }
623
624 init_waitqueue_head(&ibmvtpm->wq);
625
626 crq_q->index = 0;
627
625 ibmvtpm->dev = dev;
626 ibmvtpm->vdev = vio_dev;
627 TPM_VPRIV(chip) = (void *)ibmvtpm;
628
629 spin_lock_init(&ibmvtpm->rtce_lock);
630
631 rc = ibmvtpm_crq_send_init(ibmvtpm);
632 if (rc)
633 goto init_irq_cleanup;
634

--- 65 unchanged lines hidden ---
628 TPM_VPRIV(chip) = (void *)ibmvtpm;
629
630 spin_lock_init(&ibmvtpm->rtce_lock);
631
632 rc = ibmvtpm_crq_send_init(ibmvtpm);
633 if (rc)
634 goto init_irq_cleanup;
635

--- 65 unchanged lines hidden ---