Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

syscore: Pass context data to callbacks

Several drivers can benefit from registering per-instance data along
with the syscore operations. To achieve this, move the modifiable fields
out of the syscore_ops structure and into a separate struct syscore that
can be registered with the framework. Add a void * driver data field for
drivers to store contextual data that will be passed to the syscore ops.

Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>

+899 -471
+8 -4
arch/arm/mach-exynos/mcpm-exynos.c
··· 215 215 {}, 216 216 }; 217 217 218 - static void exynos_mcpm_setup_entry_point(void) 218 + static void exynos_mcpm_setup_entry_point(void *data) 219 219 { 220 220 /* 221 221 * U-Boot SPL is hardcoded to jump to the start of ns_sram_base_addr ··· 228 228 __raw_writel(__pa_symbol(mcpm_entry_point), ns_sram_base_addr + 8); 229 229 } 230 230 231 - static struct syscore_ops exynos_mcpm_syscore_ops = { 231 + static const struct syscore_ops exynos_mcpm_syscore_ops = { 232 232 .resume = exynos_mcpm_setup_entry_point, 233 + }; 234 + 235 + static struct syscore exynos_mcpm_syscore = { 236 + .ops = &exynos_mcpm_syscore_ops, 233 237 }; 234 238 235 239 static int __init exynos_mcpm_init(void) ··· 304 300 pmu_raw_writel(value, EXYNOS_COMMON_OPTION(i)); 305 301 } 306 302 307 - exynos_mcpm_setup_entry_point(); 303 + exynos_mcpm_setup_entry_point(NULL); 308 304 309 - register_syscore_ops(&exynos_mcpm_syscore_ops); 305 + register_syscore(&exynos_mcpm_syscore); 310 306 311 307 return ret; 312 308 }
+29 -19
arch/arm/mach-exynos/suspend.c
··· 53 53 54 54 void (*pm_prepare)(void); 55 55 void (*pm_resume_prepare)(void); 56 - void (*pm_resume)(void); 57 - int (*pm_suspend)(void); 58 56 int (*cpu_suspend)(unsigned long); 57 + 58 + const struct syscore_ops *syscore_ops; 59 59 }; 60 60 61 61 /* Used only on Exynos542x/5800 */ ··· 376 376 } 377 377 378 378 379 - static int exynos_pm_suspend(void) 379 + static int exynos_pm_suspend(void *data) 380 380 { 381 381 exynos_pm_central_suspend(); 382 382 ··· 390 390 return 0; 391 391 } 392 392 393 - static int exynos5420_pm_suspend(void) 393 + static int exynos5420_pm_suspend(void *data) 394 394 { 395 395 u32 this_cluster; 396 396 ··· 408 408 return 0; 409 409 } 410 410 411 - static void exynos_pm_resume(void) 411 + static void exynos_pm_resume(void *data) 412 412 { 413 413 u32 cpuid = read_cpuid_part(); 414 414 ··· 429 429 exynos_set_delayed_reset_assertion(true); 430 430 } 431 431 432 - static void exynos3250_pm_resume(void) 432 + static void exynos3250_pm_resume(void *data) 433 433 { 434 434 u32 cpuid = read_cpuid_part(); 435 435 ··· 473 473 } 474 474 } 475 475 476 - static void exynos5420_pm_resume(void) 476 + static void exynos5420_pm_resume(void *data) 477 477 { 478 478 unsigned long tmp; 479 479 ··· 596 596 .valid = suspend_valid_only_mem, 597 597 }; 598 598 599 + static const struct syscore_ops exynos3250_syscore_ops = { 600 + .suspend = exynos_pm_suspend, 601 + .resume = exynos3250_pm_resume, 602 + }; 603 + 599 604 static const struct exynos_pm_data exynos3250_pm_data = { 600 605 .wkup_irq = exynos3250_wkup_irq, 601 606 .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)), 602 - .pm_suspend = exynos_pm_suspend, 603 - .pm_resume = exynos3250_pm_resume, 604 607 .pm_prepare = exynos3250_pm_prepare, 605 608 .cpu_suspend = exynos3250_cpu_suspend, 609 + .syscore_ops = &exynos3250_syscore_ops, 610 + }; 611 + 612 + static const struct syscore_ops exynos_syscore_ops = { 613 + .suspend = exynos_pm_suspend, 614 + .resume = exynos_pm_resume, 606 615 }; 607 616 608 617 static const struct exynos_pm_data exynos4_pm_data = { 609 618 .wkup_irq = exynos4_wkup_irq, 610 619 .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)), 611 - .pm_suspend = exynos_pm_suspend, 612 - .pm_resume = exynos_pm_resume, 613 620 .pm_prepare = exynos_pm_prepare, 614 621 .cpu_suspend = exynos_cpu_suspend, 622 + .syscore_ops = &exynos_syscore_ops, 615 623 }; 616 624 617 625 static const struct exynos_pm_data exynos5250_pm_data = { 618 626 .wkup_irq = exynos5250_wkup_irq, 619 627 .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)), 620 - .pm_suspend = exynos_pm_suspend, 621 - .pm_resume = exynos_pm_resume, 622 628 .pm_prepare = exynos_pm_prepare, 623 629 .cpu_suspend = exynos_cpu_suspend, 630 + .syscore_ops = &exynos_syscore_ops, 631 + }; 632 + 633 + static const struct syscore_ops exynos5420_syscore_ops = { 634 + .resume = exynos5420_pm_resume, 635 + .suspend = exynos5420_pm_suspend, 624 636 }; 625 637 626 638 static const struct exynos_pm_data exynos5420_pm_data = { 627 639 .wkup_irq = exynos5250_wkup_irq, 628 640 .wake_disable_mask = (0x7F << 7) | (0x1F << 1), 629 641 .pm_resume_prepare = exynos5420_prepare_pm_resume, 630 - .pm_resume = exynos5420_pm_resume, 631 - .pm_suspend = exynos5420_pm_suspend, 632 642 .pm_prepare = exynos5420_pm_prepare, 633 643 .cpu_suspend = exynos5420_cpu_suspend, 644 + .syscore_ops = &exynos5420_syscore_ops, 634 645 }; 635 646 636 647 static const struct of_device_id exynos_pmu_of_device_ids[] __initconst = { ··· 667 656 { /*sentinel*/ }, 668 657 }; 669 658 670 - static struct syscore_ops exynos_pm_syscore_ops; 659 + static struct syscore exynos_pm_syscore; 671 660 672 661 void __init exynos_pm_init(void) 673 662 { ··· 695 684 tmp |= pm_data->wake_disable_mask; 696 685 pmu_raw_writel(tmp, S5P_WAKEUP_MASK); 697 686 698 - exynos_pm_syscore_ops.suspend = pm_data->pm_suspend; 699 - exynos_pm_syscore_ops.resume = pm_data->pm_resume; 687 + exynos_pm_syscore.ops = pm_data->syscore_ops; 700 688 701 - register_syscore_ops(&exynos_pm_syscore_ops); 689 + register_syscore(&exynos_pm_syscore); 702 690 suspend_set_ops(&exynos_suspend_ops); 703 691 704 692 /*
+3 -3
arch/arm/mach-pxa/generic.h
··· 34 34 extern void __init pxa3xx_init_irq(void); 35 35 extern void __init pxa3xx_map_io(void); 36 36 37 - extern struct syscore_ops pxa_irq_syscore_ops; 38 - extern struct syscore_ops pxa2xx_mfp_syscore_ops; 39 - extern struct syscore_ops pxa3xx_mfp_syscore_ops; 37 + extern struct syscore pxa_irq_syscore; 38 + extern struct syscore pxa2xx_mfp_syscore; 39 + extern struct syscore pxa3xx_mfp_syscore; 40 40 41 41 void __init pxa_set_ffuart_info(void *info); 42 42 void __init pxa_set_btuart_info(void *info);
+7 -3
arch/arm/mach-pxa/irq.c
··· 178 178 static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32]; 179 179 static unsigned long saved_ipr[MAX_INTERNAL_IRQS]; 180 180 181 - static int pxa_irq_suspend(void) 181 + static int pxa_irq_suspend(void *data) 182 182 { 183 183 int i; 184 184 ··· 197 197 return 0; 198 198 } 199 199 200 - static void pxa_irq_resume(void) 200 + static void pxa_irq_resume(void *data) 201 201 { 202 202 int i; 203 203 ··· 219 219 #define pxa_irq_resume NULL 220 220 #endif 221 221 222 - struct syscore_ops pxa_irq_syscore_ops = { 222 + static const struct syscore_ops pxa_irq_syscore_ops = { 223 223 .suspend = pxa_irq_suspend, 224 224 .resume = pxa_irq_resume, 225 + }; 226 + 227 + struct syscore pxa_irq_syscore = { 228 + .ops = &pxa_irq_syscore_ops, 225 229 }; 226 230 227 231 #ifdef CONFIG_OF
+7 -3
arch/arm/mach-pxa/mfp-pxa2xx.c
··· 346 346 static unsigned long saved_gplr[4]; 347 347 static unsigned long saved_pgsr[4]; 348 348 349 - static int pxa2xx_mfp_suspend(void) 349 + static int pxa2xx_mfp_suspend(void *data) 350 350 { 351 351 int i; 352 352 ··· 385 385 return 0; 386 386 } 387 387 388 - static void pxa2xx_mfp_resume(void) 388 + static void pxa2xx_mfp_resume(void *data) 389 389 { 390 390 int i; 391 391 ··· 404 404 #define pxa2xx_mfp_resume NULL 405 405 #endif 406 406 407 - struct syscore_ops pxa2xx_mfp_syscore_ops = { 407 + static const struct syscore_ops pxa2xx_mfp_syscore_ops = { 408 408 .suspend = pxa2xx_mfp_suspend, 409 409 .resume = pxa2xx_mfp_resume, 410 + }; 411 + 412 + struct syscore pxa2xx_mfp_syscore = { 413 + .ops = &pxa2xx_mfp_syscore_ops, 410 414 }; 411 415 412 416 static int __init pxa2xx_mfp_init(void)
+7 -3
arch/arm/mach-pxa/mfp-pxa3xx.c
··· 27 27 * a pull-down mode if they're an active low chip select, and we're 28 28 * just entering standby. 29 29 */ 30 - static int pxa3xx_mfp_suspend(void) 30 + static int pxa3xx_mfp_suspend(void *data) 31 31 { 32 32 mfp_config_lpm(); 33 33 return 0; 34 34 } 35 35 36 - static void pxa3xx_mfp_resume(void) 36 + static void pxa3xx_mfp_resume(void *data) 37 37 { 38 38 mfp_config_run(); 39 39 ··· 49 49 #define pxa3xx_mfp_resume NULL 50 50 #endif 51 51 52 - struct syscore_ops pxa3xx_mfp_syscore_ops = { 52 + static const struct syscore_ops pxa3xx_mfp_syscore_ops = { 53 53 .suspend = pxa3xx_mfp_suspend, 54 54 .resume = pxa3xx_mfp_resume, 55 + }; 56 + 57 + struct syscore pxa3xx_mfp_syscore = { 58 + .ops = &pxa3xx_mfp_syscore_ops, 55 59 };
+2 -2
arch/arm/mach-pxa/pxa25x.c
··· 235 235 236 236 pxa25x_init_pm(); 237 237 238 - register_syscore_ops(&pxa_irq_syscore_ops); 239 - register_syscore_ops(&pxa2xx_mfp_syscore_ops); 238 + register_syscore(&pxa_irq_syscore); 239 + register_syscore(&pxa2xx_mfp_syscore); 240 240 241 241 if (!of_have_populated_dt()) { 242 242 software_node_register(&pxa2xx_gpiochip_node);
+2 -2
arch/arm/mach-pxa/pxa27x.c
··· 337 337 338 338 pxa27x_init_pm(); 339 339 340 - register_syscore_ops(&pxa_irq_syscore_ops); 341 - register_syscore_ops(&pxa2xx_mfp_syscore_ops); 340 + register_syscore(&pxa_irq_syscore); 341 + register_syscore(&pxa2xx_mfp_syscore); 342 342 343 343 if (!of_have_populated_dt()) { 344 344 software_node_register(&pxa2xx_gpiochip_node);
+2 -2
arch/arm/mach-pxa/pxa3xx.c
··· 424 424 if (cpu_is_pxa320()) 425 425 enable_irq_wake(IRQ_WAKEUP1); 426 426 427 - register_syscore_ops(&pxa_irq_syscore_ops); 428 - register_syscore_ops(&pxa3xx_mfp_syscore_ops); 427 + register_syscore(&pxa_irq_syscore); 428 + register_syscore(&pxa3xx_mfp_syscore); 429 429 } 430 430 431 431 return ret;
+8 -4
arch/arm/mach-pxa/smemc.c
··· 18 18 static unsigned long sxcnfg, memclkcfg; 19 19 static unsigned long csadrcfg[4]; 20 20 21 - static int pxa3xx_smemc_suspend(void) 21 + static int pxa3xx_smemc_suspend(void *data) 22 22 { 23 23 msc[0] = __raw_readl(MSC0); 24 24 msc[1] = __raw_readl(MSC1); ··· 32 32 return 0; 33 33 } 34 34 35 - static void pxa3xx_smemc_resume(void) 35 + static void pxa3xx_smemc_resume(void *data) 36 36 { 37 37 __raw_writel(msc[0], MSC0); 38 38 __raw_writel(msc[1], MSC1); ··· 46 46 __raw_writel(0x2, CSMSADRCFG); 47 47 } 48 48 49 - static struct syscore_ops smemc_syscore_ops = { 49 + static const struct syscore_ops smemc_syscore_ops = { 50 50 .suspend = pxa3xx_smemc_suspend, 51 51 .resume = pxa3xx_smemc_resume, 52 + }; 53 + 54 + static struct syscore smemc_syscore = { 55 + .ops = &smemc_syscore_ops, 52 56 }; 53 57 54 58 static int __init smemc_init(void) ··· 68 64 */ 69 65 __raw_writel(0x2, CSMSADRCFG); 70 66 71 - register_syscore_ops(&smemc_syscore_ops); 67 + register_syscore(&smemc_syscore); 72 68 } 73 69 74 70 return 0;
+8 -4
arch/arm/mach-s3c/irq-pm-s3c64xx.c
··· 58 58 59 59 static u32 irq_uart_mask[SERIAL_SAMSUNG_UARTS]; 60 60 61 - static int s3c64xx_irq_pm_suspend(void) 61 + static int s3c64xx_irq_pm_suspend(void *data) 62 62 { 63 63 struct irq_grp_save *grp = eint_grp_save; 64 64 int i; ··· 79 79 return 0; 80 80 } 81 81 82 - static void s3c64xx_irq_pm_resume(void) 82 + static void s3c64xx_irq_pm_resume(void *data) 83 83 { 84 84 struct irq_grp_save *grp = eint_grp_save; 85 85 int i; ··· 100 100 S3C_PMDBG("%s: IRQ configuration restored\n", __func__); 101 101 } 102 102 103 - static struct syscore_ops s3c64xx_irq_syscore_ops = { 103 + static const struct syscore_ops s3c64xx_irq_syscore_ops = { 104 104 .suspend = s3c64xx_irq_pm_suspend, 105 105 .resume = s3c64xx_irq_pm_resume, 106 + }; 107 + 108 + static struct syscore s3c64xx_irq_syscore = { 109 + .ops = &s3c64xx_irq_syscore_ops, 106 110 }; 107 111 108 112 static __init int s3c64xx_syscore_init(void) ··· 115 111 if (of_have_populated_dt() || !soc_is_s3c64xx()) 116 112 return 0; 117 113 118 - register_syscore_ops(&s3c64xx_irq_syscore_ops); 114 + register_syscore(&s3c64xx_irq_syscore); 119 115 120 116 return 0; 121 117 }
+7 -3
arch/arm/mach-s5pv210/pm.c
··· 195 195 /* 196 196 * Syscore operations used to delay restore of certain registers. 197 197 */ 198 - static void s5pv210_pm_resume(void) 198 + static void s5pv210_pm_resume(void *data) 199 199 { 200 200 s3c_pm_do_restore_core(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save)); 201 201 } 202 202 203 - static struct syscore_ops s5pv210_pm_syscore_ops = { 203 + static const struct syscore_ops s5pv210_pm_syscore_ops = { 204 204 .resume = s5pv210_pm_resume, 205 + }; 206 + 207 + static struct syscore s5pv210_pm_syscore = { 208 + .ops = &s5pv210_pm_syscore_ops, 205 209 }; 206 210 207 211 /* ··· 213 209 */ 214 210 void __init s5pv210_pm_init(void) 215 211 { 216 - register_syscore_ops(&s5pv210_pm_syscore_ops); 212 + register_syscore(&s5pv210_pm_syscore); 217 213 suspend_set_ops(&s5pv210_suspend_ops); 218 214 }
+8 -4
arch/arm/mach-versatile/integrator_ap.c
··· 63 63 #ifdef CONFIG_PM 64 64 static unsigned long ic_irq_enable; 65 65 66 - static int irq_suspend(void) 66 + static int irq_suspend(void *data) 67 67 { 68 68 ic_irq_enable = readl(VA_IC_BASE + IRQ_ENABLE); 69 69 return 0; 70 70 } 71 71 72 - static void irq_resume(void) 72 + static void irq_resume(void *data) 73 73 { 74 74 /* disable all irq sources */ 75 75 cm_clear_irqs(); ··· 83 83 #define irq_resume NULL 84 84 #endif 85 85 86 - static struct syscore_ops irq_syscore_ops = { 86 + static const struct syscore_ops irq_syscore_ops = { 87 87 .suspend = irq_suspend, 88 88 .resume = irq_resume, 89 89 }; 90 90 91 + static struct syscore irq_syscore = { 92 + .ops = &irq_syscore_ops, 93 + }; 94 + 91 95 static int __init irq_syscore_init(void) 92 96 { 93 - register_syscore_ops(&irq_syscore_ops); 97 + register_syscore(&irq_syscore); 94 98 95 99 return 0; 96 100 }
+8 -4
arch/arm/mm/cache-b15-rac.c
··· 256 256 return 0; 257 257 } 258 258 259 - static int b15_rac_suspend(void) 259 + static int b15_rac_suspend(void *data) 260 260 { 261 261 /* Suspend the read-ahead cache oeprations, forcing our cache 262 262 * implementation to fallback to the regular ARMv7 calls. ··· 271 271 return 0; 272 272 } 273 273 274 - static void b15_rac_resume(void) 274 + static void b15_rac_resume(void *data) 275 275 { 276 276 /* Coming out of a S3 suspend/resume cycle, the read-ahead cache 277 277 * register RAC_CONFIG0_REG will be restored to its default value, make ··· 282 282 clear_bit(RAC_SUSPENDED, &b15_rac_flags); 283 283 } 284 284 285 - static struct syscore_ops b15_rac_syscore_ops = { 285 + static const struct syscore_ops b15_rac_syscore_ops = { 286 286 .suspend = b15_rac_suspend, 287 287 .resume = b15_rac_resume, 288 + }; 289 + 290 + static struct syscore b15_rac_syscore = { 291 + .ops = &b15_rac_syscore_ops, 288 292 }; 289 293 290 294 static int __init b15_rac_init(void) ··· 351 347 } 352 348 353 349 if (IS_ENABLED(CONFIG_PM_SLEEP)) 354 - register_syscore_ops(&b15_rac_syscore_ops); 350 + register_syscore(&b15_rac_syscore); 355 351 356 352 spin_lock(&rac_lock); 357 353 reg = __raw_readl(b15_rac_base + RAC_CONFIG0_REG);
+8 -4
arch/loongarch/kernel/smp.c
··· 535 535 */ 536 536 #ifdef CONFIG_PM 537 537 538 - static int loongson_ipi_suspend(void) 538 + static int loongson_ipi_suspend(void *data) 539 539 { 540 540 return 0; 541 541 } 542 542 543 - static void loongson_ipi_resume(void) 543 + static void loongson_ipi_resume(void *data) 544 544 { 545 545 iocsr_write32(0xffffffff, LOONGARCH_IOCSR_IPI_EN); 546 546 } 547 547 548 - static struct syscore_ops loongson_ipi_syscore_ops = { 548 + static const struct syscore_ops loongson_ipi_syscore_ops = { 549 549 .resume = loongson_ipi_resume, 550 550 .suspend = loongson_ipi_suspend, 551 + }; 552 + 553 + static struct syscore loongson_ipi_syscore = { 554 + .ops = &loongson_ipi_syscore_ops, 551 555 }; 552 556 553 557 /* ··· 560 556 */ 561 557 static int __init ipi_pm_init(void) 562 558 { 563 - register_syscore_ops(&loongson_ipi_syscore_ops); 559 + register_syscore(&loongson_ipi_syscore); 564 560 return 0; 565 561 } 566 562
+8 -4
arch/mips/alchemy/common/dbdma.c
··· 982 982 983 983 static unsigned long alchemy_dbdma_pm_data[NUM_DBDMA_CHANS + 1][6]; 984 984 985 - static int alchemy_dbdma_suspend(void) 985 + static int alchemy_dbdma_suspend(void *data) 986 986 { 987 987 int i; 988 988 void __iomem *addr; ··· 1019 1019 return 0; 1020 1020 } 1021 1021 1022 - static void alchemy_dbdma_resume(void) 1022 + static void alchemy_dbdma_resume(void *data) 1023 1023 { 1024 1024 int i; 1025 1025 void __iomem *addr; ··· 1044 1044 } 1045 1045 } 1046 1046 1047 - static struct syscore_ops alchemy_dbdma_syscore_ops = { 1047 + static const struct syscore_ops alchemy_dbdma_syscore_ops = { 1048 1048 .suspend = alchemy_dbdma_suspend, 1049 1049 .resume = alchemy_dbdma_resume, 1050 + }; 1051 + 1052 + static struct syscore alchemy_dbdma_syscore = { 1053 + .ops = &alchemy_dbdma_syscore_ops, 1050 1054 }; 1051 1055 1052 1056 static int __init dbdma_setup(unsigned int irq, dbdev_tab_t *idtable) ··· 1075 1071 printk(KERN_ERR "Cannot grab DBDMA interrupt!\n"); 1076 1072 else { 1077 1073 dbdma_initialized = 1; 1078 - register_syscore_ops(&alchemy_dbdma_syscore_ops); 1074 + register_syscore(&alchemy_dbdma_syscore); 1079 1075 } 1080 1076 1081 1077 return ret;
+16 -8
arch/mips/alchemy/common/irq.c
··· 758 758 wmb(); 759 759 } 760 760 761 - static int alchemy_ic_suspend(void) 761 + static int alchemy_ic_suspend(void *data) 762 762 { 763 763 alchemy_ic_suspend_one((void __iomem *)KSEG1ADDR(AU1000_IC0_PHYS_ADDR), 764 764 alchemy_gpic_pmdata); ··· 767 767 return 0; 768 768 } 769 769 770 - static void alchemy_ic_resume(void) 770 + static void alchemy_ic_resume(void *data) 771 771 { 772 772 alchemy_ic_resume_one((void __iomem *)KSEG1ADDR(AU1000_IC1_PHYS_ADDR), 773 773 &alchemy_gpic_pmdata[7]); ··· 775 775 alchemy_gpic_pmdata); 776 776 } 777 777 778 - static int alchemy_gpic_suspend(void) 778 + static int alchemy_gpic_suspend(void *data) 779 779 { 780 780 void __iomem *base = (void __iomem *)KSEG1ADDR(AU1300_GPIC_PHYS_ADDR); 781 781 int i; ··· 806 806 return 0; 807 807 } 808 808 809 - static void alchemy_gpic_resume(void) 809 + static void alchemy_gpic_resume(void *data) 810 810 { 811 811 void __iomem *base = (void __iomem *)KSEG1ADDR(AU1300_GPIC_PHYS_ADDR); 812 812 int i; ··· 837 837 wmb(); 838 838 } 839 839 840 - static struct syscore_ops alchemy_ic_pmops = { 840 + static const struct syscore_ops alchemy_ic_pmops = { 841 841 .suspend = alchemy_ic_suspend, 842 842 .resume = alchemy_ic_resume, 843 843 }; 844 844 845 - static struct syscore_ops alchemy_gpic_pmops = { 845 + static struct syscore alchemy_ic_pm = { 846 + .ops = &alchemy_ic_pmops, 847 + }; 848 + 849 + static const struct syscore_ops alchemy_gpic_pmops = { 846 850 .suspend = alchemy_gpic_suspend, 847 851 .resume = alchemy_gpic_resume, 852 + }; 853 + 854 + static struct syscore alchemy_gpic_pm = { 855 + .ops = &alchemy_gpic_pmops, 848 856 }; 849 857 850 858 /******************************************************************************/ ··· 888 880 889 881 ic_init((void __iomem *)KSEG1ADDR(AU1000_IC0_PHYS_ADDR)); 890 882 ic_init((void __iomem *)KSEG1ADDR(AU1000_IC1_PHYS_ADDR)); 891 - register_syscore_ops(&alchemy_ic_pmops); 883 + register_syscore(&alchemy_ic_pm); 892 884 mips_cpu_irq_init(); 893 885 894 886 /* register all 64 possible IC0+IC1 irq sources as type "none". ··· 933 925 int i; 934 926 void __iomem *bank_base; 935 927 936 - register_syscore_ops(&alchemy_gpic_pmops); 928 + register_syscore(&alchemy_gpic_pm); 937 929 mips_cpu_irq_init(); 938 930 939 931 /* disable & ack all possible interrupt sources */
+8 -4
arch/mips/alchemy/common/usb.c
··· 580 580 } 581 581 } 582 582 583 - static int alchemy_usb_suspend(void) 583 + static int alchemy_usb_suspend(void *data) 584 584 { 585 585 alchemy_usb_pm(1); 586 586 return 0; 587 587 } 588 588 589 - static void alchemy_usb_resume(void) 589 + static void alchemy_usb_resume(void *data) 590 590 { 591 591 alchemy_usb_pm(0); 592 592 } 593 593 594 - static struct syscore_ops alchemy_usb_pm_ops = { 594 + static const struct syscore_ops alchemy_usb_pm_syscore_ops = { 595 595 .suspend = alchemy_usb_suspend, 596 596 .resume = alchemy_usb_resume, 597 + }; 598 + 599 + static struct syscore alchemy_usb_pm_syscore = { 600 + .ops = &alchemy_usb_pm_syscore_ops, 597 601 }; 598 602 599 603 static int __init alchemy_usb_init(void) ··· 624 620 } 625 621 626 622 if (!ret) 627 - register_syscore_ops(&alchemy_usb_pm_ops); 623 + register_syscore(&alchemy_usb_pm_syscore); 628 624 629 625 return ret; 630 626 }
+10 -6
arch/mips/pci/pci-alchemy.c
··· 304 304 } 305 305 306 306 /* save PCI controller register contents. */ 307 - static int alchemy_pci_suspend(void) 307 + static int alchemy_pci_suspend(void *data) 308 308 { 309 309 struct alchemy_pci_context *ctx = __alchemy_pci_ctx; 310 310 if (!ctx) ··· 326 326 return 0; 327 327 } 328 328 329 - static void alchemy_pci_resume(void) 329 + static void alchemy_pci_resume(void *data) 330 330 { 331 331 struct alchemy_pci_context *ctx = __alchemy_pci_ctx; 332 332 if (!ctx) ··· 354 354 alchemy_pci_wired_entry(ctx); /* install it */ 355 355 } 356 356 357 - static struct syscore_ops alchemy_pci_pmops = { 358 - .suspend = alchemy_pci_suspend, 359 - .resume = alchemy_pci_resume, 357 + static const struct syscore_ops alchemy_pci_syscore_ops = { 358 + .suspend = alchemy_pci_suspend, 359 + .resume = alchemy_pci_resume, 360 + }; 361 + 362 + static struct syscore alchemy_pci_syscore = { 363 + .ops = &alchemy_pci_syscore_ops, 360 364 }; 361 365 362 366 static int alchemy_pci_probe(struct platform_device *pdev) ··· 482 478 483 479 __alchemy_pci_ctx = ctx; 484 480 platform_set_drvdata(pdev, ctx); 485 - register_syscore_ops(&alchemy_pci_pmops); 481 + register_syscore(&alchemy_pci_syscore); 486 482 register_pci_controller(&ctx->alchemy_pci_ctrl); 487 483 488 484 dev_info(&pdev->dev, "PCI controller at %ld MHz\n",
+7 -3
arch/powerpc/platforms/cell/spu_base.c
··· 726 726 } 727 727 #endif 728 728 729 - static void spu_shutdown(void) 729 + static void spu_shutdown(void *data) 730 730 { 731 731 struct spu *spu; 732 732 ··· 738 738 mutex_unlock(&spu_full_list_mutex); 739 739 } 740 740 741 - static struct syscore_ops spu_syscore_ops = { 741 + static const struct syscore_ops spu_syscore_ops = { 742 742 .shutdown = spu_shutdown, 743 + }; 744 + 745 + static struct syscore spu_syscore = { 746 + .ops = &spu_syscore_ops, 743 747 }; 744 748 745 749 static int __init init_spu_base(void) ··· 778 774 crash_register_spus(&spu_full_list); 779 775 mutex_unlock(&spu_full_list_mutex); 780 776 spu_add_dev_attr(&dev_attr_stat); 781 - register_syscore_ops(&spu_syscore_ops); 777 + register_syscore(&spu_syscore); 782 778 783 779 spu_init_affinity(); 784 780
+8 -4
arch/powerpc/platforms/powermac/pic.c
··· 600 600 return viaint; 601 601 } 602 602 603 - static int pmacpic_suspend(void) 603 + static int pmacpic_suspend(void *data) 604 604 { 605 605 int viaint = pmacpic_find_viaint(); 606 606 ··· 621 621 return 0; 622 622 } 623 623 624 - static void pmacpic_resume(void) 624 + static void pmacpic_resume(void *data) 625 625 { 626 626 int i; 627 627 ··· 634 634 pmac_unmask_irq(irq_get_irq_data(i)); 635 635 } 636 636 637 - static struct syscore_ops pmacpic_syscore_ops = { 637 + static const struct syscore_ops pmacpic_syscore_ops = { 638 638 .suspend = pmacpic_suspend, 639 639 .resume = pmacpic_resume, 640 + }; 641 + 642 + static struct syscore pmacpic_syscore = { 643 + .ops = &pmacpic_syscore_ops, 640 644 }; 641 645 642 646 static int __init init_pmacpic_syscore(void) 643 647 { 644 648 if (pmac_irq_hw[0]) 645 - register_syscore_ops(&pmacpic_syscore_ops); 649 + register_syscore(&pmacpic_syscore); 646 650 return 0; 647 651 } 648 652
+8 -4
arch/powerpc/sysdev/fsl_lbc.c
··· 350 350 #ifdef CONFIG_SUSPEND 351 351 352 352 /* save lbc registers */ 353 - static int fsl_lbc_syscore_suspend(void) 353 + static int fsl_lbc_syscore_suspend(void *data) 354 354 { 355 355 struct fsl_lbc_ctrl *ctrl; 356 356 struct fsl_lbc_regs __iomem *lbc; ··· 374 374 } 375 375 376 376 /* restore lbc registers */ 377 - static void fsl_lbc_syscore_resume(void) 377 + static void fsl_lbc_syscore_resume(void *data) 378 378 { 379 379 struct fsl_lbc_ctrl *ctrl; 380 380 struct fsl_lbc_regs __iomem *lbc; ··· 408 408 }; 409 409 410 410 #ifdef CONFIG_SUSPEND 411 - static struct syscore_ops lbc_syscore_pm_ops = { 411 + static const struct syscore_ops lbc_syscore_pm_ops = { 412 412 .suspend = fsl_lbc_syscore_suspend, 413 413 .resume = fsl_lbc_syscore_resume, 414 + }; 415 + 416 + static struct syscore lbc_syscore_pm = { 417 + .ops = &lbc_syscore_pm_ops, 414 418 }; 415 419 #endif 416 420 ··· 429 425 static int __init fsl_lbc_init(void) 430 426 { 431 427 #ifdef CONFIG_SUSPEND 432 - register_syscore_ops(&lbc_syscore_pm_ops); 428 + register_syscore(&lbc_syscore_pm); 433 429 #endif 434 430 return platform_driver_register(&fsl_lbc_ctrl_driver); 435 431 }
+8 -4
arch/powerpc/sysdev/fsl_pci.c
··· 1258 1258 send_pme_turnoff_message(hose); 1259 1259 } 1260 1260 1261 - static int fsl_pci_syscore_suspend(void) 1261 + static int fsl_pci_syscore_suspend(void *data) 1262 1262 { 1263 1263 struct pci_controller *hose, *tmp; 1264 1264 ··· 1291 1291 setup_pci_atmu(hose); 1292 1292 } 1293 1293 1294 - static void fsl_pci_syscore_resume(void) 1294 + static void fsl_pci_syscore_resume(void *data) 1295 1295 { 1296 1296 struct pci_controller *hose, *tmp; 1297 1297 ··· 1299 1299 fsl_pci_syscore_do_resume(hose); 1300 1300 } 1301 1301 1302 - static struct syscore_ops pci_syscore_pm_ops = { 1302 + static const struct syscore_ops pci_syscore_pm_ops = { 1303 1303 .suspend = fsl_pci_syscore_suspend, 1304 1304 .resume = fsl_pci_syscore_resume, 1305 + }; 1306 + 1307 + static struct syscore pci_syscore_pm = { 1308 + .ops = &pci_syscore_pm_ops, 1305 1309 }; 1306 1310 #endif 1307 1311 ··· 1363 1359 static int __init fsl_pci_init(void) 1364 1360 { 1365 1361 #ifdef CONFIG_PM_SLEEP 1366 - register_syscore_ops(&pci_syscore_pm_ops); 1362 + register_syscore(&pci_syscore_pm); 1367 1363 #endif 1368 1364 return platform_driver_register(&fsl_pci_driver); 1369 1365 }
+8 -4
arch/powerpc/sysdev/ipic.c
··· 817 817 u32 sercr; 818 818 } ipic_saved_state; 819 819 820 - static int ipic_suspend(void) 820 + static int ipic_suspend(void *data) 821 821 { 822 822 struct ipic *ipic = primary_ipic; 823 823 ··· 848 848 return 0; 849 849 } 850 850 851 - static void ipic_resume(void) 851 + static void ipic_resume(void *data) 852 852 { 853 853 struct ipic *ipic = primary_ipic; 854 854 ··· 870 870 #define ipic_resume NULL 871 871 #endif 872 872 873 - static struct syscore_ops ipic_syscore_ops = { 873 + static const struct syscore_ops ipic_syscore_ops = { 874 874 .suspend = ipic_suspend, 875 875 .resume = ipic_resume, 876 + }; 877 + 878 + static struct syscore ipic_syscore = { 879 + .ops = &ipic_syscore_ops, 876 880 }; 877 881 878 882 static int __init init_ipic_syscore(void) ··· 885 881 return -ENODEV; 886 882 887 883 printk(KERN_DEBUG "Registering ipic system core operations\n"); 888 - register_syscore_ops(&ipic_syscore_ops); 884 + register_syscore(&ipic_syscore); 889 885 890 886 return 0; 891 887 }
+9 -5
arch/powerpc/sysdev/mpic.c
··· 1944 1944 } 1945 1945 } 1946 1946 1947 - static int mpic_suspend(void) 1947 + static int mpic_suspend(void *data) 1948 1948 { 1949 1949 struct mpic *mpic = mpics; 1950 1950 ··· 1986 1986 } /* end for loop */ 1987 1987 } 1988 1988 1989 - static void mpic_resume(void) 1989 + static void mpic_resume(void *data) 1990 1990 { 1991 1991 struct mpic *mpic = mpics; 1992 1992 ··· 1996 1996 } 1997 1997 } 1998 1998 1999 - static struct syscore_ops mpic_syscore_ops = { 1999 + static const struct syscore_ops mpic_syscore_ops = { 2000 2000 .resume = mpic_resume, 2001 2001 .suspend = mpic_suspend, 2002 + }; 2003 + 2004 + static struct syscore mpic_syscore = { 2005 + .ops = &mpic_syscore_ops, 2002 2006 }; 2003 2007 2004 2008 static int mpic_init_sys(void) 2005 2009 { 2006 2010 int rc; 2007 2011 2008 - register_syscore_ops(&mpic_syscore_ops); 2012 + register_syscore(&mpic_syscore); 2009 2013 rc = subsys_system_register(&mpic_subsys, NULL); 2010 2014 if (rc) { 2011 - unregister_syscore_ops(&mpic_syscore_ops); 2015 + unregister_syscore(&mpic_syscore); 2012 2016 pr_err("mpic: Failed to register subsystem!\n"); 2013 2017 return rc; 2014 2018 }
+7 -3
arch/powerpc/sysdev/mpic_timer.c
··· 519 519 kfree(priv); 520 520 } 521 521 522 - static void mpic_timer_resume(void) 522 + static void mpic_timer_resume(void *data) 523 523 { 524 524 struct timer_group_priv *priv; 525 525 ··· 535 535 {}, 536 536 }; 537 537 538 - static struct syscore_ops mpic_timer_syscore_ops = { 538 + static const struct syscore_ops mpic_timer_syscore_ops = { 539 539 .resume = mpic_timer_resume, 540 + }; 541 + 542 + static struct syscore mpic_timer_syscore = { 543 + .ops = &mpic_timer_syscore_ops, 540 544 }; 541 545 542 546 static int __init mpic_timer_init(void) ··· 550 546 for_each_matching_node(np, mpic_timer_ids) 551 547 timer_group_init(np); 552 548 553 - register_syscore_ops(&mpic_timer_syscore_ops); 549 + register_syscore(&mpic_timer_syscore); 554 550 555 551 if (list_empty(&timer_group_list)) 556 552 return -ENODEV;
+7 -3
arch/sh/mm/pmb.c
··· 857 857 subsys_initcall(pmb_debugfs_init); 858 858 859 859 #ifdef CONFIG_PM 860 - static void pmb_syscore_resume(void) 860 + static void pmb_syscore_resume(void *data) 861 861 { 862 862 struct pmb_entry *pmbe; 863 863 int i; ··· 874 874 read_unlock(&pmb_rwlock); 875 875 } 876 876 877 - static struct syscore_ops pmb_syscore_ops = { 877 + static const struct syscore_ops pmb_syscore_ops = { 878 878 .resume = pmb_syscore_resume, 879 + }; 880 + 881 + static struct syscore pmb_syscore = { 882 + .ops = &pmb_syscore_ops, 879 883 }; 880 884 881 885 static int __init pmb_sysdev_init(void) 882 886 { 883 - register_syscore_ops(&pmb_syscore_ops); 887 + register_syscore(&pmb_syscore); 884 888 return 0; 885 889 } 886 890 subsys_initcall(pmb_sysdev_init);
+8 -4
arch/x86/events/amd/ibs.c
··· 1718 1718 1719 1719 #ifdef CONFIG_PM 1720 1720 1721 - static int perf_ibs_suspend(void) 1721 + static int perf_ibs_suspend(void *data) 1722 1722 { 1723 1723 clear_APIC_ibs(); 1724 1724 return 0; 1725 1725 } 1726 1726 1727 - static void perf_ibs_resume(void) 1727 + static void perf_ibs_resume(void *data) 1728 1728 { 1729 1729 ibs_eilvt_setup(); 1730 1730 setup_APIC_ibs(); 1731 1731 } 1732 1732 1733 - static struct syscore_ops perf_ibs_syscore_ops = { 1733 + static const struct syscore_ops perf_ibs_syscore_ops = { 1734 1734 .resume = perf_ibs_resume, 1735 1735 .suspend = perf_ibs_suspend, 1736 1736 }; 1737 1737 1738 + static struct syscore perf_ibs_syscore = { 1739 + .ops = &perf_ibs_syscore_ops, 1740 + }; 1741 + 1738 1742 static void perf_ibs_pm_init(void) 1739 1743 { 1740 - register_syscore_ops(&perf_ibs_syscore_ops); 1744 + register_syscore(&perf_ibs_syscore); 1741 1745 } 1742 1746 1743 1747 #else
+8 -4
arch/x86/hyperv/hv_init.c
··· 351 351 return 1; 352 352 } 353 353 354 - static int hv_suspend(void) 354 + static int hv_suspend(void *data) 355 355 { 356 356 union hv_x64_msr_hypercall_contents hypercall_msr; 357 357 int ret; ··· 378 378 return ret; 379 379 } 380 380 381 - static void hv_resume(void) 381 + static void hv_resume(void *data) 382 382 { 383 383 union hv_x64_msr_hypercall_contents hypercall_msr; 384 384 int ret; ··· 405 405 } 406 406 407 407 /* Note: when the ops are called, only CPU0 is online and IRQs are disabled. */ 408 - static struct syscore_ops hv_syscore_ops = { 408 + static const struct syscore_ops hv_syscore_ops = { 409 409 .suspend = hv_suspend, 410 410 .resume = hv_resume, 411 + }; 412 + 413 + static struct syscore hv_syscore = { 414 + .ops = &hv_syscore_ops, 411 415 }; 412 416 413 417 static void (* __initdata old_setup_percpu_clockev)(void); ··· 573 569 574 570 x86_init.pci.arch_init = hv_pci_init; 575 571 576 - register_syscore_ops(&hv_syscore_ops); 572 + register_syscore(&hv_syscore); 577 573 578 574 if (ms_hyperv.priv_high & HV_ACCESS_PARTITION_ID) 579 575 hv_get_partition_id();
+7 -3
arch/x86/kernel/amd_gart_64.c
··· 591 591 } 592 592 } 593 593 594 - static void gart_resume(void) 594 + static void gart_resume(void *data) 595 595 { 596 596 pr_info("PCI-DMA: Resuming GART IOMMU\n"); 597 597 ··· 600 600 enable_gart_translations(); 601 601 } 602 602 603 - static struct syscore_ops gart_syscore_ops = { 603 + static const struct syscore_ops gart_syscore_ops = { 604 604 .resume = gart_resume, 605 605 606 + }; 607 + 608 + static struct syscore gart_syscore = { 609 + .ops = &gart_syscore_ops, 606 610 }; 607 611 608 612 /* ··· 654 650 655 651 agp_gatt_table = gatt; 656 652 657 - register_syscore_ops(&gart_syscore_ops); 653 + register_syscore(&gart_syscore); 658 654 659 655 flush_gart(); 660 656
+8 -4
arch/x86/kernel/apic/apic.c
··· 2381 2381 unsigned int apic_cmci; 2382 2382 } apic_pm_state; 2383 2383 2384 - static int lapic_suspend(void) 2384 + static int lapic_suspend(void *data) 2385 2385 { 2386 2386 unsigned long flags; 2387 2387 int maxlvt; ··· 2429 2429 return 0; 2430 2430 } 2431 2431 2432 - static void lapic_resume(void) 2432 + static void lapic_resume(void *data) 2433 2433 { 2434 2434 unsigned int l, h; 2435 2435 unsigned long flags; ··· 2504 2504 * are needed on every CPU up until machine_halt/restart/poweroff. 2505 2505 */ 2506 2506 2507 - static struct syscore_ops lapic_syscore_ops = { 2507 + static const struct syscore_ops lapic_syscore_ops = { 2508 2508 .resume = lapic_resume, 2509 2509 .suspend = lapic_suspend, 2510 + }; 2511 + 2512 + static struct syscore lapic_syscore = { 2513 + .ops = &lapic_syscore_ops, 2510 2514 }; 2511 2515 2512 2516 static void apic_pm_activate(void) ··· 2522 2518 { 2523 2519 /* XXX: remove suspend/resume procs if !apic_pm_state.active? */ 2524 2520 if (boot_cpu_has(X86_FEATURE_APIC)) 2525 - register_syscore_ops(&lapic_syscore_ops); 2521 + register_syscore(&lapic_syscore); 2526 2522 2527 2523 return 0; 2528 2524 }
+13 -4
arch/x86/kernel/apic/io_apic.c
··· 2308 2308 } 2309 2309 } 2310 2310 2311 - static void ioapic_resume(void) 2311 + static int ioapic_suspend(void *data) 2312 + { 2313 + return save_ioapic_entries(); 2314 + } 2315 + 2316 + static void ioapic_resume(void *data) 2312 2317 { 2313 2318 int ioapic_idx; 2314 2319 ··· 2323 2318 restore_ioapic_entries(); 2324 2319 } 2325 2320 2326 - static struct syscore_ops ioapic_syscore_ops = { 2327 - .suspend = save_ioapic_entries, 2321 + static const struct syscore_ops ioapic_syscore_ops = { 2322 + .suspend = ioapic_suspend, 2328 2323 .resume = ioapic_resume, 2324 + }; 2325 + 2326 + static struct syscore ioapic_syscore = { 2327 + .ops = &ioapic_syscore_ops, 2329 2328 }; 2330 2329 2331 2330 static int __init ioapic_init_ops(void) 2332 2331 { 2333 - register_syscore_ops(&ioapic_syscore_ops); 2332 + register_syscore(&ioapic_syscore); 2334 2333 2335 2334 return 0; 2336 2335 }
+12 -8
arch/x86/kernel/cpu/aperfmperf.c
··· 37 37 .seq = SEQCNT_ZERO(cpu_samples.seq) 38 38 }; 39 39 40 - static void init_counter_refs(void) 40 + static void init_counter_refs(void *data) 41 41 { 42 42 u64 aperf, mperf; 43 43 ··· 289 289 } 290 290 291 291 #ifdef CONFIG_PM_SLEEP 292 - static struct syscore_ops freq_invariance_syscore_ops = { 292 + static const struct syscore_ops freq_invariance_syscore_ops = { 293 293 .resume = init_counter_refs, 294 294 }; 295 295 296 - static void register_freq_invariance_syscore_ops(void) 296 + static struct syscore freq_invariance_syscore = { 297 + .ops = &freq_invariance_syscore_ops, 298 + }; 299 + 300 + static void register_freq_invariance_syscore(void) 297 301 { 298 - register_syscore_ops(&freq_invariance_syscore_ops); 302 + register_syscore(&freq_invariance_syscore); 299 303 } 300 304 #else 301 - static inline void register_freq_invariance_syscore_ops(void) {} 305 + static inline void register_freq_invariance_syscore(void) {} 302 306 #endif 303 307 304 308 static void freq_invariance_enable(void) ··· 312 308 return; 313 309 } 314 310 static_branch_enable_cpuslocked(&arch_scale_freq_key); 315 - register_freq_invariance_syscore_ops(); 311 + register_freq_invariance_syscore(); 316 312 pr_info("Estimated ratio of average max frequency by base frequency (times 1024): %llu\n", arch_max_freq_ratio); 317 313 } 318 314 ··· 539 535 if (!cpu_feature_enabled(X86_FEATURE_APERFMPERF)) 540 536 return 0; 541 537 542 - init_counter_refs(); 538 + init_counter_refs(NULL); 543 539 bp_init_freq_invariance(); 544 540 return 0; 545 541 } ··· 548 544 void ap_init_aperfmperf(void) 549 545 { 550 546 if (cpu_feature_enabled(X86_FEATURE_APERFMPERF)) 551 - init_counter_refs(); 547 + init_counter_refs(NULL); 552 548 }
+10 -6
arch/x86/kernel/cpu/intel_epb.c
··· 75 75 [EPB_INDEX_POWERSAVE] = ENERGY_PERF_BIAS_POWERSAVE, 76 76 }; 77 77 78 - static int intel_epb_save(void) 78 + static int intel_epb_save(void *data) 79 79 { 80 80 u64 epb; 81 81 ··· 89 89 return 0; 90 90 } 91 91 92 - static void intel_epb_restore(void) 92 + static void intel_epb_restore(void *data) 93 93 { 94 94 u64 val = this_cpu_read(saved_epb); 95 95 u64 epb; ··· 114 114 wrmsrq(MSR_IA32_ENERGY_PERF_BIAS, (epb & ~EPB_MASK) | val); 115 115 } 116 116 117 - static struct syscore_ops intel_epb_syscore_ops = { 117 + static const struct syscore_ops intel_epb_syscore_ops = { 118 118 .suspend = intel_epb_save, 119 119 .resume = intel_epb_restore, 120 + }; 121 + 122 + static struct syscore intel_epb_syscore = { 123 + .ops = &intel_epb_syscore_ops, 120 124 }; 121 125 122 126 static const char * const energy_perf_strings[] = { ··· 189 185 { 190 186 struct device *cpu_dev = get_cpu_device(cpu); 191 187 192 - intel_epb_restore(); 188 + intel_epb_restore(NULL); 193 189 if (!cpuhp_tasks_frozen) 194 190 sysfs_merge_group(&cpu_dev->kobj, &intel_epb_attr_group); 195 191 ··· 203 199 if (!cpuhp_tasks_frozen) 204 200 sysfs_unmerge_group(&cpu_dev->kobj, &intel_epb_attr_group); 205 201 206 - intel_epb_save(); 202 + intel_epb_save(NULL); 207 203 return 0; 208 204 } 209 205 ··· 234 230 if (ret < 0) 235 231 goto err_out_online; 236 232 237 - register_syscore_ops(&intel_epb_syscore_ops); 233 + register_syscore(&intel_epb_syscore); 238 234 return 0; 239 235 240 236 err_out_online:
+9 -5
arch/x86/kernel/cpu/mce/core.c
··· 2410 2410 mce_disable_error_reporting(); 2411 2411 } 2412 2412 2413 - static int mce_syscore_suspend(void) 2413 + static int mce_syscore_suspend(void *data) 2414 2414 { 2415 2415 vendor_disable_error_reporting(); 2416 2416 return 0; 2417 2417 } 2418 2418 2419 - static void mce_syscore_shutdown(void) 2419 + static void mce_syscore_shutdown(void *data) 2420 2420 { 2421 2421 vendor_disable_error_reporting(); 2422 2422 } ··· 2426 2426 * Only one CPU is active at this time, the others get re-added later using 2427 2427 * CPU hotplug: 2428 2428 */ 2429 - static void mce_syscore_resume(void) 2429 + static void mce_syscore_resume(void *data) 2430 2430 { 2431 2431 __mcheck_cpu_init_generic(); 2432 2432 __mcheck_cpu_init_vendor(raw_cpu_ptr(&cpu_info)); ··· 2434 2434 cr4_set_bits(X86_CR4_MCE); 2435 2435 } 2436 2436 2437 - static struct syscore_ops mce_syscore_ops = { 2437 + static const struct syscore_ops mce_syscore_ops = { 2438 2438 .suspend = mce_syscore_suspend, 2439 2439 .shutdown = mce_syscore_shutdown, 2440 2440 .resume = mce_syscore_resume, 2441 + }; 2442 + 2443 + static struct syscore mce_syscore = { 2444 + .ops = &mce_syscore_ops, 2441 2445 }; 2442 2446 2443 2447 /* ··· 2844 2840 if (err < 0) 2845 2841 goto err_out_online; 2846 2842 2847 - register_syscore_ops(&mce_syscore_ops); 2843 + register_syscore(&mce_syscore); 2848 2844 2849 2845 return 0; 2850 2846
+12 -3
arch/x86/kernel/cpu/microcode/core.c
··· 812 812 reload_early_microcode(cpu); 813 813 } 814 814 815 - static struct syscore_ops mc_syscore_ops = { 816 - .resume = microcode_bsp_resume, 815 + static void microcode_bsp_syscore_resume(void *data) 816 + { 817 + microcode_bsp_resume(); 818 + } 819 + 820 + static const struct syscore_ops mc_syscore_ops = { 821 + .resume = microcode_bsp_syscore_resume, 822 + }; 823 + 824 + static struct syscore mc_syscore = { 825 + .ops = &mc_syscore_ops, 817 826 }; 818 827 819 828 static int mc_cpu_online(unsigned int cpu) ··· 901 892 } 902 893 } 903 894 904 - register_syscore_ops(&mc_syscore_ops); 895 + register_syscore(&mc_syscore); 905 896 cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "x86/microcode:online", 906 897 mc_cpu_online, mc_cpu_down_prep); 907 898
+8 -4
arch/x86/kernel/cpu/mtrr/legacy.c
··· 41 41 42 42 static struct mtrr_value *mtrr_value; 43 43 44 - static int mtrr_save(void) 44 + static int mtrr_save(void *data) 45 45 { 46 46 int i; 47 47 ··· 56 56 return 0; 57 57 } 58 58 59 - static void mtrr_restore(void) 59 + static void mtrr_restore(void *data) 60 60 { 61 61 int i; 62 62 ··· 69 69 } 70 70 } 71 71 72 - static struct syscore_ops mtrr_syscore_ops = { 72 + static const struct syscore_ops mtrr_syscore_ops = { 73 73 .suspend = mtrr_save, 74 74 .resume = mtrr_restore, 75 + }; 76 + 77 + static struct syscore mtrr_syscore = { 78 + .ops = &mtrr_syscore_ops, 75 79 }; 76 80 77 81 void mtrr_register_syscore(void) ··· 90 86 * TBD: is there any system with such CPU which supports 91 87 * suspend/resume? If no, we should remove the code. 92 88 */ 93 - register_syscore_ops(&mtrr_syscore_ops); 89 + register_syscore(&mtrr_syscore); 94 90 }
+7 -3
arch/x86/kernel/cpu/umwait.c
··· 86 86 * trust the firmware nor does it matter if the same value is written 87 87 * again. 88 88 */ 89 - static void umwait_syscore_resume(void) 89 + static void umwait_syscore_resume(void *data) 90 90 { 91 91 umwait_update_control_msr(NULL); 92 92 } 93 93 94 - static struct syscore_ops umwait_syscore_ops = { 94 + static const struct syscore_ops umwait_syscore_ops = { 95 95 .resume = umwait_syscore_resume, 96 + }; 97 + 98 + static struct syscore umwait_syscore = { 99 + .ops = &umwait_syscore_ops, 96 100 }; 97 101 98 102 /* sysfs interface */ ··· 230 226 return ret; 231 227 } 232 228 233 - register_syscore_ops(&umwait_syscore_ops); 229 + register_syscore(&umwait_syscore); 234 230 235 231 /* 236 232 * Add umwait control interface. Ignore failure, so at least the
+7 -3
arch/x86/kernel/i8237.c
··· 19 19 * in asm/dma.h. 20 20 */ 21 21 22 - static void i8237A_resume(void) 22 + static void i8237A_resume(void *data) 23 23 { 24 24 unsigned long flags; 25 25 int i; ··· 41 41 release_dma_lock(flags); 42 42 } 43 43 44 - static struct syscore_ops i8237_syscore_ops = { 44 + static const struct syscore_ops i8237_syscore_ops = { 45 45 .resume = i8237A_resume, 46 + }; 47 + 48 + static struct syscore i8237_syscore = { 49 + .ops = &i8237_syscore_ops, 46 50 }; 47 51 48 52 static int __init i8237A_init_ops(void) ··· 74 70 if (x86_pnpbios_disabled() && dmi_get_bios_year() >= 2017) 75 71 return -ENODEV; 76 72 77 - register_syscore_ops(&i8237_syscore_ops); 73 + register_syscore(&i8237_syscore); 78 74 return 0; 79 75 } 80 76 device_initcall(i8237A_init_ops);
+9 -5
arch/x86/kernel/i8259.c
··· 247 247 trigger[1] = inb(PIC_ELCR2) & 0xDE; 248 248 } 249 249 250 - static void i8259A_resume(void) 250 + static void i8259A_resume(void *data) 251 251 { 252 252 init_8259A(i8259A_auto_eoi); 253 253 restore_ELCR(irq_trigger); 254 254 } 255 255 256 - static int i8259A_suspend(void) 256 + static int i8259A_suspend(void *data) 257 257 { 258 258 save_ELCR(irq_trigger); 259 259 return 0; 260 260 } 261 261 262 - static void i8259A_shutdown(void) 262 + static void i8259A_shutdown(void *data) 263 263 { 264 264 /* Put the i8259A into a quiescent state that 265 265 * the kernel initialization code can get it ··· 269 269 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */ 270 270 } 271 271 272 - static struct syscore_ops i8259_syscore_ops = { 272 + static const struct syscore_ops i8259_syscore_ops = { 273 273 .suspend = i8259A_suspend, 274 274 .resume = i8259A_resume, 275 275 .shutdown = i8259A_shutdown, 276 + }; 277 + 278 + static struct syscore i8259_syscore = { 279 + .ops = &i8259_syscore_ops, 276 280 }; 277 281 278 282 static void mask_8259A(void) ··· 448 444 static int __init i8259A_init_ops(void) 449 445 { 450 446 if (legacy_pic == &default_legacy_pic) 451 - register_syscore_ops(&i8259_syscore_ops); 447 + register_syscore(&i8259_syscore); 452 448 453 449 return 0; 454 450 }
+8 -4
arch/x86/kernel/kvm.c
··· 720 720 721 721 #endif 722 722 723 - static int kvm_suspend(void) 723 + static int kvm_suspend(void *data) 724 724 { 725 725 u64 val = 0; 726 726 ··· 734 734 return 0; 735 735 } 736 736 737 - static void kvm_resume(void) 737 + static void kvm_resume(void *data) 738 738 { 739 739 kvm_cpu_online(raw_smp_processor_id()); 740 740 ··· 744 744 #endif 745 745 } 746 746 747 - static struct syscore_ops kvm_syscore_ops = { 747 + static const struct syscore_ops kvm_syscore_ops = { 748 748 .suspend = kvm_suspend, 749 749 .resume = kvm_resume, 750 + }; 751 + 752 + static struct syscore kvm_syscore = { 753 + .ops = &kvm_syscore_ops, 750 754 }; 751 755 752 756 static void kvm_pv_guest_cpu_reboot(void *unused) ··· 862 858 machine_ops.crash_shutdown = kvm_crash_shutdown; 863 859 #endif 864 860 865 - register_syscore_ops(&kvm_syscore_ops); 861 + register_syscore(&kvm_syscore); 866 862 867 863 /* 868 864 * Hard lockup detection is enabled by default. Disable it, as guests
+7 -3
drivers/acpi/pci_link.c
··· 761 761 return 0; 762 762 } 763 763 764 - static void irqrouter_resume(void) 764 + static void irqrouter_resume(void *data) 765 765 { 766 766 struct acpi_pci_link *link; 767 767 ··· 888 888 889 889 __setup("acpi_irq_balance", acpi_irq_balance_set); 890 890 891 - static struct syscore_ops irqrouter_syscore_ops = { 891 + static const struct syscore_ops irqrouter_syscore_ops = { 892 892 .resume = irqrouter_resume, 893 + }; 894 + 895 + static struct syscore irqrouter_syscore = { 896 + .ops = &irqrouter_syscore_ops, 893 897 }; 894 898 895 899 void __init acpi_pci_link_init(void) ··· 908 904 else 909 905 acpi_irq_balance = 0; 910 906 } 911 - register_syscore_ops(&irqrouter_syscore_ops); 907 + register_syscore(&irqrouter_syscore); 912 908 acpi_scan_add_handler(&pci_link_handler); 913 909 }
+8 -4
drivers/acpi/sleep.c
··· 884 884 #ifdef CONFIG_PM_SLEEP 885 885 static u32 saved_bm_rld; 886 886 887 - static int acpi_save_bm_rld(void) 887 + static int acpi_save_bm_rld(void *data) 888 888 { 889 889 acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &saved_bm_rld); 890 890 return 0; 891 891 } 892 892 893 - static void acpi_restore_bm_rld(void) 893 + static void acpi_restore_bm_rld(void *data) 894 894 { 895 895 u32 resumed_bm_rld = 0; 896 896 ··· 901 901 acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); 902 902 } 903 903 904 - static struct syscore_ops acpi_sleep_syscore_ops = { 904 + static const struct syscore_ops acpi_sleep_syscore_ops = { 905 905 .suspend = acpi_save_bm_rld, 906 906 .resume = acpi_restore_bm_rld, 907 907 }; 908 908 909 + static struct syscore acpi_sleep_syscore = { 910 + .ops = &acpi_sleep_syscore_ops, 911 + }; 912 + 909 913 static void acpi_sleep_syscore_init(void) 910 914 { 911 - register_syscore_ops(&acpi_sleep_syscore_ops); 915 + register_syscore(&acpi_sleep_syscore); 912 916 } 913 917 #else 914 918 static inline void acpi_sleep_syscore_init(void) {}
+8 -4
drivers/base/firmware_loader/main.c
··· 1585 1585 } 1586 1586 1587 1587 /* stop caching firmware once syscore_suspend is reached */ 1588 - static int fw_suspend(void) 1588 + static int fw_suspend(void *data) 1589 1589 { 1590 1590 fw_cache.state = FW_LOADER_NO_CACHE; 1591 1591 return 0; 1592 1592 } 1593 1593 1594 - static struct syscore_ops fw_syscore_ops = { 1594 + static const struct syscore_ops fw_syscore_ops = { 1595 1595 .suspend = fw_suspend, 1596 + }; 1597 + 1598 + static struct syscore fw_syscore = { 1599 + .ops = &fw_syscore_ops, 1596 1600 }; 1597 1601 1598 1602 static int __init register_fw_pm_ops(void) ··· 1614 1610 if (ret) 1615 1611 return ret; 1616 1612 1617 - register_syscore_ops(&fw_syscore_ops); 1613 + register_syscore(&fw_syscore); 1618 1614 1619 1615 return ret; 1620 1616 } 1621 1617 1622 1618 static inline void unregister_fw_pm_ops(void) 1623 1619 { 1624 - unregister_syscore_ops(&fw_syscore_ops); 1620 + unregister_syscore(&fw_syscore); 1625 1621 unregister_pm_notifier(&fw_cache.pm_notify); 1626 1622 } 1627 1623 #else
+43 -39
drivers/base/syscore.c
··· 11 11 #include <linux/suspend.h> 12 12 #include <trace/events/power.h> 13 13 14 - static LIST_HEAD(syscore_ops_list); 15 - static DEFINE_MUTEX(syscore_ops_lock); 14 + static LIST_HEAD(syscore_list); 15 + static DEFINE_MUTEX(syscore_lock); 16 16 17 17 /** 18 - * register_syscore_ops - Register a set of system core operations. 19 - * @ops: System core operations to register. 18 + * register_syscore - Register a set of system core operations. 19 + * @syscore: System core operations to register. 20 20 */ 21 - void register_syscore_ops(struct syscore_ops *ops) 21 + void register_syscore(struct syscore *syscore) 22 22 { 23 - mutex_lock(&syscore_ops_lock); 24 - list_add_tail(&ops->node, &syscore_ops_list); 25 - mutex_unlock(&syscore_ops_lock); 23 + mutex_lock(&syscore_lock); 24 + list_add_tail(&syscore->node, &syscore_list); 25 + mutex_unlock(&syscore_lock); 26 26 } 27 - EXPORT_SYMBOL_GPL(register_syscore_ops); 27 + EXPORT_SYMBOL_GPL(register_syscore); 28 28 29 29 /** 30 - * unregister_syscore_ops - Unregister a set of system core operations. 31 - * @ops: System core operations to unregister. 30 + * unregister_syscore - Unregister a set of system core operations. 31 + * @syscore: System core operations to unregister. 32 32 */ 33 - void unregister_syscore_ops(struct syscore_ops *ops) 33 + void unregister_syscore(struct syscore *syscore) 34 34 { 35 - mutex_lock(&syscore_ops_lock); 36 - list_del(&ops->node); 37 - mutex_unlock(&syscore_ops_lock); 35 + mutex_lock(&syscore_lock); 36 + list_del(&syscore->node); 37 + mutex_unlock(&syscore_lock); 38 38 } 39 - EXPORT_SYMBOL_GPL(unregister_syscore_ops); 39 + EXPORT_SYMBOL_GPL(unregister_syscore); 40 40 41 41 #ifdef CONFIG_PM_SLEEP 42 42 /** ··· 46 46 */ 47 47 int syscore_suspend(void) 48 48 { 49 - struct syscore_ops *ops; 49 + struct syscore *syscore; 50 50 int ret = 0; 51 51 52 52 trace_suspend_resume(TPS("syscore_suspend"), 0, true); ··· 59 59 WARN_ONCE(!irqs_disabled(), 60 60 "Interrupts enabled before system core suspend.\n"); 61 61 62 - list_for_each_entry_reverse(ops, &syscore_ops_list, node) 63 - if (ops->suspend) { 64 - pm_pr_dbg("Calling %pS\n", ops->suspend); 65 - ret = ops->suspend(); 62 + list_for_each_entry_reverse(syscore, &syscore_list, node) 63 + if (syscore->ops->suspend) { 64 + pm_pr_dbg("Calling %pS\n", syscore->ops->suspend); 65 + ret = syscore->ops->suspend(syscore->data); 66 66 if (ret) 67 67 goto err_out; 68 68 WARN_ONCE(!irqs_disabled(), 69 - "Interrupts enabled after %pS\n", ops->suspend); 69 + "Interrupts enabled after %pS\n", 70 + syscore->ops->suspend); 70 71 } 71 72 72 73 trace_suspend_resume(TPS("syscore_suspend"), 0, false); 73 74 return 0; 74 75 75 76 err_out: 76 - pr_err("PM: System core suspend callback %pS failed.\n", ops->suspend); 77 + pr_err("PM: System core suspend callback %pS failed.\n", 78 + syscore->ops->suspend); 77 79 78 - list_for_each_entry_continue(ops, &syscore_ops_list, node) 79 - if (ops->resume) 80 - ops->resume(); 80 + list_for_each_entry_continue(syscore, &syscore_list, node) 81 + if (syscore->ops->resume) 82 + syscore->ops->resume(syscore->data); 81 83 82 84 return ret; 83 85 } ··· 92 90 */ 93 91 void syscore_resume(void) 94 92 { 95 - struct syscore_ops *ops; 93 + struct syscore *syscore; 96 94 97 95 trace_suspend_resume(TPS("syscore_resume"), 0, true); 98 96 WARN_ONCE(!irqs_disabled(), 99 97 "Interrupts enabled before system core resume.\n"); 100 98 101 - list_for_each_entry(ops, &syscore_ops_list, node) 102 - if (ops->resume) { 103 - pm_pr_dbg("Calling %pS\n", ops->resume); 104 - ops->resume(); 99 + list_for_each_entry(syscore, &syscore_list, node) 100 + if (syscore->ops->resume) { 101 + pm_pr_dbg("Calling %pS\n", syscore->ops->resume); 102 + syscore->ops->resume(syscore->data); 105 103 WARN_ONCE(!irqs_disabled(), 106 - "Interrupts enabled after %pS\n", ops->resume); 104 + "Interrupts enabled after %pS\n", 105 + syscore->ops->resume); 107 106 } 108 107 trace_suspend_resume(TPS("syscore_resume"), 0, false); 109 108 } ··· 116 113 */ 117 114 void syscore_shutdown(void) 118 115 { 119 - struct syscore_ops *ops; 116 + struct syscore *syscore; 120 117 121 - mutex_lock(&syscore_ops_lock); 118 + mutex_lock(&syscore_lock); 122 119 123 - list_for_each_entry_reverse(ops, &syscore_ops_list, node) 124 - if (ops->shutdown) { 120 + list_for_each_entry_reverse(syscore, &syscore_list, node) 121 + if (syscore->ops->shutdown) { 125 122 if (initcall_debug) 126 - pr_info("PM: Calling %pS\n", ops->shutdown); 127 - ops->shutdown(); 123 + pr_info("PM: Calling %pS\n", 124 + syscore->ops->shutdown); 125 + syscore->ops->shutdown(syscore->data); 128 126 } 129 127 130 - mutex_unlock(&syscore_ops_lock); 128 + mutex_unlock(&syscore_lock); 131 129 }
+10 -6
drivers/bus/mvebu-mbus.c
··· 1006 1006 } 1007 1007 fs_initcall(mvebu_mbus_debugfs_init); 1008 1008 1009 - static int mvebu_mbus_suspend(void) 1009 + static int mvebu_mbus_suspend(void *data) 1010 1010 { 1011 1011 struct mvebu_mbus_state *s = &mbus_state; 1012 1012 int win; ··· 1040 1040 return 0; 1041 1041 } 1042 1042 1043 - static void mvebu_mbus_resume(void) 1043 + static void mvebu_mbus_resume(void *data) 1044 1044 { 1045 1045 struct mvebu_mbus_state *s = &mbus_state; 1046 1046 int win; ··· 1069 1069 } 1070 1070 } 1071 1071 1072 - static struct syscore_ops mvebu_mbus_syscore_ops = { 1073 - .suspend = mvebu_mbus_suspend, 1074 - .resume = mvebu_mbus_resume, 1072 + static const struct syscore_ops mvebu_mbus_syscore_ops = { 1073 + .suspend = mvebu_mbus_suspend, 1074 + .resume = mvebu_mbus_resume, 1075 + }; 1076 + 1077 + static struct syscore mvebu_mbus_syscore = { 1078 + .ops = &mvebu_mbus_syscore_ops, 1075 1079 }; 1076 1080 1077 1081 static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus, ··· 1122 1118 writel(UNIT_SYNC_BARRIER_ALL, 1123 1119 mbus->mbuswins_base + UNIT_SYNC_BARRIER_OFF); 1124 1120 1125 - register_syscore_ops(&mvebu_mbus_syscore_ops); 1121 + register_syscore(&mvebu_mbus_syscore); 1126 1122 1127 1123 return 0; 1128 1124 }
+8 -4
drivers/clk/at91/pmc.c
··· 115 115 /* Address in SECURAM that say if we suspend to backup mode. */ 116 116 static void __iomem *at91_pmc_backup_suspend; 117 117 118 - static int at91_pmc_suspend(void) 118 + static int at91_pmc_suspend(void *data) 119 119 { 120 120 unsigned int backup; 121 121 ··· 129 129 return clk_save_context(); 130 130 } 131 131 132 - static void at91_pmc_resume(void) 132 + static void at91_pmc_resume(void *data) 133 133 { 134 134 unsigned int backup; 135 135 ··· 143 143 clk_restore_context(); 144 144 } 145 145 146 - static struct syscore_ops pmc_syscore_ops = { 146 + static const struct syscore_ops pmc_syscore_ops = { 147 147 .suspend = at91_pmc_suspend, 148 148 .resume = at91_pmc_resume, 149 + }; 150 + 151 + static struct syscore pmc_syscore = { 152 + .ops = &pmc_syscore_ops, 149 153 }; 150 154 151 155 static const struct of_device_id pmc_dt_ids[] = { ··· 189 185 return -ENOMEM; 190 186 } 191 187 192 - register_syscore_ops(&pmc_syscore_ops); 188 + register_syscore(&pmc_syscore); 193 189 194 190 return 0; 195 191 }
+8 -4
drivers/clk/imx/clk-vf610.c
··· 139 139 return clk; 140 140 }; 141 141 142 - static int vf610_clk_suspend(void) 142 + static int vf610_clk_suspend(void *data) 143 143 { 144 144 int i; 145 145 ··· 156 156 return 0; 157 157 } 158 158 159 - static void vf610_clk_resume(void) 159 + static void vf610_clk_resume(void *data) 160 160 { 161 161 int i; 162 162 ··· 171 171 writel_relaxed(ccgr[i], CCM_CCGRx(i)); 172 172 } 173 173 174 - static struct syscore_ops vf610_clk_syscore_ops = { 174 + static const struct syscore_ops vf610_clk_syscore_ops = { 175 175 .suspend = vf610_clk_suspend, 176 176 .resume = vf610_clk_resume, 177 + }; 178 + 179 + static struct syscore vf610_clk_syscore = { 180 + .ops = &vf610_clk_syscore_ops, 177 181 }; 178 182 179 183 static void __init vf610_clocks_init(struct device_node *ccm_node) ··· 466 462 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) 467 463 clk_prepare_enable(clk[clks_init_on[i]]); 468 464 469 - register_syscore_ops(&vf610_clk_syscore_ops); 465 + register_syscore(&vf610_clk_syscore); 470 466 471 467 /* Add the clocks to provider list */ 472 468 clk_data.clks = clk;
+1 -1
drivers/clk/ingenic/jz4725b-cgu.c
··· 268 268 if (retval) 269 269 pr_err("%s: failed to register CGU Clocks\n", __func__); 270 270 271 - ingenic_cgu_register_syscore_ops(cgu); 271 + ingenic_cgu_register_syscore(cgu); 272 272 } 273 273 CLK_OF_DECLARE_DRIVER(jz4725b_cgu, "ingenic,jz4725b-cgu", jz4725b_cgu_init);
+1 -1
drivers/clk/ingenic/jz4740-cgu.c
··· 266 266 if (retval) 267 267 pr_err("%s: failed to register CGU Clocks\n", __func__); 268 268 269 - ingenic_cgu_register_syscore_ops(cgu); 269 + ingenic_cgu_register_syscore(cgu); 270 270 } 271 271 CLK_OF_DECLARE_DRIVER(jz4740_cgu, "ingenic,jz4740-cgu", jz4740_cgu_init);
+1 -1
drivers/clk/ingenic/jz4755-cgu.c
··· 337 337 if (retval) 338 338 pr_err("%s: failed to register CGU Clocks\n", __func__); 339 339 340 - ingenic_cgu_register_syscore_ops(cgu); 340 + ingenic_cgu_register_syscore(cgu); 341 341 } 342 342 /* 343 343 * CGU has some children devices, this is useful for probing children devices
+1 -1
drivers/clk/ingenic/jz4760-cgu.c
··· 436 436 if (retval) 437 437 pr_err("%s: failed to register CGU Clocks\n", __func__); 438 438 439 - ingenic_cgu_register_syscore_ops(cgu); 439 + ingenic_cgu_register_syscore(cgu); 440 440 } 441 441 442 442 /* We only probe via devicetree, no need for a platform driver */
+1 -1
drivers/clk/ingenic/jz4770-cgu.c
··· 456 456 if (retval) 457 457 pr_err("%s: failed to register CGU Clocks\n", __func__); 458 458 459 - ingenic_cgu_register_syscore_ops(cgu); 459 + ingenic_cgu_register_syscore(cgu); 460 460 } 461 461 462 462 /* We only probe via devicetree, no need for a platform driver */
+1 -1
drivers/clk/ingenic/jz4780-cgu.c
··· 803 803 return; 804 804 } 805 805 806 - ingenic_cgu_register_syscore_ops(cgu); 806 + ingenic_cgu_register_syscore(cgu); 807 807 } 808 808 CLK_OF_DECLARE_DRIVER(jz4780_cgu, "ingenic,jz4780-cgu", jz4780_cgu_init);
+9 -5
drivers/clk/ingenic/pm.c
··· 15 15 16 16 static void __iomem * __maybe_unused ingenic_cgu_base; 17 17 18 - static int __maybe_unused ingenic_cgu_pm_suspend(void) 18 + static int __maybe_unused ingenic_cgu_pm_suspend(void *data) 19 19 { 20 20 u32 val = readl(ingenic_cgu_base + CGU_REG_LCR); 21 21 ··· 24 24 return 0; 25 25 } 26 26 27 - static void __maybe_unused ingenic_cgu_pm_resume(void) 27 + static void __maybe_unused ingenic_cgu_pm_resume(void *data) 28 28 { 29 29 u32 val = readl(ingenic_cgu_base + CGU_REG_LCR); 30 30 31 31 writel(val & ~LCR_LOW_POWER_MODE, ingenic_cgu_base + CGU_REG_LCR); 32 32 } 33 33 34 - static struct syscore_ops __maybe_unused ingenic_cgu_pm_ops = { 34 + static const struct syscore_ops __maybe_unused ingenic_cgu_pm_ops = { 35 35 .suspend = ingenic_cgu_pm_suspend, 36 36 .resume = ingenic_cgu_pm_resume, 37 37 }; 38 38 39 - void ingenic_cgu_register_syscore_ops(struct ingenic_cgu *cgu) 39 + static struct syscore __maybe_unused ingenic_cgu_pm = { 40 + .ops = &ingenic_cgu_pm_ops, 41 + }; 42 + 43 + void ingenic_cgu_register_syscore(struct ingenic_cgu *cgu) 40 44 { 41 45 if (IS_ENABLED(CONFIG_PM_SLEEP)) { 42 46 ingenic_cgu_base = cgu->base; 43 - register_syscore_ops(&ingenic_cgu_pm_ops); 47 + register_syscore(&ingenic_cgu_pm); 44 48 } 45 49 }
+1 -1
drivers/clk/ingenic/pm.h
··· 7 7 8 8 struct ingenic_cgu; 9 9 10 - void ingenic_cgu_register_syscore_ops(struct ingenic_cgu *cgu); 10 + void ingenic_cgu_register_syscore(struct ingenic_cgu *cgu); 11 11 12 12 #endif /* DRIVERS_CLK_INGENIC_PM_H */
+8 -4
drivers/clk/ingenic/tcu.c
··· 455 455 return ret; 456 456 } 457 457 458 - static int __maybe_unused tcu_pm_suspend(void) 458 + static int __maybe_unused tcu_pm_suspend(void *data) 459 459 { 460 460 struct ingenic_tcu *tcu = ingenic_tcu; 461 461 ··· 465 465 return 0; 466 466 } 467 467 468 - static void __maybe_unused tcu_pm_resume(void) 468 + static void __maybe_unused tcu_pm_resume(void *data) 469 469 { 470 470 struct ingenic_tcu *tcu = ingenic_tcu; 471 471 ··· 473 473 clk_enable(tcu->clk); 474 474 } 475 475 476 - static struct syscore_ops __maybe_unused tcu_pm_ops = { 476 + static const struct syscore_ops __maybe_unused tcu_pm_ops = { 477 477 .suspend = tcu_pm_suspend, 478 478 .resume = tcu_pm_resume, 479 + }; 480 + 481 + static struct syscore __maybe_unused tcu_pm = { 482 + .ops = &tcu_pm_ops, 479 483 }; 480 484 481 485 static void __init ingenic_tcu_init(struct device_node *np) ··· 490 486 pr_crit("Failed to initialize TCU clocks: %d\n", ret); 491 487 492 488 if (IS_ENABLED(CONFIG_PM_SLEEP)) 493 - register_syscore_ops(&tcu_pm_ops); 489 + register_syscore(&tcu_pm); 494 490 } 495 491 496 492 CLK_OF_DECLARE_DRIVER(jz4740_cgu, "ingenic,jz4740-tcu", ingenic_tcu_init);
+1 -1
drivers/clk/ingenic/x1000-cgu.c
··· 556 556 return; 557 557 } 558 558 559 - ingenic_cgu_register_syscore_ops(cgu); 559 + ingenic_cgu_register_syscore(cgu); 560 560 } 561 561 /* 562 562 * CGU has some children devices, this is useful for probing children devices
+1 -1
drivers/clk/ingenic/x1830-cgu.c
··· 463 463 return; 464 464 } 465 465 466 - ingenic_cgu_register_syscore_ops(cgu); 466 + ingenic_cgu_register_syscore(cgu); 467 467 } 468 468 /* 469 469 * CGU has some children devices, this is useful for probing children devices
+8 -4
drivers/clk/mvebu/common.c
··· 215 215 return ERR_PTR(-ENODEV); 216 216 } 217 217 218 - static int mvebu_clk_gating_suspend(void) 218 + static int mvebu_clk_gating_suspend(void *data) 219 219 { 220 220 ctrl->saved_reg = readl(ctrl->base); 221 221 return 0; 222 222 } 223 223 224 - static void mvebu_clk_gating_resume(void) 224 + static void mvebu_clk_gating_resume(void *data) 225 225 { 226 226 writel(ctrl->saved_reg, ctrl->base); 227 227 } 228 228 229 - static struct syscore_ops clk_gate_syscore_ops = { 229 + static const struct syscore_ops clk_gate_syscore_ops = { 230 230 .suspend = mvebu_clk_gating_suspend, 231 231 .resume = mvebu_clk_gating_resume, 232 + }; 233 + 234 + static struct syscore clk_gate_syscore = { 235 + .ops = &clk_gate_syscore_ops, 232 236 }; 233 237 234 238 void __init mvebu_clk_gating_setup(struct device_node *np, ··· 288 284 289 285 of_clk_add_provider(np, clk_gating_get_src, ctrl); 290 286 291 - register_syscore_ops(&clk_gate_syscore_ops); 287 + register_syscore(&clk_gate_syscore); 292 288 293 289 return; 294 290 gates_out:
+8 -4
drivers/clk/rockchip/clk-rk3288.c
··· 871 871 872 872 static u32 rk3288_saved_cru_regs[ARRAY_SIZE(rk3288_saved_cru_reg_ids)]; 873 873 874 - static int rk3288_clk_suspend(void) 874 + static int rk3288_clk_suspend(void *data) 875 875 { 876 876 int i, reg_id; 877 877 ··· 906 906 return 0; 907 907 } 908 908 909 - static void rk3288_clk_resume(void) 909 + static void rk3288_clk_resume(void *data) 910 910 { 911 911 int i, reg_id; 912 912 ··· 923 923 writel_relaxed(0xf3030000, rk3288_cru_base + RK3288_MODE_CON); 924 924 } 925 925 926 - static struct syscore_ops rk3288_clk_syscore_ops = { 926 + static const struct syscore_ops rk3288_clk_syscore_ops = { 927 927 .suspend = rk3288_clk_suspend, 928 928 .resume = rk3288_clk_resume, 929 + }; 930 + 931 + static struct syscore rk3288_clk_syscore = { 932 + .ops = &rk3288_clk_syscore_ops, 929 933 }; 930 934 931 935 static void __init rk3288_common_init(struct device_node *np, ··· 980 976 981 977 rockchip_register_restart_notifier(ctx, RK3288_GLB_SRST_FST, 982 978 rk3288_clk_shutdown); 983 - register_syscore_ops(&rk3288_clk_syscore_ops); 979 + register_syscore(&rk3288_clk_syscore); 984 980 985 981 rockchip_clk_of_add_provider(np, ctx); 986 982 }
+8 -4
drivers/clk/samsung/clk-s5pv210-audss.c
··· 36 36 {ASS_CLK_GATE, 0}, 37 37 }; 38 38 39 - static int s5pv210_audss_clk_suspend(void) 39 + static int s5pv210_audss_clk_suspend(void *data) 40 40 { 41 41 int i; 42 42 ··· 46 46 return 0; 47 47 } 48 48 49 - static void s5pv210_audss_clk_resume(void) 49 + static void s5pv210_audss_clk_resume(void *data) 50 50 { 51 51 int i; 52 52 ··· 54 54 writel(reg_save[i][1], reg_base + reg_save[i][0]); 55 55 } 56 56 57 - static struct syscore_ops s5pv210_audss_clk_syscore_ops = { 57 + static const struct syscore_ops s5pv210_audss_clk_syscore_ops = { 58 58 .suspend = s5pv210_audss_clk_suspend, 59 59 .resume = s5pv210_audss_clk_resume, 60 + }; 61 + 62 + static struct syscore s5pv210_audss_clk_syscore = { 63 + .ops = &s5pv210_audss_clk_syscore_ops, 60 64 }; 61 65 #endif /* CONFIG_PM_SLEEP */ 62 66 ··· 179 175 } 180 176 181 177 #ifdef CONFIG_PM_SLEEP 182 - register_syscore_ops(&s5pv210_audss_clk_syscore_ops); 178 + register_syscore(&s5pv210_audss_clk_syscore); 183 179 #endif 184 180 185 181 return 0;
+8 -4
drivers/clk/samsung/clk.c
··· 271 271 } 272 272 273 273 #ifdef CONFIG_PM_SLEEP 274 - static int samsung_clk_suspend(void) 274 + static int samsung_clk_suspend(void *data) 275 275 { 276 276 struct samsung_clock_reg_cache *reg_cache; 277 277 ··· 284 284 return 0; 285 285 } 286 286 287 - static void samsung_clk_resume(void) 287 + static void samsung_clk_resume(void *data) 288 288 { 289 289 struct samsung_clock_reg_cache *reg_cache; 290 290 ··· 293 293 reg_cache->rd_num); 294 294 } 295 295 296 - static struct syscore_ops samsung_clk_syscore_ops = { 296 + static const struct syscore_ops samsung_clk_syscore_ops = { 297 297 .suspend = samsung_clk_suspend, 298 298 .resume = samsung_clk_resume, 299 + }; 300 + 301 + static struct syscore samsung_clk_syscore = { 302 + .ops = &samsung_clk_syscore_ops, 299 303 }; 300 304 301 305 void samsung_clk_extended_sleep_init(void __iomem *reg_base, ··· 320 316 panic("could not allocate register dump storage.\n"); 321 317 322 318 if (list_empty(&clock_reg_cache_list)) 323 - register_syscore_ops(&samsung_clk_syscore_ops); 319 + register_syscore(&samsung_clk_syscore); 324 320 325 321 reg_cache->reg_base = reg_base; 326 322 reg_cache->rd_num = nr_rdump;
+8 -4
drivers/clk/tegra/clk-tegra210.c
··· 3444 3444 static u32 spare_reg_ctx, misc_clk_enb_ctx, clk_msk_arm_ctx; 3445 3445 static u32 cpu_softrst_ctx[3]; 3446 3446 3447 - static int tegra210_clk_suspend(void) 3447 + static int tegra210_clk_suspend(void *data) 3448 3448 { 3449 3449 unsigned int i; 3450 3450 ··· 3465 3465 return 0; 3466 3466 } 3467 3467 3468 - static void tegra210_clk_resume(void) 3468 + static void tegra210_clk_resume(void *data) 3469 3469 { 3470 3470 unsigned int i; 3471 3471 ··· 3523 3523 } 3524 3524 #endif 3525 3525 3526 - static struct syscore_ops tegra_clk_syscore_ops = { 3526 + static const struct syscore_ops tegra_clk_syscore_ops = { 3527 3527 #ifdef CONFIG_PM_SLEEP 3528 3528 .suspend = tegra210_clk_suspend, 3529 3529 .resume = tegra210_clk_resume, 3530 3530 #endif 3531 + }; 3532 + 3533 + static struct syscore tegra_clk_syscore = { 3534 + .ops = &tegra_clk_syscore_ops, 3531 3535 }; 3532 3536 3533 3537 static struct tegra_cpu_car_ops tegra210_cpu_car_ops = { ··· 3817 3813 3818 3814 tegra_cpu_car_ops = &tegra210_cpu_car_ops; 3819 3815 3820 - register_syscore_ops(&tegra_clk_syscore_ops); 3816 + register_syscore(&tegra_clk_syscore); 3821 3817 } 3822 3818 CLK_OF_DECLARE(tegra210, "nvidia,tegra210-car", tegra210_clock_init);
+8 -4
drivers/clocksource/timer-armada-370-xp.c
··· 207 207 208 208 static u32 timer0_ctrl_reg, timer0_local_ctrl_reg; 209 209 210 - static int armada_370_xp_timer_suspend(void) 210 + static int armada_370_xp_timer_suspend(void *data) 211 211 { 212 212 timer0_ctrl_reg = readl(timer_base + TIMER_CTRL_OFF); 213 213 timer0_local_ctrl_reg = readl(local_base + TIMER_CTRL_OFF); 214 214 return 0; 215 215 } 216 216 217 - static void armada_370_xp_timer_resume(void) 217 + static void armada_370_xp_timer_resume(void *data) 218 218 { 219 219 writel(0xffffffff, timer_base + TIMER0_VAL_OFF); 220 220 writel(0xffffffff, timer_base + TIMER0_RELOAD_OFF); ··· 222 222 writel(timer0_local_ctrl_reg, local_base + TIMER_CTRL_OFF); 223 223 } 224 224 225 - static struct syscore_ops armada_370_xp_timer_syscore_ops = { 225 + static const struct syscore_ops armada_370_xp_timer_syscore_ops = { 226 226 .suspend = armada_370_xp_timer_suspend, 227 227 .resume = armada_370_xp_timer_resume, 228 + }; 229 + 230 + static struct syscore armada_370_xp_timer_syscore = { 231 + .ops = &armada_370_xp_timer_syscore_ops, 228 232 }; 229 233 230 234 static unsigned long armada_370_delay_timer_read(void) ··· 328 324 return res; 329 325 } 330 326 331 - register_syscore_ops(&armada_370_xp_timer_syscore_ops); 327 + register_syscore(&armada_370_xp_timer_syscore); 332 328 333 329 return 0; 334 330 }
+8 -4
drivers/cpuidle/cpuidle-psci.c
··· 177 177 } 178 178 } 179 179 180 - static int psci_idle_syscore_suspend(void) 180 + static int psci_idle_syscore_suspend(void *data) 181 181 { 182 182 psci_idle_syscore_switch(true); 183 183 return 0; 184 184 } 185 185 186 - static void psci_idle_syscore_resume(void) 186 + static void psci_idle_syscore_resume(void *data) 187 187 { 188 188 psci_idle_syscore_switch(false); 189 189 } 190 190 191 - static struct syscore_ops psci_idle_syscore_ops = { 191 + static const struct syscore_ops psci_idle_syscore_ops = { 192 192 .suspend = psci_idle_syscore_suspend, 193 193 .resume = psci_idle_syscore_resume, 194 + }; 195 + 196 + static struct syscore psci_idle_syscore = { 197 + .ops = &psci_idle_syscore_ops, 194 198 }; 195 199 196 200 static void psci_idle_init_syscore(void) 197 201 { 198 202 if (psci_cpuidle_use_syscore) 199 - register_syscore_ops(&psci_idle_syscore_ops); 203 + register_syscore(&psci_idle_syscore); 200 204 } 201 205 202 206 static void psci_idle_init_cpuhp(void)
+8 -4
drivers/gpio/gpio-mxc.c
··· 667 667 RUNTIME_PM_OPS(mxc_gpio_runtime_suspend, mxc_gpio_runtime_resume, NULL) 668 668 }; 669 669 670 - static int mxc_gpio_syscore_suspend(void) 670 + static int mxc_gpio_syscore_suspend(void *data) 671 671 { 672 672 struct mxc_gpio_port *port; 673 673 int ret; ··· 684 684 return 0; 685 685 } 686 686 687 - static void mxc_gpio_syscore_resume(void) 687 + static void mxc_gpio_syscore_resume(void *data) 688 688 { 689 689 struct mxc_gpio_port *port; 690 690 int ret; ··· 701 701 } 702 702 } 703 703 704 - static struct syscore_ops mxc_gpio_syscore_ops = { 704 + static const struct syscore_ops mxc_gpio_syscore_ops = { 705 705 .suspend = mxc_gpio_syscore_suspend, 706 706 .resume = mxc_gpio_syscore_resume, 707 + }; 708 + 709 + static struct syscore mxc_gpio_syscore = { 710 + .ops = &mxc_gpio_syscore_ops, 707 711 }; 708 712 709 713 static struct platform_driver mxc_gpio_driver = { ··· 722 718 723 719 static int __init gpio_mxc_init(void) 724 720 { 725 - register_syscore_ops(&mxc_gpio_syscore_ops); 721 + register_syscore(&mxc_gpio_syscore); 726 722 727 723 return platform_driver_register(&mxc_gpio_driver); 728 724 }
+8 -4
drivers/gpio/gpio-pxa.c
··· 747 747 device_initcall(pxa_gpio_dt_init); 748 748 749 749 #ifdef CONFIG_PM 750 - static int pxa_gpio_suspend(void) 750 + static int pxa_gpio_suspend(void *data) 751 751 { 752 752 struct pxa_gpio_chip *pchip = pxa_gpio_chip; 753 753 struct pxa_gpio_bank *c; ··· 768 768 return 0; 769 769 } 770 770 771 - static void pxa_gpio_resume(void) 771 + static void pxa_gpio_resume(void *data) 772 772 { 773 773 struct pxa_gpio_chip *pchip = pxa_gpio_chip; 774 774 struct pxa_gpio_bank *c; ··· 792 792 #define pxa_gpio_resume NULL 793 793 #endif 794 794 795 - static struct syscore_ops pxa_gpio_syscore_ops = { 795 + static const struct syscore_ops pxa_gpio_syscore_ops = { 796 796 .suspend = pxa_gpio_suspend, 797 797 .resume = pxa_gpio_resume, 798 798 }; 799 799 800 + static struct syscore pxa_gpio_syscore = { 801 + .ops = &pxa_gpio_syscore_ops, 802 + }; 803 + 800 804 static int __init pxa_gpio_sysinit(void) 801 805 { 802 - register_syscore_ops(&pxa_gpio_syscore_ops); 806 + register_syscore(&pxa_gpio_syscore); 803 807 return 0; 804 808 } 805 809 postcore_initcall(pxa_gpio_sysinit);
+8 -4
drivers/gpio/gpio-sa1100.c
··· 256 256 } while (mask); 257 257 } 258 258 259 - static int sa1100_gpio_suspend(void) 259 + static int sa1100_gpio_suspend(void *data) 260 260 { 261 261 struct sa1100_gpio_chip *sgc = &sa1100_gpio_chip; 262 262 ··· 275 275 return 0; 276 276 } 277 277 278 - static void sa1100_gpio_resume(void) 278 + static void sa1100_gpio_resume(void *data) 279 279 { 280 280 sa1100_update_edge_regs(&sa1100_gpio_chip); 281 281 } 282 282 283 - static struct syscore_ops sa1100_gpio_syscore_ops = { 283 + static const struct syscore_ops sa1100_gpio_syscore_ops = { 284 284 .suspend = sa1100_gpio_suspend, 285 285 .resume = sa1100_gpio_resume, 286 286 }; 287 287 288 + static struct syscore sa1100_gpio_syscore = { 289 + .ops = &sa1100_gpio_syscore_ops, 290 + }; 291 + 288 292 static int __init sa1100_gpio_init_devicefs(void) 289 293 { 290 - register_syscore_ops(&sa1100_gpio_syscore_ops); 294 + register_syscore(&sa1100_gpio_syscore); 291 295 return 0; 292 296 } 293 297
+9 -5
drivers/hv/vmbus_drv.c
··· 2801 2801 hv_synic_disable_regs(cpu); 2802 2802 }; 2803 2803 2804 - static int hv_synic_suspend(void) 2804 + static int hv_synic_suspend(void *data) 2805 2805 { 2806 2806 /* 2807 2807 * When we reach here, all the non-boot CPUs have been offlined. ··· 2828 2828 return 0; 2829 2829 } 2830 2830 2831 - static void hv_synic_resume(void) 2831 + static void hv_synic_resume(void *data) 2832 2832 { 2833 2833 hv_synic_enable_regs(0); 2834 2834 ··· 2840 2840 } 2841 2841 2842 2842 /* The callbacks run only on CPU0, with irqs_disabled. */ 2843 - static struct syscore_ops hv_synic_syscore_ops = { 2843 + static const struct syscore_ops hv_synic_syscore_ops = { 2844 2844 .suspend = hv_synic_suspend, 2845 2845 .resume = hv_synic_resume, 2846 + }; 2847 + 2848 + static struct syscore hv_synic_syscore = { 2849 + .ops = &hv_synic_syscore_ops, 2846 2850 }; 2847 2851 2848 2852 static int __init hv_acpi_init(void) ··· 2891 2887 hv_setup_kexec_handler(hv_kexec_handler); 2892 2888 hv_setup_crash_handler(hv_crash_handler); 2893 2889 2894 - register_syscore_ops(&hv_synic_syscore_ops); 2890 + register_syscore(&hv_synic_syscore); 2895 2891 2896 2892 return 0; 2897 2893 ··· 2905 2901 { 2906 2902 int cpu; 2907 2903 2908 - unregister_syscore_ops(&hv_synic_syscore_ops); 2904 + unregister_syscore(&hv_synic_syscore); 2909 2905 2910 2906 hv_remove_kexec_handler(); 2911 2907 hv_remove_crash_handler();
+10 -6
drivers/iommu/amd/init.c
··· 3024 3024 * disable suspend until real resume implemented 3025 3025 */ 3026 3026 3027 - static void amd_iommu_resume(void) 3027 + static void amd_iommu_resume(void *data) 3028 3028 { 3029 3029 struct amd_iommu *iommu; 3030 3030 ··· 3038 3038 amd_iommu_enable_interrupts(); 3039 3039 } 3040 3040 3041 - static int amd_iommu_suspend(void) 3041 + static int amd_iommu_suspend(void *data) 3042 3042 { 3043 3043 /* disable IOMMUs to go out of the way for BIOS */ 3044 3044 disable_iommus(); ··· 3046 3046 return 0; 3047 3047 } 3048 3048 3049 - static struct syscore_ops amd_iommu_syscore_ops = { 3049 + static const struct syscore_ops amd_iommu_syscore_ops = { 3050 3050 .suspend = amd_iommu_suspend, 3051 3051 .resume = amd_iommu_resume, 3052 + }; 3053 + 3054 + static struct syscore amd_iommu_syscore = { 3055 + .ops = &amd_iommu_syscore_ops, 3052 3056 }; 3053 3057 3054 3058 static void __init free_iommu_resources(void) ··· 3399 3395 init_state = IOMMU_ENABLED; 3400 3396 break; 3401 3397 case IOMMU_ENABLED: 3402 - register_syscore_ops(&amd_iommu_syscore_ops); 3398 + register_syscore(&amd_iommu_syscore); 3403 3399 iommu_snp_enable(); 3404 3400 ret = amd_iommu_init_pci(); 3405 3401 init_state = ret ? IOMMU_INIT_ERROR : IOMMU_PCI_INIT; ··· 3502 3498 3503 3499 void amd_iommu_disable(void) 3504 3500 { 3505 - amd_iommu_suspend(); 3501 + amd_iommu_suspend(NULL); 3506 3502 } 3507 3503 3508 3504 int amd_iommu_reenable(int mode) 3509 3505 { 3510 - amd_iommu_resume(); 3506 + amd_iommu_resume(NULL); 3511 3507 3512 3508 return 0; 3513 3509 }
+8 -4
drivers/iommu/intel/iommu.c
··· 2303 2303 } 2304 2304 } 2305 2305 2306 - static int iommu_suspend(void) 2306 + static int iommu_suspend(void *data) 2307 2307 { 2308 2308 struct dmar_drhd_unit *drhd; 2309 2309 struct intel_iommu *iommu = NULL; ··· 2330 2330 return 0; 2331 2331 } 2332 2332 2333 - static void iommu_resume(void) 2333 + static void iommu_resume(void *data) 2334 2334 { 2335 2335 struct dmar_drhd_unit *drhd; 2336 2336 struct intel_iommu *iommu = NULL; ··· 2361 2361 } 2362 2362 } 2363 2363 2364 - static struct syscore_ops iommu_syscore_ops = { 2364 + static const struct syscore_ops iommu_syscore_ops = { 2365 2365 .resume = iommu_resume, 2366 2366 .suspend = iommu_suspend, 2367 2367 }; 2368 2368 2369 + static struct syscore iommu_syscore = { 2370 + .ops = &iommu_syscore_ops, 2371 + }; 2372 + 2369 2373 static void __init init_iommu_pm_ops(void) 2370 2374 { 2371 - register_syscore_ops(&iommu_syscore_ops); 2375 + register_syscore(&iommu_syscore); 2372 2376 } 2373 2377 2374 2378 #else
+10 -4
drivers/irqchip/exynos-combiner.c
··· 200 200 201 201 /** 202 202 * combiner_suspend - save interrupt combiner state before suspend 203 + * @data: syscore context 203 204 * 204 205 * Save the interrupt enable set register for all combiner groups since 205 206 * the state is lost when the system enters into a sleep state. 206 207 * 207 208 */ 208 - static int combiner_suspend(void) 209 + static int combiner_suspend(void *data) 209 210 { 210 211 int i; 211 212 ··· 219 218 220 219 /** 221 220 * combiner_resume - restore interrupt combiner state after resume 221 + * @data: syscore context 222 222 * 223 223 * Restore the interrupt enable set register for all combiner groups since 224 224 * the state is lost when the system enters into a sleep state on suspend. 225 225 * 226 226 */ 227 - static void combiner_resume(void) 227 + static void combiner_resume(void *data) 228 228 { 229 229 int i; 230 230 ··· 242 240 #define combiner_resume NULL 243 241 #endif 244 242 245 - static struct syscore_ops combiner_syscore_ops = { 243 + static const struct syscore_ops combiner_syscore_ops = { 246 244 .suspend = combiner_suspend, 247 245 .resume = combiner_resume, 246 + }; 247 + 248 + static struct syscore combiner_syscore = { 249 + .ops = &combiner_syscore_ops, 248 250 }; 249 251 250 252 static int __init combiner_of_init(struct device_node *np, ··· 270 264 271 265 combiner_init(combiner_base, np); 272 266 273 - register_syscore_ops(&combiner_syscore_ops); 267 + register_syscore(&combiner_syscore); 274 268 275 269 return 0; 276 270 }
+8 -4
drivers/irqchip/irq-armada-370-xp.c
··· 726 726 } while (1); 727 727 } 728 728 729 - static int mpic_suspend(void) 729 + static int mpic_suspend(void *data) 730 730 { 731 731 struct mpic *mpic = mpic_data; 732 732 ··· 735 735 return 0; 736 736 } 737 737 738 - static void mpic_resume(void) 738 + static void mpic_resume(void *data) 739 739 { 740 740 struct mpic *mpic = mpic_data; 741 741 bool src0, src1; ··· 788 788 mpic_ipi_resume(mpic); 789 789 } 790 790 791 - static struct syscore_ops mpic_syscore_ops = { 791 + static const struct syscore_ops mpic_syscore_ops = { 792 792 .suspend = mpic_suspend, 793 793 .resume = mpic_resume, 794 + }; 795 + 796 + static struct syscore mpic_syscore = { 797 + .ops = &mpic_syscore_ops, 794 798 }; 795 799 796 800 static int __init mpic_map_region(struct device_node *np, int index, ··· 909 905 mpic_handle_cascade_irq, mpic); 910 906 } 911 907 912 - register_syscore_ops(&mpic_syscore_ops); 908 + register_syscore(&mpic_syscore); 913 909 914 910 return 0; 915 911 }
+8 -4
drivers/irqchip/irq-bcm7038-l1.c
··· 292 292 static LIST_HEAD(bcm7038_l1_intcs_list); 293 293 static DEFINE_RAW_SPINLOCK(bcm7038_l1_intcs_lock); 294 294 295 - static int bcm7038_l1_suspend(void) 295 + static int bcm7038_l1_suspend(void *data) 296 296 { 297 297 struct bcm7038_l1_chip *intc; 298 298 int boot_cpu, word; ··· 318 318 return 0; 319 319 } 320 320 321 - static void bcm7038_l1_resume(void) 321 + static void bcm7038_l1_resume(void *data) 322 322 { 323 323 struct bcm7038_l1_chip *intc; 324 324 int boot_cpu, word; ··· 339 339 } 340 340 } 341 341 342 - static struct syscore_ops bcm7038_l1_syscore_ops = { 342 + static const struct syscore_ops bcm7038_l1_syscore_ops = { 343 343 .suspend = bcm7038_l1_suspend, 344 344 .resume = bcm7038_l1_resume, 345 + }; 346 + 347 + static struct syscore bcm7038_l1_syscore = { 348 + .ops = &bcm7038_l1_syscore_ops, 345 349 }; 346 350 347 351 static int bcm7038_l1_set_wake(struct irq_data *d, unsigned int on) ··· 435 431 raw_spin_unlock(&bcm7038_l1_intcs_lock); 436 432 437 433 if (list_is_singular(&bcm7038_l1_intcs_list)) 438 - register_syscore_ops(&bcm7038_l1_syscore_ops); 434 + register_syscore(&bcm7038_l1_syscore); 439 435 #endif 440 436 441 437 pr_info("registered BCM7038 L1 intc (%pOF, IRQs: %d)\n",
+8 -4
drivers/irqchip/irq-gic-v3-its.c
··· 4992 4992 its_quirks, its); 4993 4993 } 4994 4994 4995 - static int its_save_disable(void) 4995 + static int its_save_disable(void *data) 4996 4996 { 4997 4997 struct its_node *its; 4998 4998 int err = 0; ··· 5028 5028 return err; 5029 5029 } 5030 5030 5031 - static void its_restore_enable(void) 5031 + static void its_restore_enable(void *data) 5032 5032 { 5033 5033 struct its_node *its; 5034 5034 int ret; ··· 5088 5088 raw_spin_unlock(&its_lock); 5089 5089 } 5090 5090 5091 - static struct syscore_ops its_syscore_ops = { 5091 + static const struct syscore_ops its_syscore_ops = { 5092 5092 .suspend = its_save_disable, 5093 5093 .resume = its_restore_enable, 5094 + }; 5095 + 5096 + static struct syscore its_syscore = { 5097 + .ops = &its_syscore_ops, 5094 5098 }; 5095 5099 5096 5100 static void __init __iomem *its_map_one(struct resource *res, int *err) ··· 5868 5864 } 5869 5865 } 5870 5866 5871 - register_syscore_ops(&its_syscore_ops); 5867 + register_syscore(&its_syscore); 5872 5868 5873 5869 return 0; 5874 5870 }
+8 -4
drivers/irqchip/irq-i8259.c
··· 202 202 } 203 203 } 204 204 205 - static void i8259A_resume(void) 205 + static void i8259A_resume(void *data) 206 206 { 207 207 if (i8259A_auto_eoi >= 0) 208 208 init_8259A(i8259A_auto_eoi); 209 209 } 210 210 211 - static void i8259A_shutdown(void) 211 + static void i8259A_shutdown(void *data) 212 212 { 213 213 /* Put the i8259A into a quiescent state that 214 214 * the kernel initialization code can get it ··· 220 220 } 221 221 } 222 222 223 - static struct syscore_ops i8259_syscore_ops = { 223 + static const struct syscore_ops i8259_syscore_ops = { 224 224 .resume = i8259A_resume, 225 225 .shutdown = i8259A_shutdown, 226 + }; 227 + 228 + static struct syscore i8259_syscore = { 229 + .ops = &i8259_syscore_ops, 226 230 }; 227 231 228 232 static void init_8259A(int auto_eoi) ··· 324 320 325 321 if (request_irq(irq, no_action, IRQF_NO_THREAD, "cascade", NULL)) 326 322 pr_err("Failed to register cascade interrupt\n"); 327 - register_syscore_ops(&i8259_syscore_ops); 323 + register_syscore(&i8259_syscore); 328 324 return domain; 329 325 } 330 326
+10 -6
drivers/irqchip/irq-imx-gpcv2.c
··· 33 33 return cd->gpc_base + cd->cpu2wakeup + i * 4; 34 34 } 35 35 36 - static int gpcv2_wakeup_source_save(void) 36 + static int gpcv2_wakeup_source_save(void *data) 37 37 { 38 38 struct gpcv2_irqchip_data *cd; 39 39 void __iomem *reg; ··· 52 52 return 0; 53 53 } 54 54 55 - static void gpcv2_wakeup_source_restore(void) 55 + static void gpcv2_wakeup_source_restore(void *data) 56 56 { 57 57 struct gpcv2_irqchip_data *cd; 58 58 int i; ··· 65 65 writel_relaxed(cd->saved_irq_mask[i], gpcv2_idx_to_reg(cd, i)); 66 66 } 67 67 68 - static struct syscore_ops imx_gpcv2_syscore_ops = { 69 - .suspend = gpcv2_wakeup_source_save, 70 - .resume = gpcv2_wakeup_source_restore, 68 + static const struct syscore_ops gpcv2_syscore_ops = { 69 + .suspend = gpcv2_wakeup_source_save, 70 + .resume = gpcv2_wakeup_source_restore, 71 + }; 72 + 73 + static struct syscore gpcv2_syscore = { 74 + .ops = &gpcv2_syscore_ops, 71 75 }; 72 76 73 77 static int imx_gpcv2_irq_set_wake(struct irq_data *d, unsigned int on) ··· 280 276 writel_relaxed(~0x1, cd->gpc_base + cd->cpu2wakeup); 281 277 282 278 imx_gpcv2_instance = cd; 283 - register_syscore_ops(&imx_gpcv2_syscore_ops); 279 + register_syscore(&gpcv2_syscore); 284 280 285 281 /* 286 282 * Clear the OF_POPULATED flag set in of_irq_init so that
+8 -4
drivers/irqchip/irq-loongson-eiointc.c
··· 407 407 return NULL; 408 408 } 409 409 410 - static int eiointc_suspend(void) 410 + static int eiointc_suspend(void *data) 411 411 { 412 412 return 0; 413 413 } 414 414 415 - static void eiointc_resume(void) 415 + static void eiointc_resume(void *data) 416 416 { 417 417 eiointc_router_init(0); 418 418 } 419 419 420 - static struct syscore_ops eiointc_syscore_ops = { 420 + static const struct syscore_ops eiointc_syscore_ops = { 421 421 .suspend = eiointc_suspend, 422 422 .resume = eiointc_resume, 423 + }; 424 + 425 + static struct syscore eiointc_syscore = { 426 + .ops = &eiointc_syscore_ops, 423 427 }; 424 428 425 429 static int __init pch_pic_parse_madt(union acpi_subtable_headers *header, ··· 544 540 eiointc_router_init(0); 545 541 546 542 if (nr_pics == 1) { 547 - register_syscore_ops(&eiointc_syscore_ops); 543 + register_syscore(&eiointc_syscore); 548 544 cpuhp_setup_state_nocalls(CPUHP_AP_IRQ_EIOINTC_STARTING, 549 545 "irqchip/loongarch/eiointc:starting", 550 546 eiointc_router_init, NULL);
+7 -3
drivers/irqchip/irq-loongson-htpic.c
··· 71 71 writel(0xffff, htpic->base + HTINT_EN_OFF); 72 72 } 73 73 74 - static void htpic_resume(void) 74 + static void htpic_resume(void *data) 75 75 { 76 76 htpic_reg_init(); 77 77 } 78 78 79 - struct syscore_ops htpic_syscore_ops = { 79 + static const struct syscore_ops htpic_syscore_ops = { 80 80 .resume = htpic_resume, 81 + }; 82 + 83 + static struct syscore htpic_syscore = { 84 + .ops = &htpic_syscore_ops, 81 85 }; 82 86 83 87 static int __init htpic_of_init(struct device_node *node, struct device_node *parent) ··· 134 130 htpic_irq_dispatch, htpic); 135 131 } 136 132 137 - register_syscore_ops(&htpic_syscore_ops); 133 + register_syscore(&htpic_syscore); 138 134 139 135 return 0; 140 136
+8 -4
drivers/irqchip/irq-loongson-htvec.c
··· 159 159 } 160 160 } 161 161 162 - static int htvec_suspend(void) 162 + static int htvec_suspend(void *data) 163 163 { 164 164 int i; 165 165 ··· 169 169 return 0; 170 170 } 171 171 172 - static void htvec_resume(void) 172 + static void htvec_resume(void *data) 173 173 { 174 174 int i; 175 175 ··· 177 177 writel(htvec_priv->saved_vec_en[i], htvec_priv->base + HTVEC_EN_OFF + 4 * i); 178 178 } 179 179 180 - static struct syscore_ops htvec_syscore_ops = { 180 + static const struct syscore_ops htvec_syscore_ops = { 181 181 .suspend = htvec_suspend, 182 182 .resume = htvec_resume, 183 + }; 184 + 185 + static struct syscore htvec_syscore = { 186 + .ops = &htvec_syscore_ops, 183 187 }; 184 188 185 189 static int htvec_init(phys_addr_t addr, unsigned long size, ··· 218 214 219 215 htvec_priv = priv; 220 216 221 - register_syscore_ops(&htvec_syscore_ops); 217 + register_syscore(&htvec_syscore); 222 218 223 219 return 0; 224 220
+8 -4
drivers/irqchip/irq-loongson-pch-lpc.c
··· 151 151 (readl(priv->base + LPC_INT_STS) == 0xffffffff); 152 152 } 153 153 154 - static int pch_lpc_suspend(void) 154 + static int pch_lpc_suspend(void *data) 155 155 { 156 156 pch_lpc_priv->saved_reg_ctl = readl(pch_lpc_priv->base + LPC_INT_CTL); 157 157 pch_lpc_priv->saved_reg_ena = readl(pch_lpc_priv->base + LPC_INT_ENA); ··· 159 159 return 0; 160 160 } 161 161 162 - static void pch_lpc_resume(void) 162 + static void pch_lpc_resume(void *data) 163 163 { 164 164 writel(pch_lpc_priv->saved_reg_ctl, pch_lpc_priv->base + LPC_INT_CTL); 165 165 writel(pch_lpc_priv->saved_reg_ena, pch_lpc_priv->base + LPC_INT_ENA); 166 166 writel(pch_lpc_priv->saved_reg_pol, pch_lpc_priv->base + LPC_INT_POL); 167 167 } 168 168 169 - static struct syscore_ops pch_lpc_syscore_ops = { 169 + static const struct syscore_ops pch_lpc_syscore_ops = { 170 170 .suspend = pch_lpc_suspend, 171 171 .resume = pch_lpc_resume, 172 + }; 173 + 174 + static struct syscore pch_lpc_syscore = { 175 + .ops = &pch_lpc_syscore_ops, 172 176 }; 173 177 174 178 int __init pch_lpc_acpi_init(struct irq_domain *parent, ··· 226 222 227 223 pch_lpc_priv = priv; 228 224 pch_lpc_handle = irq_handle; 229 - register_syscore_ops(&pch_lpc_syscore_ops); 225 + register_syscore(&pch_lpc_syscore); 230 226 231 227 return 0; 232 228
+8 -4
drivers/irqchip/irq-loongson-pch-pic.c
··· 278 278 } 279 279 } 280 280 281 - static int pch_pic_suspend(void) 281 + static int pch_pic_suspend(void *data) 282 282 { 283 283 int i, j; 284 284 ··· 296 296 return 0; 297 297 } 298 298 299 - static void pch_pic_resume(void) 299 + static void pch_pic_resume(void *data) 300 300 { 301 301 int i, j; 302 302 ··· 313 313 } 314 314 } 315 315 316 - static struct syscore_ops pch_pic_syscore_ops = { 316 + static const struct syscore_ops pch_pic_syscore_ops = { 317 317 .suspend = pch_pic_suspend, 318 318 .resume = pch_pic_resume, 319 + }; 320 + 321 + static struct syscore pch_pic_syscore = { 322 + .ops = &pch_pic_syscore_ops, 319 323 }; 320 324 321 325 static int pch_pic_init(phys_addr_t addr, unsigned long size, int vec_base, ··· 360 356 pch_pic_priv[nr_pics++] = priv; 361 357 362 358 if (nr_pics == 1) 363 - register_syscore_ops(&pch_pic_syscore_ops); 359 + register_syscore(&pch_pic_syscore); 364 360 365 361 return 0; 366 362
+8 -4
drivers/irqchip/irq-mchp-eic.c
··· 109 109 return 0; 110 110 } 111 111 112 - static int mchp_eic_irq_suspend(void) 112 + static int mchp_eic_irq_suspend(void *data) 113 113 { 114 114 unsigned int hwirq; 115 115 ··· 123 123 return 0; 124 124 } 125 125 126 - static void mchp_eic_irq_resume(void) 126 + static void mchp_eic_irq_resume(void *data) 127 127 { 128 128 unsigned int hwirq; 129 129 ··· 135 135 MCHP_EIC_SCFG(hwirq)); 136 136 } 137 137 138 - static struct syscore_ops mchp_eic_syscore_ops = { 138 + static const struct syscore_ops mchp_eic_syscore_ops = { 139 139 .suspend = mchp_eic_irq_suspend, 140 140 .resume = mchp_eic_irq_resume, 141 + }; 142 + 143 + static struct syscore mchp_eic_syscore = { 144 + .ops = &mchp_eic_syscore_ops, 141 145 }; 142 146 143 147 static struct irq_chip mchp_eic_chip = { ··· 261 257 goto clk_unprepare; 262 258 } 263 259 264 - register_syscore_ops(&mchp_eic_syscore_ops); 260 + register_syscore(&mchp_eic_syscore); 265 261 266 262 pr_info("%pOF: EIC registered, nr_irqs %u\n", node, MCHP_EIC_NIRQ); 267 263
+8 -4
drivers/irqchip/irq-mst-intc.c
··· 143 143 writew_relaxed(cd->saved_polarity_conf[i], addr + i * 4); 144 144 } 145 145 146 - static void mst_irq_resume(void) 146 + static void mst_irq_resume(void *data) 147 147 { 148 148 struct mst_intc_chip_data *cd; 149 149 ··· 151 151 mst_intc_polarity_restore(cd); 152 152 } 153 153 154 - static int mst_irq_suspend(void) 154 + static int mst_irq_suspend(void *data) 155 155 { 156 156 struct mst_intc_chip_data *cd; 157 157 ··· 160 160 return 0; 161 161 } 162 162 163 - static struct syscore_ops mst_irq_syscore_ops = { 163 + static const struct syscore_ops mst_irq_syscore_ops = { 164 164 .suspend = mst_irq_suspend, 165 165 .resume = mst_irq_resume, 166 166 }; 167 167 168 + static struct syscore mst_irq_syscore = { 169 + .ops = &mst_irq_syscore_ops, 170 + }; 171 + 168 172 static int __init mst_irq_pm_init(void) 169 173 { 170 - register_syscore_ops(&mst_irq_syscore_ops); 174 + register_syscore(&mst_irq_syscore); 171 175 return 0; 172 176 } 173 177 late_initcall(mst_irq_pm_init);
+8 -4
drivers/irqchip/irq-mtk-cirq.c
··· 199 199 }; 200 200 201 201 #ifdef CONFIG_PM_SLEEP 202 - static int mtk_cirq_suspend(void) 202 + static int mtk_cirq_suspend(void *data) 203 203 { 204 204 void __iomem *reg; 205 205 u32 value, mask; ··· 257 257 return 0; 258 258 } 259 259 260 - static void mtk_cirq_resume(void) 260 + static void mtk_cirq_resume(void *data) 261 261 { 262 262 void __iomem *reg = mtk_cirq_reg(cirq_data, CIRQ_CONTROL); 263 263 u32 value; ··· 272 272 writel_relaxed(value, reg); 273 273 } 274 274 275 - static struct syscore_ops mtk_cirq_syscore_ops = { 275 + static const struct syscore_ops mtk_cirq_syscore_ops = { 276 276 .suspend = mtk_cirq_suspend, 277 277 .resume = mtk_cirq_resume, 278 278 }; 279 279 280 + static struct syscore mtk_cirq_syscore = { 281 + .ops = &mtk_cirq_syscore_ops, 282 + }; 283 + 280 284 static void mtk_cirq_syscore_init(void) 281 285 { 282 - register_syscore_ops(&mtk_cirq_syscore_ops); 286 + register_syscore(&mtk_cirq_syscore); 283 287 } 284 288 #else 285 289 static inline void mtk_cirq_syscore_init(void) {}
+8 -4
drivers/irqchip/irq-renesas-rzg2l.c
··· 399 399 return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH); 400 400 } 401 401 402 - static int rzg2l_irqc_irq_suspend(void) 402 + static int rzg2l_irqc_irq_suspend(void *data) 403 403 { 404 404 struct rzg2l_irqc_reg_cache *cache = &rzg2l_irqc_data->cache; 405 405 void __iomem *base = rzg2l_irqc_data->base; ··· 411 411 return 0; 412 412 } 413 413 414 - static void rzg2l_irqc_irq_resume(void) 414 + static void rzg2l_irqc_irq_resume(void *data) 415 415 { 416 416 struct rzg2l_irqc_reg_cache *cache = &rzg2l_irqc_data->cache; 417 417 void __iomem *base = rzg2l_irqc_data->base; ··· 426 426 writel_relaxed(cache->iitsr, base + IITSR); 427 427 } 428 428 429 - static struct syscore_ops rzg2l_irqc_syscore_ops = { 429 + static const struct syscore_ops rzg2l_irqc_syscore_ops = { 430 430 .suspend = rzg2l_irqc_irq_suspend, 431 431 .resume = rzg2l_irqc_irq_resume, 432 + }; 433 + 434 + static struct syscore rzg2l_irqc_syscore = { 435 + .ops = &rzg2l_irqc_syscore_ops, 432 436 }; 433 437 434 438 static const struct irq_chip rzg2l_irqc_chip = { ··· 585 581 return -ENOMEM; 586 582 } 587 583 588 - register_syscore_ops(&rzg2l_irqc_syscore_ops); 584 + register_syscore(&rzg2l_irqc_syscore); 589 585 590 586 /* 591 587 * Prevent the cleanup function from invoking put_device by assigning
+8 -4
drivers/irqchip/irq-sa11x0.c
··· 85 85 unsigned int iccr; 86 86 } sa1100irq_state; 87 87 88 - static int sa1100irq_suspend(void) 88 + static int sa1100irq_suspend(void *data) 89 89 { 90 90 struct sa1100irq_state *st = &sa1100irq_state; 91 91 ··· 102 102 return 0; 103 103 } 104 104 105 - static void sa1100irq_resume(void) 105 + static void sa1100irq_resume(void *data) 106 106 { 107 107 struct sa1100irq_state *st = &sa1100irq_state; 108 108 ··· 114 114 } 115 115 } 116 116 117 - static struct syscore_ops sa1100irq_syscore_ops = { 117 + static const struct syscore_ops sa1100irq_syscore_ops = { 118 118 .suspend = sa1100irq_suspend, 119 119 .resume = sa1100irq_resume, 120 120 }; 121 121 122 + static struct syscore sa1100irq_syscore = { 123 + .ops = &sa1100irq_syscore_ops, 124 + }; 125 + 122 126 static int __init sa1100irq_init_devicefs(void) 123 127 { 124 - register_syscore_ops(&sa1100irq_syscore_ops); 128 + register_syscore(&sa1100irq_syscore); 125 129 return 0; 126 130 } 127 131
+8 -4
drivers/irqchip/irq-sifive-plic.c
··· 245 245 return IRQ_SET_MASK_OK; 246 246 } 247 247 248 - static int plic_irq_suspend(void) 248 + static int plic_irq_suspend(void *data) 249 249 { 250 250 unsigned int i, cpu; 251 251 unsigned long flags; ··· 277 277 return 0; 278 278 } 279 279 280 - static void plic_irq_resume(void) 280 + static void plic_irq_resume(void *data) 281 281 { 282 282 unsigned int i, index, cpu; 283 283 unsigned long flags; ··· 308 308 } 309 309 } 310 310 311 - static struct syscore_ops plic_irq_syscore_ops = { 311 + static const struct syscore_ops plic_irq_syscore_ops = { 312 312 .suspend = plic_irq_suspend, 313 313 .resume = plic_irq_resume, 314 + }; 315 + 316 + static struct syscore plic_irq_syscore = { 317 + .ops = &plic_irq_syscore_ops, 314 318 }; 315 319 316 320 static int plic_irqdomain_map(struct irq_domain *d, unsigned int irq, ··· 682 678 cpuhp_setup_state(CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING, 683 679 "irqchip/sifive/plic:starting", 684 680 plic_starting_cpu, plic_dying_cpu); 685 - register_syscore_ops(&plic_irq_syscore_ops); 681 + register_syscore(&plic_irq_syscore); 686 682 plic_global_setup_done = true; 687 683 } 688 684 }
+11 -7
drivers/irqchip/irq-sun6i-r.c
··· 268 268 .free = irq_domain_free_irqs_common, 269 269 }; 270 270 271 - static int sun6i_r_intc_suspend(void) 271 + static int sun6i_r_intc_suspend(void *data) 272 272 { 273 273 u32 buf[BITS_TO_U32(MAX(SUN6I_NR_TOP_LEVEL_IRQS, SUN6I_NR_MUX_BITS))]; 274 274 int i; ··· 284 284 return 0; 285 285 } 286 286 287 - static void sun6i_r_intc_resume(void) 287 + static void sun6i_r_intc_resume(void *data) 288 288 { 289 289 int i; 290 290 ··· 294 294 writel_relaxed(0, base + SUN6I_IRQ_ENABLE(i)); 295 295 } 296 296 297 - static void sun6i_r_intc_shutdown(void) 297 + static void sun6i_r_intc_shutdown(void *data) 298 298 { 299 - sun6i_r_intc_suspend(); 299 + sun6i_r_intc_suspend(data); 300 300 } 301 301 302 - static struct syscore_ops sun6i_r_intc_syscore_ops = { 302 + static const struct syscore_ops sun6i_r_intc_syscore_ops = { 303 303 .suspend = sun6i_r_intc_suspend, 304 304 .resume = sun6i_r_intc_resume, 305 305 .shutdown = sun6i_r_intc_shutdown, 306 + }; 307 + 308 + static struct syscore sun6i_r_intc_syscore = { 309 + .ops = &sun6i_r_intc_syscore_ops, 306 310 }; 307 311 308 312 static int __init sun6i_r_intc_init(struct device_node *node, ··· 350 346 return -ENOMEM; 351 347 } 352 348 353 - register_syscore_ops(&sun6i_r_intc_syscore_ops); 349 + register_syscore(&sun6i_r_intc_syscore); 354 350 355 351 sun6i_r_intc_ack_nmi(); 356 - sun6i_r_intc_resume(); 352 + sun6i_r_intc_resume(NULL); 357 353 358 354 return 0; 359 355 }
+8 -4
drivers/irqchip/irq-tegra.c
··· 132 132 return 0; 133 133 } 134 134 135 - static int tegra_ictlr_suspend(void) 135 + static int tegra_ictlr_suspend(void *data) 136 136 { 137 137 unsigned long flags; 138 138 unsigned int i; ··· 161 161 return 0; 162 162 } 163 163 164 - static void tegra_ictlr_resume(void) 164 + static void tegra_ictlr_resume(void *data) 165 165 { 166 166 unsigned long flags; 167 167 unsigned int i; ··· 184 184 local_irq_restore(flags); 185 185 } 186 186 187 - static struct syscore_ops tegra_ictlr_syscore_ops = { 187 + static const struct syscore_ops tegra_ictlr_syscore_ops = { 188 188 .suspend = tegra_ictlr_suspend, 189 189 .resume = tegra_ictlr_resume, 190 190 }; 191 191 192 + static struct syscore tegra_ictlr_syscore = { 193 + .ops = &tegra_ictlr_syscore_ops, 194 + }; 195 + 192 196 static void tegra_ictlr_syscore_init(void) 193 197 { 194 - register_syscore_ops(&tegra_ictlr_syscore_ops); 198 + register_syscore(&tegra_ictlr_syscore); 195 199 } 196 200 #else 197 201 #define tegra_set_wake NULL
+8 -4
drivers/irqchip/irq-vic.c
··· 120 120 writel(~vic->soft_int, base + VIC_INT_SOFT_CLEAR); 121 121 } 122 122 123 - static void vic_resume(void) 123 + static void vic_resume(void *data) 124 124 { 125 125 int id; 126 126 ··· 146 146 writel(~vic->resume_irqs, base + VIC_INT_ENABLE_CLEAR); 147 147 } 148 148 149 - static int vic_suspend(void) 149 + static int vic_suspend(void *data) 150 150 { 151 151 int id; 152 152 ··· 156 156 return 0; 157 157 } 158 158 159 - static struct syscore_ops vic_syscore_ops = { 159 + static const struct syscore_ops vic_syscore_ops = { 160 160 .suspend = vic_suspend, 161 161 .resume = vic_resume, 162 + }; 163 + 164 + static struct syscore vic_syscore = { 165 + .ops = &vic_syscore_ops, 162 166 }; 163 167 164 168 /** ··· 175 171 static int __init vic_pm_init(void) 176 172 { 177 173 if (vic_id > 0) 178 - register_syscore_ops(&vic_syscore_ops); 174 + register_syscore(&vic_syscore); 179 175 180 176 return 0; 181 177 }
+9 -5
drivers/leds/trigger/ledtrig-cpu.c
··· 94 94 } 95 95 EXPORT_SYMBOL(ledtrig_cpu); 96 96 97 - static int ledtrig_cpu_syscore_suspend(void) 97 + static int ledtrig_cpu_syscore_suspend(void *data) 98 98 { 99 99 ledtrig_cpu(CPU_LED_STOP); 100 100 return 0; 101 101 } 102 102 103 - static void ledtrig_cpu_syscore_resume(void) 103 + static void ledtrig_cpu_syscore_resume(void *data) 104 104 { 105 105 ledtrig_cpu(CPU_LED_START); 106 106 } 107 107 108 - static void ledtrig_cpu_syscore_shutdown(void) 108 + static void ledtrig_cpu_syscore_shutdown(void *data) 109 109 { 110 110 ledtrig_cpu(CPU_LED_HALTED); 111 111 } 112 112 113 - static struct syscore_ops ledtrig_cpu_syscore_ops = { 113 + static const struct syscore_ops ledtrig_cpu_syscore_ops = { 114 114 .shutdown = ledtrig_cpu_syscore_shutdown, 115 115 .suspend = ledtrig_cpu_syscore_suspend, 116 116 .resume = ledtrig_cpu_syscore_resume, 117 + }; 118 + 119 + static struct syscore ledtrig_cpu_syscore = { 120 + .ops = &ledtrig_cpu_syscore_ops, 117 121 }; 118 122 119 123 static int ledtrig_online_cpu(unsigned int cpu) ··· 161 157 led_trigger_register_simple(trig->name, &trig->_trig); 162 158 } 163 159 164 - register_syscore_ops(&ledtrig_cpu_syscore_ops); 160 + register_syscore(&ledtrig_cpu_syscore); 165 161 166 162 ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "leds/trigger:starting", 167 163 ledtrig_online_cpu, ledtrig_prepare_down_cpu);
+8 -4
drivers/macintosh/via-pmu.c
··· 2600 2600 #if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32) 2601 2601 int pmu_sys_suspended; 2602 2602 2603 - static int pmu_syscore_suspend(void) 2603 + static int pmu_syscore_suspend(void *data) 2604 2604 { 2605 2605 /* Suspend PMU event interrupts */ 2606 2606 pmu_suspend(); ··· 2614 2614 return 0; 2615 2615 } 2616 2616 2617 - static void pmu_syscore_resume(void) 2617 + static void pmu_syscore_resume(void *data) 2618 2618 { 2619 2619 struct adb_request req; 2620 2620 ··· 2634 2634 pmu_sys_suspended = 0; 2635 2635 } 2636 2636 2637 - static struct syscore_ops pmu_syscore_ops = { 2637 + static const struct syscore_ops pmu_syscore_ops = { 2638 2638 .suspend = pmu_syscore_suspend, 2639 2639 .resume = pmu_syscore_resume, 2640 2640 }; 2641 2641 2642 + static struct syscore pmu_syscore = { 2643 + .ops = &pmu_syscore_ops, 2644 + }; 2645 + 2642 2646 static int pmu_syscore_register(void) 2643 2647 { 2644 - register_syscore_ops(&pmu_syscore_ops); 2648 + register_syscore(&pmu_syscore); 2645 2649 2646 2650 return 0; 2647 2651 }
+7 -3
drivers/power/reset/sc27xx-poweroff.c
··· 28 28 * taking cpus down to avoid racing regmap or spi mutex lock when poweroff 29 29 * system through PMIC. 30 30 */ 31 - static void sc27xx_poweroff_shutdown(void) 31 + static void sc27xx_poweroff_shutdown(void *data) 32 32 { 33 33 #ifdef CONFIG_HOTPLUG_CPU 34 34 int cpu; ··· 40 40 #endif 41 41 } 42 42 43 - static struct syscore_ops poweroff_syscore_ops = { 43 + static const struct syscore_ops poweroff_syscore_ops = { 44 44 .shutdown = sc27xx_poweroff_shutdown, 45 + }; 46 + 47 + static struct syscore poweroff_syscore = { 48 + .ops = &poweroff_syscore_ops, 45 49 }; 46 50 47 51 static void sc27xx_poweroff_do_poweroff(void) ··· 66 62 return -ENODEV; 67 63 68 64 pm_power_off = sc27xx_poweroff_do_poweroff; 69 - register_syscore_ops(&poweroff_syscore_ops); 65 + register_syscore(&poweroff_syscore); 70 66 return 0; 71 67 } 72 68
+7 -3
drivers/sh/clk/core.c
··· 569 569 EXPORT_SYMBOL_GPL(clk_round_rate); 570 570 571 571 #ifdef CONFIG_PM 572 - static void clks_core_resume(void) 572 + static void clks_core_resume(void *data) 573 573 { 574 574 struct clk *clkp; 575 575 ··· 588 588 } 589 589 } 590 590 591 - static struct syscore_ops clks_syscore_ops = { 591 + static const struct syscore_ops clks_syscore_ops = { 592 592 .resume = clks_core_resume, 593 + }; 594 + 595 + static struct syscore clks_syscore = { 596 + .ops = &clks_syscore_ops, 593 597 }; 594 598 595 599 static int __init clk_syscore_init(void) 596 600 { 597 - register_syscore_ops(&clks_syscore_ops); 601 + register_syscore(&clks_syscore); 598 602 599 603 return 0; 600 604 }
+8 -4
drivers/sh/intc/core.c
··· 394 394 return -ENOMEM; 395 395 } 396 396 397 - static int intc_suspend(void) 397 + static int intc_suspend(void *data) 398 398 { 399 399 struct intc_desc_int *d; 400 400 ··· 420 420 return 0; 421 421 } 422 422 423 - static void intc_resume(void) 423 + static void intc_resume(void *data) 424 424 { 425 425 struct intc_desc_int *d; 426 426 ··· 450 450 } 451 451 } 452 452 453 - struct syscore_ops intc_syscore_ops = { 453 + static const struct syscore_ops intc_syscore_ops = { 454 454 .suspend = intc_suspend, 455 455 .resume = intc_resume, 456 + }; 457 + 458 + static struct syscore intc_syscore = { 459 + .ops = &intc_syscore_ops, 456 460 }; 457 461 458 462 const struct bus_type intc_subsys = { ··· 481 477 struct intc_desc_int *d; 482 478 int error; 483 479 484 - register_syscore_ops(&intc_syscore_ops); 480 + register_syscore(&intc_syscore); 485 481 486 482 error = subsys_system_register(&intc_subsys, NULL); 487 483 if (!error) {
+8 -4
drivers/soc/bcm/brcmstb/biuctrl.c
··· 298 298 #ifdef CONFIG_PM_SLEEP 299 299 static u32 cpubiuctrl_reg_save[NUM_CPU_BIUCTRL_REGS]; 300 300 301 - static int brcmstb_cpu_credit_reg_suspend(void) 301 + static int brcmstb_cpu_credit_reg_suspend(void *data) 302 302 { 303 303 unsigned int i; 304 304 ··· 311 311 return 0; 312 312 } 313 313 314 - static void brcmstb_cpu_credit_reg_resume(void) 314 + static void brcmstb_cpu_credit_reg_resume(void *data) 315 315 { 316 316 unsigned int i; 317 317 ··· 322 322 cbc_writel(cpubiuctrl_reg_save[i], i); 323 323 } 324 324 325 - static struct syscore_ops brcmstb_cpu_credit_syscore_ops = { 325 + static const struct syscore_ops brcmstb_cpu_credit_syscore_ops = { 326 326 .suspend = brcmstb_cpu_credit_reg_suspend, 327 327 .resume = brcmstb_cpu_credit_reg_resume, 328 + }; 329 + 330 + static struct syscore brcmstb_cpu_credit_syscore = { 331 + .ops = &brcmstb_cpu_credit_syscore_ops, 328 332 }; 329 333 #endif 330 334 ··· 358 354 a72_b53_rac_enable_all(np); 359 355 mcp_a72_b53_set(); 360 356 #ifdef CONFIG_PM_SLEEP 361 - register_syscore_ops(&brcmstb_cpu_credit_syscore_ops); 357 + register_syscore(&brcmstb_cpu_credit_syscore); 362 358 #endif 363 359 ret = 0; 364 360 out_put:
+10 -7
drivers/soc/tegra/pmc.c
··· 466 466 unsigned long *wake_type_dual_edge_map; 467 467 unsigned long *wake_sw_status_map; 468 468 unsigned long *wake_cntrl_level_map; 469 - struct syscore_ops syscore; 469 + struct syscore syscore; 470 470 }; 471 471 472 472 static struct tegra_pmc *pmc = &(struct tegra_pmc) { ··· 3147 3147 } 3148 3148 } 3149 3149 3150 - static void tegra186_pmc_wake_syscore_resume(void) 3150 + static void tegra186_pmc_wake_syscore_resume(void *data) 3151 3151 { 3152 3152 u32 status, mask; 3153 3153 unsigned int i; ··· 3160 3160 } 3161 3161 } 3162 3162 3163 - static int tegra186_pmc_wake_syscore_suspend(void) 3163 + static int tegra186_pmc_wake_syscore_suspend(void *data) 3164 3164 { 3165 3165 wke_read_sw_wake_status(pmc); 3166 3166 ··· 3178 3178 3179 3179 return 0; 3180 3180 } 3181 + 3182 + static const struct syscore_ops tegra186_pmc_wake_syscore_ops = { 3183 + .suspend = tegra186_pmc_wake_syscore_suspend, 3184 + .resume = tegra186_pmc_wake_syscore_resume, 3185 + }; 3181 3186 3182 3187 #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM) 3183 3188 static int tegra_pmc_suspend(struct device *dev) ··· 3834 3829 3835 3830 static void tegra186_pmc_init(struct tegra_pmc *pmc) 3836 3831 { 3837 - pmc->syscore.suspend = tegra186_pmc_wake_syscore_suspend; 3838 - pmc->syscore.resume = tegra186_pmc_wake_syscore_resume; 3839 - 3840 - register_syscore_ops(&pmc->syscore); 3832 + pmc->syscore.ops = &tegra186_pmc_wake_syscore_ops; 3833 + register_syscore(&pmc->syscore); 3841 3834 } 3842 3835 3843 3836 static void tegra186_pmc_setup_irq_polarity(struct tegra_pmc *pmc,
+8 -4
drivers/thermal/intel/intel_hfi.c
··· 592 592 hfi_disable(); 593 593 } 594 594 595 - static void hfi_syscore_resume(void) 595 + static void hfi_syscore_resume(void *data) 596 596 { 597 597 /* This code runs only on the boot CPU. */ 598 598 struct hfi_cpu_info *info = &per_cpu(hfi_cpu_info, 0); ··· 603 603 hfi_enable_instance(hfi_instance); 604 604 } 605 605 606 - static int hfi_syscore_suspend(void) 606 + static int hfi_syscore_suspend(void *data) 607 607 { 608 608 /* No locking needed. There is no concurrency with CPU offline. */ 609 609 hfi_disable(); ··· 611 611 return 0; 612 612 } 613 613 614 - static struct syscore_ops hfi_pm_ops = { 614 + static const struct syscore_ops hfi_pm_ops = { 615 615 .resume = hfi_syscore_resume, 616 616 .suspend = hfi_syscore_suspend, 617 + }; 618 + 619 + static struct syscore hfi_pm = { 620 + .ops = &hfi_pm_ops, 617 621 }; 618 622 619 623 static int hfi_thermal_notify(struct notifier_block *nb, unsigned long state, ··· 714 710 if (thermal_genl_register_notifier(&hfi_thermal_nb)) 715 711 goto err_nl_notif; 716 712 717 - register_syscore_ops(&hfi_pm_ops); 713 + register_syscore(&hfi_pm); 718 714 719 715 return; 720 716
+8 -4
drivers/xen/xen-acpi-processor.c
··· 495 495 pr_info("ACPI data upload failed, error = %d\n", rc); 496 496 } 497 497 498 - static void xen_acpi_processor_resume(void) 498 + static void xen_acpi_processor_resume(void *data) 499 499 { 500 500 static DECLARE_WORK(wq, xen_acpi_processor_resume_worker); 501 501 ··· 509 509 schedule_work(&wq); 510 510 } 511 511 512 - static struct syscore_ops xap_syscore_ops = { 512 + static const struct syscore_ops xap_syscore_ops = { 513 513 .resume = xen_acpi_processor_resume, 514 + }; 515 + 516 + static struct syscore xap_syscore = { 517 + .ops = &xap_syscore_ops, 514 518 }; 515 519 516 520 static int __init xen_acpi_processor_init(void) ··· 567 563 if (rc) 568 564 goto err_unregister; 569 565 570 - register_syscore_ops(&xap_syscore_ops); 566 + register_syscore(&xap_syscore); 571 567 572 568 return 0; 573 569 err_unregister: ··· 584 580 { 585 581 int i; 586 582 587 - unregister_syscore_ops(&xap_syscore_ops); 583 + unregister_syscore(&xap_syscore); 588 584 bitmap_free(acpi_ids_done); 589 585 bitmap_free(acpi_id_present); 590 586 bitmap_free(acpi_id_cst_present);
+11 -6
include/linux/syscore_ops.h
··· 11 11 #include <linux/list.h> 12 12 13 13 struct syscore_ops { 14 - struct list_head node; 15 - int (*suspend)(void); 16 - void (*resume)(void); 17 - void (*shutdown)(void); 14 + int (*suspend)(void *data); 15 + void (*resume)(void *data); 16 + void (*shutdown)(void *data); 18 17 }; 19 18 20 - extern void register_syscore_ops(struct syscore_ops *ops); 21 - extern void unregister_syscore_ops(struct syscore_ops *ops); 19 + struct syscore { 20 + struct list_head node; 21 + const struct syscore_ops *ops; 22 + void *data; 23 + }; 24 + 25 + extern void register_syscore(struct syscore *syscore); 26 + extern void unregister_syscore(struct syscore *syscore); 22 27 #ifdef CONFIG_PM_SLEEP 23 28 extern int syscore_suspend(void); 24 29 extern void syscore_resume(void);
+8 -4
kernel/cpu_pm.c
··· 173 173 EXPORT_SYMBOL_GPL(cpu_cluster_pm_exit); 174 174 175 175 #ifdef CONFIG_PM 176 - static int cpu_pm_suspend(void) 176 + static int cpu_pm_suspend(void *data) 177 177 { 178 178 int ret; 179 179 ··· 185 185 return ret; 186 186 } 187 187 188 - static void cpu_pm_resume(void) 188 + static void cpu_pm_resume(void *data) 189 189 { 190 190 cpu_cluster_pm_exit(); 191 191 cpu_pm_exit(); 192 192 } 193 193 194 - static struct syscore_ops cpu_pm_syscore_ops = { 194 + static const struct syscore_ops cpu_pm_syscore_ops = { 195 195 .suspend = cpu_pm_suspend, 196 196 .resume = cpu_pm_resume, 197 197 }; 198 198 199 + static struct syscore cpu_pm_syscore = { 200 + .ops = &cpu_pm_syscore_ops, 201 + }; 202 + 199 203 static int cpu_pm_init(void) 200 204 { 201 - register_syscore_ops(&cpu_pm_syscore_ops); 205 + register_syscore(&cpu_pm_syscore); 202 206 return 0; 203 207 } 204 208 core_initcall(cpu_pm_init);
+9 -5
kernel/irq/generic-chip.c
··· 650 650 } 651 651 652 652 #ifdef CONFIG_PM 653 - static int irq_gc_suspend(void) 653 + static int irq_gc_suspend(void *data) 654 654 { 655 655 struct irq_chip_generic *gc; 656 656 ··· 670 670 return 0; 671 671 } 672 672 673 - static void irq_gc_resume(void) 673 + static void irq_gc_resume(void *data) 674 674 { 675 675 struct irq_chip_generic *gc; 676 676 ··· 693 693 #define irq_gc_resume NULL 694 694 #endif 695 695 696 - static void irq_gc_shutdown(void) 696 + static void irq_gc_shutdown(void *data) 697 697 { 698 698 struct irq_chip_generic *gc; 699 699 ··· 709 709 } 710 710 } 711 711 712 - static struct syscore_ops irq_gc_syscore_ops = { 712 + static const struct syscore_ops irq_gc_syscore_ops = { 713 713 .suspend = irq_gc_suspend, 714 714 .resume = irq_gc_resume, 715 715 .shutdown = irq_gc_shutdown, 716 716 }; 717 717 718 + static struct syscore irq_gc_syscore = { 719 + .ops = &irq_gc_syscore_ops, 720 + }; 721 + 718 722 static int __init irq_gc_init_ops(void) 719 723 { 720 - register_syscore_ops(&irq_gc_syscore_ops); 724 + register_syscore(&irq_gc_syscore); 721 725 return 0; 722 726 } 723 727 device_initcall(irq_gc_init_ops);
+8 -3
kernel/irq/pm.c
··· 211 211 212 212 /** 213 213 * irq_pm_syscore_resume - enable interrupt lines early 214 + * @data: syscore context 214 215 * 215 216 * Enable all interrupt lines with %IRQF_EARLY_RESUME set. 216 217 */ 217 - static void irq_pm_syscore_resume(void) 218 + static void irq_pm_syscore_resume(void *data) 218 219 { 219 220 resume_irqs(true); 220 221 } 221 222 222 - static struct syscore_ops irq_pm_syscore_ops = { 223 + static const struct syscore_ops irq_pm_syscore_ops = { 223 224 .resume = irq_pm_syscore_resume, 225 + }; 226 + 227 + static struct syscore irq_pm_syscore = { 228 + .ops = &irq_pm_syscore_ops, 224 229 }; 225 230 226 231 static int __init irq_pm_init_ops(void) 227 232 { 228 - register_syscore_ops(&irq_pm_syscore_ops); 233 + register_syscore(&irq_pm_syscore); 229 234 return 0; 230 235 } 231 236
+8 -3
kernel/printk/printk.c
··· 3639 3639 3640 3640 /** 3641 3641 * printk_kthreads_shutdown - shutdown all threaded printers 3642 + * @data: syscore context 3642 3643 * 3643 3644 * On system shutdown all threaded printers are stopped. This allows printk 3644 3645 * to transition back to atomic printing, thus providing a robust mechanism 3645 3646 * for the final shutdown/reboot messages to be output. 3646 3647 */ 3647 - static void printk_kthreads_shutdown(void) 3648 + static void printk_kthreads_shutdown(void *data) 3648 3649 { 3649 3650 struct console *con; 3650 3651 ··· 3667 3666 console_list_unlock(); 3668 3667 } 3669 3668 3670 - static struct syscore_ops printk_syscore_ops = { 3669 + static const struct syscore_ops printk_syscore_ops = { 3671 3670 .shutdown = printk_kthreads_shutdown, 3671 + }; 3672 + 3673 + static struct syscore printk_syscore = { 3674 + .ops = &printk_syscore_ops, 3672 3675 }; 3673 3676 3674 3677 /* ··· 3742 3737 3743 3738 static int __init printk_set_kthreads_ready(void) 3744 3739 { 3745 - register_syscore_ops(&printk_syscore_ops); 3740 + register_syscore(&printk_syscore); 3746 3741 3747 3742 console_list_lock(); 3748 3743 printk_kthreads_ready = true;
+18 -4
kernel/time/sched_clock.c
··· 296 296 return 0; 297 297 } 298 298 299 + static int sched_clock_syscore_suspend(void *data) 300 + { 301 + return sched_clock_suspend(); 302 + } 303 + 299 304 void sched_clock_resume(void) 300 305 { 301 306 struct clock_read_data *rd = &cd.read_data[0]; ··· 310 305 rd->read_sched_clock = cd.actual_read_sched_clock; 311 306 } 312 307 313 - static struct syscore_ops sched_clock_ops = { 314 - .suspend = sched_clock_suspend, 315 - .resume = sched_clock_resume, 308 + static void sched_clock_syscore_resume(void *data) 309 + { 310 + sched_clock_resume(); 311 + } 312 + 313 + static const struct syscore_ops sched_clock_syscore_ops = { 314 + .suspend = sched_clock_syscore_suspend, 315 + .resume = sched_clock_syscore_resume, 316 + }; 317 + 318 + static struct syscore sched_clock_syscore = { 319 + .ops = &sched_clock_syscore_ops, 316 320 }; 317 321 318 322 static int __init sched_clock_syscore_init(void) 319 323 { 320 - register_syscore_ops(&sched_clock_ops); 324 + register_syscore(&sched_clock_syscore); 321 325 322 326 return 0; 323 327 }
+18 -4
kernel/time/timekeeping.c
··· 1994 1994 timerfd_resume(); 1995 1995 } 1996 1996 1997 + static void timekeeping_syscore_resume(void *data) 1998 + { 1999 + timekeeping_resume(); 2000 + } 2001 + 1997 2002 int timekeeping_suspend(void) 1998 2003 { 1999 2004 struct timekeeper *tks = &tk_core.shadow_timekeeper; ··· 2066 2061 return 0; 2067 2062 } 2068 2063 2064 + static int timekeeping_syscore_suspend(void *data) 2065 + { 2066 + return timekeeping_suspend(); 2067 + } 2068 + 2069 2069 /* sysfs resume/suspend bits for timekeeping */ 2070 - static struct syscore_ops timekeeping_syscore_ops = { 2071 - .resume = timekeeping_resume, 2072 - .suspend = timekeeping_suspend, 2070 + static const struct syscore_ops timekeeping_syscore_ops = { 2071 + .resume = timekeeping_syscore_resume, 2072 + .suspend = timekeeping_syscore_suspend, 2073 + }; 2074 + 2075 + static struct syscore timekeeping_syscore = { 2076 + .ops = &timekeeping_syscore_ops, 2073 2077 }; 2074 2078 2075 2079 static int __init timekeeping_init_ops(void) 2076 2080 { 2077 - register_syscore_ops(&timekeeping_syscore_ops); 2081 + register_syscore(&timekeeping_syscore); 2078 2082 return 0; 2079 2083 } 2080 2084 device_initcall(timekeeping_init_ops);
+11 -7
virt/kvm/kvm_main.c
··· 5629 5629 return 0; 5630 5630 } 5631 5631 5632 - static void kvm_shutdown(void) 5632 + static void kvm_shutdown(void *data) 5633 5633 { 5634 5634 /* 5635 5635 * Disable hardware virtualization and set kvm_rebooting to indicate ··· 5647 5647 on_each_cpu(kvm_disable_virtualization_cpu, NULL, 1); 5648 5648 } 5649 5649 5650 - static int kvm_suspend(void) 5650 + static int kvm_suspend(void *data) 5651 5651 { 5652 5652 /* 5653 5653 * Secondary CPUs and CPU hotplug are disabled across the suspend/resume ··· 5664 5664 return 0; 5665 5665 } 5666 5666 5667 - static void kvm_resume(void) 5667 + static void kvm_resume(void *data) 5668 5668 { 5669 5669 lockdep_assert_not_held(&kvm_usage_lock); 5670 5670 lockdep_assert_irqs_disabled(); ··· 5672 5672 WARN_ON_ONCE(kvm_enable_virtualization_cpu()); 5673 5673 } 5674 5674 5675 - static struct syscore_ops kvm_syscore_ops = { 5675 + static const struct syscore_ops kvm_syscore_ops = { 5676 5676 .suspend = kvm_suspend, 5677 5677 .resume = kvm_resume, 5678 5678 .shutdown = kvm_shutdown, 5679 + }; 5680 + 5681 + static struct syscore kvm_syscore = { 5682 + .ops = &kvm_syscore_ops, 5679 5683 }; 5680 5684 5681 5685 int kvm_enable_virtualization(void) ··· 5698 5694 if (r) 5699 5695 goto err_cpuhp; 5700 5696 5701 - register_syscore_ops(&kvm_syscore_ops); 5697 + register_syscore(&kvm_syscore); 5702 5698 5703 5699 /* 5704 5700 * Undo virtualization enabling and bail if the system is going down. ··· 5720 5716 return 0; 5721 5717 5722 5718 err_rebooting: 5723 - unregister_syscore_ops(&kvm_syscore_ops); 5719 + unregister_syscore(&kvm_syscore); 5724 5720 cpuhp_remove_state(CPUHP_AP_KVM_ONLINE); 5725 5721 err_cpuhp: 5726 5722 kvm_arch_disable_virtualization(); ··· 5736 5732 if (--kvm_usage_count) 5737 5733 return; 5738 5734 5739 - unregister_syscore_ops(&kvm_syscore_ops); 5735 + unregister_syscore(&kvm_syscore); 5740 5736 cpuhp_remove_state(CPUHP_AP_KVM_ONLINE); 5741 5737 kvm_arch_disable_virtualization(); 5742 5738 }