diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/bsr.c | 6 | ||||
-rw-r--r-- | drivers/char/hw_random/omap-rng.c | 13 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 16 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_watchdog.c | 13 | ||||
-rw-r--r-- | drivers/char/mem.c | 11 | ||||
-rw-r--r-- | drivers/char/sonypi.c | 13 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.c | 29 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.h | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_atmel.c | 12 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_infineon.c | 6 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_nsc.c | 13 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_tis.c | 18 |
12 files changed, 64 insertions, 88 deletions
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c index 0c688232aab3..97467053a01b 100644 --- a/drivers/char/bsr.c +++ b/drivers/char/bsr.c | |||
@@ -297,7 +297,6 @@ static int __init bsr_init(void) | |||
297 | struct device_node *np; | 297 | struct device_node *np; |
298 | dev_t bsr_dev; | 298 | dev_t bsr_dev; |
299 | int ret = -ENODEV; | 299 | int ret = -ENODEV; |
300 | int result; | ||
301 | 300 | ||
302 | np = of_find_compatible_node(NULL, NULL, "ibm,bsr"); | 301 | np = of_find_compatible_node(NULL, NULL, "ibm,bsr"); |
303 | if (!np) | 302 | if (!np) |
@@ -306,13 +305,14 @@ static int __init bsr_init(void) | |||
306 | bsr_class = class_create(THIS_MODULE, "bsr"); | 305 | bsr_class = class_create(THIS_MODULE, "bsr"); |
307 | if (IS_ERR(bsr_class)) { | 306 | if (IS_ERR(bsr_class)) { |
308 | printk(KERN_ERR "class_create() failed for bsr_class\n"); | 307 | printk(KERN_ERR "class_create() failed for bsr_class\n"); |
308 | ret = PTR_ERR(bsr_class); | ||
309 | goto out_err_1; | 309 | goto out_err_1; |
310 | } | 310 | } |
311 | bsr_class->dev_attrs = bsr_dev_attrs; | 311 | bsr_class->dev_attrs = bsr_dev_attrs; |
312 | 312 | ||
313 | result = alloc_chrdev_region(&bsr_dev, 0, BSR_MAX_DEVS, "bsr"); | 313 | ret = alloc_chrdev_region(&bsr_dev, 0, BSR_MAX_DEVS, "bsr"); |
314 | bsr_major = MAJOR(bsr_dev); | 314 | bsr_major = MAJOR(bsr_dev); |
315 | if (result < 0) { | 315 | if (ret < 0) { |
316 | printk(KERN_ERR "alloc_chrdev_region() failed for bsr\n"); | 316 | printk(KERN_ERR "alloc_chrdev_region() failed for bsr\n"); |
317 | goto out_err_2; | 317 | goto out_err_2; |
318 | } | 318 | } |
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c index 1412565c01af..d706bd0e9e80 100644 --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c | |||
@@ -162,22 +162,24 @@ static int __exit omap_rng_remove(struct platform_device *pdev) | |||
162 | 162 | ||
163 | #ifdef CONFIG_PM | 163 | #ifdef CONFIG_PM |
164 | 164 | ||
165 | static int omap_rng_suspend(struct platform_device *pdev, pm_message_t message) | 165 | static int omap_rng_suspend(struct device *dev) |
166 | { | 166 | { |
167 | omap_rng_write_reg(RNG_MASK_REG, 0x0); | 167 | omap_rng_write_reg(RNG_MASK_REG, 0x0); |
168 | return 0; | 168 | return 0; |
169 | } | 169 | } |
170 | 170 | ||
171 | static int omap_rng_resume(struct platform_device *pdev) | 171 | static int omap_rng_resume(struct device *dev) |
172 | { | 172 | { |
173 | omap_rng_write_reg(RNG_MASK_REG, 0x1); | 173 | omap_rng_write_reg(RNG_MASK_REG, 0x1); |
174 | return 0; | 174 | return 0; |
175 | } | 175 | } |
176 | 176 | ||
177 | static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume); | ||
178 | #define OMAP_RNG_PM (&omap_rng_pm) | ||
179 | |||
177 | #else | 180 | #else |
178 | 181 | ||
179 | #define omap_rng_suspend NULL | 182 | #define OMAP_RNG_PM NULL |
180 | #define omap_rng_resume NULL | ||
181 | 183 | ||
182 | #endif | 184 | #endif |
183 | 185 | ||
@@ -188,11 +190,10 @@ static struct platform_driver omap_rng_driver = { | |||
188 | .driver = { | 190 | .driver = { |
189 | .name = "omap_rng", | 191 | .name = "omap_rng", |
190 | .owner = THIS_MODULE, | 192 | .owner = THIS_MODULE, |
193 | .pm = OMAP_RNG_PM, | ||
191 | }, | 194 | }, |
192 | .probe = omap_rng_probe, | 195 | .probe = omap_rng_probe, |
193 | .remove = __exit_p(omap_rng_remove), | 196 | .remove = __exit_p(omap_rng_remove), |
194 | .suspend = omap_rng_suspend, | ||
195 | .resume = omap_rng_resume | ||
196 | }; | 197 | }; |
197 | 198 | ||
198 | static int __init omap_rng_init(void) | 199 | static int __init omap_rng_init(void) |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 1e638fff40ea..83f85cf7fb1b 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -2503,18 +2503,6 @@ static void __devexit ipmi_pci_remove(struct pci_dev *pdev) | |||
2503 | cleanup_one_si(info); | 2503 | cleanup_one_si(info); |
2504 | } | 2504 | } |
2505 | 2505 | ||
2506 | #ifdef CONFIG_PM | ||
2507 | static int ipmi_pci_suspend(struct pci_dev *pdev, pm_message_t state) | ||
2508 | { | ||
2509 | return 0; | ||
2510 | } | ||
2511 | |||
2512 | static int ipmi_pci_resume(struct pci_dev *pdev) | ||
2513 | { | ||
2514 | return 0; | ||
2515 | } | ||
2516 | #endif | ||
2517 | |||
2518 | static struct pci_device_id ipmi_pci_devices[] = { | 2506 | static struct pci_device_id ipmi_pci_devices[] = { |
2519 | { PCI_DEVICE(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID) }, | 2507 | { PCI_DEVICE(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID) }, |
2520 | { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE_MASK) }, | 2508 | { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE_MASK) }, |
@@ -2527,10 +2515,6 @@ static struct pci_driver ipmi_pci_driver = { | |||
2527 | .id_table = ipmi_pci_devices, | 2515 | .id_table = ipmi_pci_devices, |
2528 | .probe = ipmi_pci_probe, | 2516 | .probe = ipmi_pci_probe, |
2529 | .remove = __devexit_p(ipmi_pci_remove), | 2517 | .remove = __devexit_p(ipmi_pci_remove), |
2530 | #ifdef CONFIG_PM | ||
2531 | .suspend = ipmi_pci_suspend, | ||
2532 | .resume = ipmi_pci_resume, | ||
2533 | #endif | ||
2534 | }; | 2518 | }; |
2535 | #endif /* CONFIG_PCI */ | 2519 | #endif /* CONFIG_PCI */ |
2536 | 2520 | ||
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 7ed356e52035..37b8be7cba95 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c | |||
@@ -141,17 +141,6 @@ | |||
141 | 141 | ||
142 | #define IPMI_WDOG_TIMER_NOT_INIT_RESP 0x80 | 142 | #define IPMI_WDOG_TIMER_NOT_INIT_RESP 0x80 |
143 | 143 | ||
144 | /* These are here until the real ones get into the watchdog.h interface. */ | ||
145 | #ifndef WDIOC_GETTIMEOUT | ||
146 | #define WDIOC_GETTIMEOUT _IOW(WATCHDOG_IOCTL_BASE, 20, int) | ||
147 | #endif | ||
148 | #ifndef WDIOC_SET_PRETIMEOUT | ||
149 | #define WDIOC_SET_PRETIMEOUT _IOW(WATCHDOG_IOCTL_BASE, 21, int) | ||
150 | #endif | ||
151 | #ifndef WDIOC_GET_PRETIMEOUT | ||
152 | #define WDIOC_GET_PRETIMEOUT _IOW(WATCHDOG_IOCTL_BASE, 22, int) | ||
153 | #endif | ||
154 | |||
155 | static DEFINE_MUTEX(ipmi_watchdog_mutex); | 144 | static DEFINE_MUTEX(ipmi_watchdog_mutex); |
156 | static bool nowayout = WATCHDOG_NOWAYOUT; | 145 | static bool nowayout = WATCHDOG_NOWAYOUT; |
157 | 146 | ||
@@ -732,7 +721,6 @@ static int ipmi_ioctl(struct file *file, | |||
732 | return -EFAULT; | 721 | return -EFAULT; |
733 | return 0; | 722 | return 0; |
734 | 723 | ||
735 | case WDIOC_SET_PRETIMEOUT: | ||
736 | case WDIOC_SETPRETIMEOUT: | 724 | case WDIOC_SETPRETIMEOUT: |
737 | i = copy_from_user(&val, argp, sizeof(int)); | 725 | i = copy_from_user(&val, argp, sizeof(int)); |
738 | if (i) | 726 | if (i) |
@@ -740,7 +728,6 @@ static int ipmi_ioctl(struct file *file, | |||
740 | pretimeout = val; | 728 | pretimeout = val; |
741 | return ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY); | 729 | return ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY); |
742 | 730 | ||
743 | case WDIOC_GET_PRETIMEOUT: | ||
744 | case WDIOC_GETPRETIMEOUT: | 731 | case WDIOC_GETPRETIMEOUT: |
745 | i = copy_to_user(argp, &pretimeout, sizeof(pretimeout)); | 732 | i = copy_to_user(argp, &pretimeout, sizeof(pretimeout)); |
746 | if (i) | 733 | if (i) |
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 67c3371723cc..e5eedfa24c91 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -27,14 +27,16 @@ | |||
27 | #include <linux/splice.h> | 27 | #include <linux/splice.h> |
28 | #include <linux/pfn.h> | 28 | #include <linux/pfn.h> |
29 | #include <linux/export.h> | 29 | #include <linux/export.h> |
30 | #include <linux/io.h> | ||
30 | 31 | ||
31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
32 | #include <asm/io.h> | ||
33 | 33 | ||
34 | #ifdef CONFIG_IA64 | 34 | #ifdef CONFIG_IA64 |
35 | # include <linux/efi.h> | 35 | # include <linux/efi.h> |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #define DEVPORT_MINOR 4 | ||
39 | |||
38 | static inline unsigned long size_inside_page(unsigned long start, | 40 | static inline unsigned long size_inside_page(unsigned long start, |
39 | unsigned long size) | 41 | unsigned long size) |
40 | { | 42 | { |
@@ -894,6 +896,13 @@ static int __init chr_dev_init(void) | |||
894 | for (minor = 1; minor < ARRAY_SIZE(devlist); minor++) { | 896 | for (minor = 1; minor < ARRAY_SIZE(devlist); minor++) { |
895 | if (!devlist[minor].name) | 897 | if (!devlist[minor].name) |
896 | continue; | 898 | continue; |
899 | |||
900 | /* | ||
901 | * Create /dev/port? | ||
902 | */ | ||
903 | if ((minor == DEVPORT_MINOR) && !arch_has_dev_port()) | ||
904 | continue; | ||
905 | |||
897 | device_create(mem_class, NULL, MKDEV(MEM_MAJOR, minor), | 906 | device_create(mem_class, NULL, MKDEV(MEM_MAJOR, minor), |
898 | NULL, devlist[minor].name); | 907 | NULL, devlist[minor].name); |
899 | } | 908 | } |
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 45713f0e7d61..f87780502b41 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -1459,7 +1459,7 @@ static int __devexit sonypi_remove(struct platform_device *dev) | |||
1459 | #ifdef CONFIG_PM | 1459 | #ifdef CONFIG_PM |
1460 | static int old_camera_power; | 1460 | static int old_camera_power; |
1461 | 1461 | ||
1462 | static int sonypi_suspend(struct platform_device *dev, pm_message_t state) | 1462 | static int sonypi_suspend(struct device *dev) |
1463 | { | 1463 | { |
1464 | old_camera_power = sonypi_device.camera_power; | 1464 | old_camera_power = sonypi_device.camera_power; |
1465 | sonypi_disable(); | 1465 | sonypi_disable(); |
@@ -1467,14 +1467,16 @@ static int sonypi_suspend(struct platform_device *dev, pm_message_t state) | |||
1467 | return 0; | 1467 | return 0; |
1468 | } | 1468 | } |
1469 | 1469 | ||
1470 | static int sonypi_resume(struct platform_device *dev) | 1470 | static int sonypi_resume(struct device *dev) |
1471 | { | 1471 | { |
1472 | sonypi_enable(old_camera_power); | 1472 | sonypi_enable(old_camera_power); |
1473 | return 0; | 1473 | return 0; |
1474 | } | 1474 | } |
1475 | |||
1476 | static SIMPLE_DEV_PM_OPS(sonypi_pm, sonypi_suspend, sonypi_resume); | ||
1477 | #define SONYPI_PM (&sonypi_pm) | ||
1475 | #else | 1478 | #else |
1476 | #define sonypi_suspend NULL | 1479 | #define SONYPI_PM NULL |
1477 | #define sonypi_resume NULL | ||
1478 | #endif | 1480 | #endif |
1479 | 1481 | ||
1480 | static void sonypi_shutdown(struct platform_device *dev) | 1482 | static void sonypi_shutdown(struct platform_device *dev) |
@@ -1486,12 +1488,11 @@ static struct platform_driver sonypi_driver = { | |||
1486 | .driver = { | 1488 | .driver = { |
1487 | .name = "sonypi", | 1489 | .name = "sonypi", |
1488 | .owner = THIS_MODULE, | 1490 | .owner = THIS_MODULE, |
1491 | .pm = SONYPI_PM, | ||
1489 | }, | 1492 | }, |
1490 | .probe = sonypi_probe, | 1493 | .probe = sonypi_probe, |
1491 | .remove = __devexit_p(sonypi_remove), | 1494 | .remove = __devexit_p(sonypi_remove), |
1492 | .shutdown = sonypi_shutdown, | 1495 | .shutdown = sonypi_shutdown, |
1493 | .suspend = sonypi_suspend, | ||
1494 | .resume = sonypi_resume, | ||
1495 | }; | 1496 | }; |
1496 | 1497 | ||
1497 | static struct platform_device *sonypi_platform_device; | 1498 | static struct platform_device *sonypi_platform_device; |
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index ad7c7320dd1b..817f0ee202b6 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -827,10 +827,10 @@ EXPORT_SYMBOL_GPL(tpm_pcr_extend); | |||
827 | int tpm_do_selftest(struct tpm_chip *chip) | 827 | int tpm_do_selftest(struct tpm_chip *chip) |
828 | { | 828 | { |
829 | int rc; | 829 | int rc; |
830 | u8 digest[TPM_DIGEST_SIZE]; | ||
831 | unsigned int loops; | 830 | unsigned int loops; |
832 | unsigned int delay_msec = 1000; | 831 | unsigned int delay_msec = 1000; |
833 | unsigned long duration; | 832 | unsigned long duration; |
833 | struct tpm_cmd_t cmd; | ||
834 | 834 | ||
835 | duration = tpm_calc_ordinal_duration(chip, | 835 | duration = tpm_calc_ordinal_duration(chip, |
836 | TPM_ORD_CONTINUE_SELFTEST); | 836 | TPM_ORD_CONTINUE_SELFTEST); |
@@ -845,7 +845,15 @@ int tpm_do_selftest(struct tpm_chip *chip) | |||
845 | return rc; | 845 | return rc; |
846 | 846 | ||
847 | do { | 847 | do { |
848 | rc = __tpm_pcr_read(chip, 0, digest); | 848 | /* Attempt to read a PCR value */ |
849 | cmd.header.in = pcrread_header; | ||
850 | cmd.params.pcrread_in.pcr_idx = cpu_to_be32(0); | ||
851 | rc = tpm_transmit(chip, (u8 *) &cmd, READ_PCR_RESULT_SIZE); | ||
852 | |||
853 | if (rc < TPM_HEADER_SIZE) | ||
854 | return -EFAULT; | ||
855 | |||
856 | rc = be32_to_cpu(cmd.header.out.return_code); | ||
849 | if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) { | 857 | if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) { |
850 | dev_info(chip->dev, | 858 | dev_info(chip->dev, |
851 | "TPM is disabled/deactivated (0x%X)\n", rc); | 859 | "TPM is disabled/deactivated (0x%X)\n", rc); |
@@ -1274,7 +1282,7 @@ static struct tpm_input_header savestate_header = { | |||
1274 | * We are about to suspend. Save the TPM state | 1282 | * We are about to suspend. Save the TPM state |
1275 | * so that it can be restored. | 1283 | * so that it can be restored. |
1276 | */ | 1284 | */ |
1277 | int tpm_pm_suspend(struct device *dev, pm_message_t pm_state) | 1285 | int tpm_pm_suspend(struct device *dev) |
1278 | { | 1286 | { |
1279 | struct tpm_chip *chip = dev_get_drvdata(dev); | 1287 | struct tpm_chip *chip = dev_get_drvdata(dev); |
1280 | struct tpm_cmd_t cmd; | 1288 | struct tpm_cmd_t cmd; |
@@ -1322,6 +1330,9 @@ EXPORT_SYMBOL_GPL(tpm_pm_resume); | |||
1322 | 1330 | ||
1323 | void tpm_dev_vendor_release(struct tpm_chip *chip) | 1331 | void tpm_dev_vendor_release(struct tpm_chip *chip) |
1324 | { | 1332 | { |
1333 | if (!chip) | ||
1334 | return; | ||
1335 | |||
1325 | if (chip->vendor.release) | 1336 | if (chip->vendor.release) |
1326 | chip->vendor.release(chip->dev); | 1337 | chip->vendor.release(chip->dev); |
1327 | 1338 | ||
@@ -1339,6 +1350,9 @@ void tpm_dev_release(struct device *dev) | |||
1339 | { | 1350 | { |
1340 | struct tpm_chip *chip = dev_get_drvdata(dev); | 1351 | struct tpm_chip *chip = dev_get_drvdata(dev); |
1341 | 1352 | ||
1353 | if (!chip) | ||
1354 | return; | ||
1355 | |||
1342 | tpm_dev_vendor_release(chip); | 1356 | tpm_dev_vendor_release(chip); |
1343 | 1357 | ||
1344 | chip->release(dev); | 1358 | chip->release(dev); |
@@ -1405,15 +1419,12 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, | |||
1405 | "unable to misc_register %s, minor %d\n", | 1419 | "unable to misc_register %s, minor %d\n", |
1406 | chip->vendor.miscdev.name, | 1420 | chip->vendor.miscdev.name, |
1407 | chip->vendor.miscdev.minor); | 1421 | chip->vendor.miscdev.minor); |
1408 | put_device(chip->dev); | 1422 | goto put_device; |
1409 | return NULL; | ||
1410 | } | 1423 | } |
1411 | 1424 | ||
1412 | if (sysfs_create_group(&dev->kobj, chip->vendor.attr_group)) { | 1425 | if (sysfs_create_group(&dev->kobj, chip->vendor.attr_group)) { |
1413 | misc_deregister(&chip->vendor.miscdev); | 1426 | misc_deregister(&chip->vendor.miscdev); |
1414 | put_device(chip->dev); | 1427 | goto put_device; |
1415 | |||
1416 | return NULL; | ||
1417 | } | 1428 | } |
1418 | 1429 | ||
1419 | chip->bios_dir = tpm_bios_log_setup(devname); | 1430 | chip->bios_dir = tpm_bios_log_setup(devname); |
@@ -1425,6 +1436,8 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, | |||
1425 | 1436 | ||
1426 | return chip; | 1437 | return chip; |
1427 | 1438 | ||
1439 | put_device: | ||
1440 | put_device(chip->dev); | ||
1428 | out_free: | 1441 | out_free: |
1429 | kfree(chip); | 1442 | kfree(chip); |
1430 | kfree(devname); | 1443 | kfree(devname); |
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index b1c5280ac159..917f727e6740 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h | |||
@@ -299,7 +299,7 @@ extern ssize_t tpm_write(struct file *, const char __user *, size_t, | |||
299 | loff_t *); | 299 | loff_t *); |
300 | extern ssize_t tpm_read(struct file *, char __user *, size_t, loff_t *); | 300 | extern ssize_t tpm_read(struct file *, char __user *, size_t, loff_t *); |
301 | extern void tpm_remove_hardware(struct device *); | 301 | extern void tpm_remove_hardware(struct device *); |
302 | extern int tpm_pm_suspend(struct device *, pm_message_t); | 302 | extern int tpm_pm_suspend(struct device *); |
303 | extern int tpm_pm_resume(struct device *); | 303 | extern int tpm_pm_resume(struct device *); |
304 | extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long, | 304 | extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long, |
305 | wait_queue_head_t *); | 305 | wait_queue_head_t *); |
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c index c64a1bc65349..678d57019dc4 100644 --- a/drivers/char/tpm/tpm_atmel.c +++ b/drivers/char/tpm/tpm_atmel.c | |||
@@ -168,22 +168,14 @@ static void atml_plat_remove(void) | |||
168 | } | 168 | } |
169 | } | 169 | } |
170 | 170 | ||
171 | static int tpm_atml_suspend(struct platform_device *dev, pm_message_t msg) | 171 | static SIMPLE_DEV_PM_OPS(tpm_atml_pm, tpm_pm_suspend, tpm_pm_resume); |
172 | { | ||
173 | return tpm_pm_suspend(&dev->dev, msg); | ||
174 | } | ||
175 | 172 | ||
176 | static int tpm_atml_resume(struct platform_device *dev) | ||
177 | { | ||
178 | return tpm_pm_resume(&dev->dev); | ||
179 | } | ||
180 | static struct platform_driver atml_drv = { | 173 | static struct platform_driver atml_drv = { |
181 | .driver = { | 174 | .driver = { |
182 | .name = "tpm_atmel", | 175 | .name = "tpm_atmel", |
183 | .owner = THIS_MODULE, | 176 | .owner = THIS_MODULE, |
177 | .pm = &tpm_atml_pm, | ||
184 | }, | 178 | }, |
185 | .suspend = tpm_atml_suspend, | ||
186 | .resume = tpm_atml_resume, | ||
187 | }; | 179 | }; |
188 | 180 | ||
189 | static int __init init_atmel(void) | 181 | static int __init init_atmel(void) |
diff --git a/drivers/char/tpm/tpm_infineon.c b/drivers/char/tpm/tpm_infineon.c index 76da32e11f18..3251a44e8ceb 100644 --- a/drivers/char/tpm/tpm_infineon.c +++ b/drivers/char/tpm/tpm_infineon.c | |||
@@ -4,8 +4,8 @@ | |||
4 | * SLD 9630 TT 1.1 and SLB 9635 TT 1.2 Trusted Platform Module | 4 | * SLD 9630 TT 1.1 and SLB 9635 TT 1.2 Trusted Platform Module |
5 | * Specifications at www.trustedcomputinggroup.org | 5 | * Specifications at www.trustedcomputinggroup.org |
6 | * | 6 | * |
7 | * Copyright (C) 2005, Marcel Selhorst <m.selhorst@sirrix.com> | 7 | * Copyright (C) 2005, Marcel Selhorst <tpmdd@selhorst.net> |
8 | * Sirrix AG - security technologies, http://www.sirrix.com and | 8 | * Sirrix AG - security technologies <tpmdd@sirrix.com> and |
9 | * Applied Data Security Group, Ruhr-University Bochum, Germany | 9 | * Applied Data Security Group, Ruhr-University Bochum, Germany |
10 | * Project-Homepage: http://www.trust.rub.de/projects/linux-device-driver-infineon-tpm/ | 10 | * Project-Homepage: http://www.trust.rub.de/projects/linux-device-driver-infineon-tpm/ |
11 | * | 11 | * |
@@ -671,7 +671,7 @@ static void __exit cleanup_inf(void) | |||
671 | module_init(init_inf); | 671 | module_init(init_inf); |
672 | module_exit(cleanup_inf); | 672 | module_exit(cleanup_inf); |
673 | 673 | ||
674 | MODULE_AUTHOR("Marcel Selhorst <m.selhorst@sirrix.com>"); | 674 | MODULE_AUTHOR("Marcel Selhorst <tpmdd@sirrix.com>"); |
675 | MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2"); | 675 | MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2"); |
676 | MODULE_VERSION("1.9.2"); | 676 | MODULE_VERSION("1.9.2"); |
677 | MODULE_LICENSE("GPL"); | 677 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c index 4d2464871ada..640c9a427b59 100644 --- a/drivers/char/tpm/tpm_nsc.c +++ b/drivers/char/tpm/tpm_nsc.c | |||
@@ -274,22 +274,13 @@ static void tpm_nsc_remove(struct device *dev) | |||
274 | } | 274 | } |
275 | } | 275 | } |
276 | 276 | ||
277 | static int tpm_nsc_suspend(struct platform_device *dev, pm_message_t msg) | 277 | static SIMPLE_DEV_PM_OPS(tpm_nsc_pm, tpm_pm_suspend, tpm_pm_resume); |
278 | { | ||
279 | return tpm_pm_suspend(&dev->dev, msg); | ||
280 | } | ||
281 | |||
282 | static int tpm_nsc_resume(struct platform_device *dev) | ||
283 | { | ||
284 | return tpm_pm_resume(&dev->dev); | ||
285 | } | ||
286 | 278 | ||
287 | static struct platform_driver nsc_drv = { | 279 | static struct platform_driver nsc_drv = { |
288 | .suspend = tpm_nsc_suspend, | ||
289 | .resume = tpm_nsc_resume, | ||
290 | .driver = { | 280 | .driver = { |
291 | .name = "tpm_nsc", | 281 | .name = "tpm_nsc", |
292 | .owner = THIS_MODULE, | 282 | .owner = THIS_MODULE, |
283 | .pm = &tpm_nsc_pm, | ||
293 | }, | 284 | }, |
294 | }; | 285 | }; |
295 | 286 | ||
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index d2a70cae76df..89682fa8801e 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -750,7 +750,7 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, | |||
750 | 750 | ||
751 | static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg) | 751 | static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg) |
752 | { | 752 | { |
753 | return tpm_pm_suspend(&dev->dev, msg); | 753 | return tpm_pm_suspend(&dev->dev); |
754 | } | 754 | } |
755 | 755 | ||
756 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) | 756 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) |
@@ -806,27 +806,25 @@ module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id, | |||
806 | sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444); | 806 | sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444); |
807 | MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe"); | 807 | MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe"); |
808 | #endif | 808 | #endif |
809 | static int tpm_tis_suspend(struct platform_device *dev, pm_message_t msg) | ||
810 | { | ||
811 | return tpm_pm_suspend(&dev->dev, msg); | ||
812 | } | ||
813 | 809 | ||
814 | static int tpm_tis_resume(struct platform_device *dev) | 810 | static int tpm_tis_resume(struct device *dev) |
815 | { | 811 | { |
816 | struct tpm_chip *chip = dev_get_drvdata(&dev->dev); | 812 | struct tpm_chip *chip = dev_get_drvdata(dev); |
817 | 813 | ||
818 | if (chip->vendor.irq) | 814 | if (chip->vendor.irq) |
819 | tpm_tis_reenable_interrupts(chip); | 815 | tpm_tis_reenable_interrupts(chip); |
820 | 816 | ||
821 | return tpm_pm_resume(&dev->dev); | 817 | return tpm_pm_resume(dev); |
822 | } | 818 | } |
819 | |||
820 | static SIMPLE_DEV_PM_OPS(tpm_tis_pm, tpm_pm_suspend, tpm_tis_resume); | ||
821 | |||
823 | static struct platform_driver tis_drv = { | 822 | static struct platform_driver tis_drv = { |
824 | .driver = { | 823 | .driver = { |
825 | .name = "tpm_tis", | 824 | .name = "tpm_tis", |
826 | .owner = THIS_MODULE, | 825 | .owner = THIS_MODULE, |
826 | .pm = &tpm_tis_pm, | ||
827 | }, | 827 | }, |
828 | .suspend = tpm_tis_suspend, | ||
829 | .resume = tpm_tis_resume, | ||
830 | }; | 828 | }; |
831 | 829 | ||
832 | static struct platform_device *pdev; | 830 | static struct platform_device *pdev; |