diff options
author | James Morris <jmorris@namei.org> | 2010-05-07 09:19:29 +1000 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-05-07 09:19:29 +1000 |
commit | ec4a162af388a2716c5314c4aff7029071d09f57 (patch) | |
tree | 10b5c972f756620c8bba693a4363029c42d37ef3 /drivers/char/tpm/tpm_tis.c | |
parent | f70e2e06196ad4c1c762037da2f75354f6c16b81 (diff) |
Revert "TPM: ACPI/PNP dependency removal"
This reverts commit b89e66e1e396f7b5436af154e58209320cc08aed.
> > When CONFIG_PM is not set:
> >
> > drivers/built-in.o: In function `acpi_init':
> > bus.c:(.init.text+0x2d84): undefined reference to `pm_flags'
> > bus.c:(.init.text+0x2d91): undefined reference to `pm_flags'
>
> CONFIG_ACPI depends on CONFIG_PM,
> so acpi/bus.c should not be compiled for CONFIG_PM=n
>
> Hmm, is is somebody doing something strange, like "select ACPI"
> without guaranteeing that all of ACPI's dependencies are satisfied?
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'drivers/char/tpm/tpm_tis.c')
-rw-r--r-- | drivers/char/tpm/tpm_tis.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 24314a9cffe8..94345994f8a6 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -598,7 +598,7 @@ out_err: tpm_remove_hardware(chip->dev); return rc; } -#ifdef CONFIG_PNP + static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, const struct pnp_device_id *pnp_id) { @@ -663,7 +663,7 @@ static struct pnp_driver tis_pnp_driver = { module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id, sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444); MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe"); -#endif + static int tpm_tis_suspend(struct platform_device *dev, pm_message_t msg) { return tpm_pm_suspend(&dev->dev, msg); @@ -690,21 +690,21 @@ MODULE_PARM_DESC(force, "Force device probe rather than using ACPI entry"); static int __init init_tis(void) { int rc; -#ifdef CONFIG_PNP - if (!force) - return pnp_register_driver(&tis_pnp_driver); -#endif - rc = platform_driver_register(&tis_drv); - if (rc < 0) + if (force) { + rc = platform_driver_register(&tis_drv); + if (rc < 0) + return rc; + if (IS_ERR(pdev=platform_device_register_simple("tpm_tis", -1, NULL, 0))) + return PTR_ERR(pdev); + if((rc=tpm_tis_init(&pdev->dev, TIS_MEM_BASE, TIS_MEM_LEN, 0)) != 0) { + platform_device_unregister(pdev); + platform_driver_unregister(&tis_drv); + } return rc; - if (IS_ERR(pdev=platform_device_register_simple("tpm_tis", -1, NULL, 0))) - return PTR_ERR(pdev); - if((rc=tpm_tis_init(&pdev->dev, TIS_MEM_BASE, TIS_MEM_LEN, 0)) != 0) { - platform_device_unregister(pdev); - platform_driver_unregister(&tis_drv); } - return rc; + + return pnp_register_driver(&tis_pnp_driver); } static void __exit cleanup_tis(void) @@ -728,14 +728,12 @@ static void __exit cleanup_tis(void) list_del(&i->list); } spin_unlock(&tis_lock); -#ifdef CONFIG_PNP - if (!force) { + + if (force) { + platform_device_unregister(pdev); + platform_driver_unregister(&tis_drv); + } else pnp_unregister_driver(&tis_pnp_driver); - return; - } -#endif - platform_device_unregister(pdev); - platform_driver_unregister(&tis_drv); } module_init(init_tis); |