Lines Matching refs:dev
48 tpm_build_acpi_table(const struct acpi_device *const dev) in tpm_build_acpi_table() argument
50 const struct tpm_device *const tpm = acpi_device_get_softc(dev); in tpm_build_acpi_table()
60 tpm_write_dsdt(const struct acpi_device *const dev) in tpm_write_dsdt() argument
64 const struct tpm_device *const tpm = acpi_device_get_softc(dev); in tpm_write_dsdt()
113 tpm_device_destroy(struct tpm_device *const dev) in tpm_device_destroy() argument
115 if (dev == NULL) in tpm_device_destroy()
118 if (dev->ppi != NULL && dev->ppi->deinit != NULL) in tpm_device_destroy()
119 dev->ppi->deinit(dev->ppi_sc); in tpm_device_destroy()
120 if (dev->intf != NULL && dev->intf->deinit != NULL) in tpm_device_destroy()
121 dev->intf->deinit(dev->intf_sc); in tpm_device_destroy()
122 if (dev->emul != NULL && dev->emul->deinit != NULL) in tpm_device_destroy()
123 dev->emul->deinit(dev->emul_sc); in tpm_device_destroy()
125 acpi_device_destroy(dev->acpi_dev); in tpm_device_destroy()
126 free(dev); in tpm_device_destroy()
133 struct tpm_device *dev = NULL; in tpm_device_create() local
156 dev = calloc(1, sizeof(*dev)); in tpm_device_create()
157 if (dev == NULL) { in tpm_device_create()
162 dev->vm_ctx = vm_ctx; in tpm_device_create()
164 error = acpi_device_create(&dev->acpi_dev, dev, dev->vm_ctx, in tpm_device_create()
174 dev->emul = *ppemul; in tpm_device_create()
177 if (dev->emul == NULL) { in tpm_device_create()
183 if (dev->emul->init) { in tpm_device_create()
184 error = dev->emul->init(&dev->emul_sc, nvl); in tpm_device_create()
194 dev->intf = *ppintf; in tpm_device_create()
197 if (dev->intf == NULL) { in tpm_device_create()
203 if (dev->intf->init) { in tpm_device_create()
204 error = dev->intf->init(&dev->intf_sc, dev->emul, dev->emul_sc, in tpm_device_create()
205 dev->acpi_dev); in tpm_device_create()
215 dev->ppi = *pp_ppi; in tpm_device_create()
218 if (dev->ppi == NULL) { in tpm_device_create()
224 if (dev->ppi->init) { in tpm_device_create()
225 error = dev->ppi->init(&dev->ppi_sc); in tpm_device_create()
230 *new_dev = dev; in tpm_device_create()
235 tpm_device_destroy(dev); in tpm_device_create()