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

Configure Feed

Select the types of activity you want to include in your feed.

mmc: dw_mmc-pltfm: use modern PM macros

Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP
are disabled, without having to use #ifdef guards.

When this's done, remove all variant drivers' local pm definition and
replace it with dw_mci_pltfm_pmops.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
[Ulf: Fixed conflict by dropping changes for dw_mmc-rockchip]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Shawn Lin and committed by
Ulf Hansson
2c7fe99a 765f4836

+6 -22
+1 -1
drivers/mmc/host/dw_mmc-bluefield.c
··· 73 73 .name = "dwmmc_bluefield", 74 74 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 75 75 .of_match_table = dw_mci_bluefield_match, 76 - .pm = &dw_mci_pltfm_pmops, 76 + .pm = pm_ptr(&dw_mci_pltfm_pmops), 77 77 }, 78 78 }; 79 79
+1 -6
drivers/mmc/host/dw_mmc-k3.c
··· 455 455 return dw_mci_pltfm_register(pdev, drv_data); 456 456 } 457 457 458 - static const struct dev_pm_ops dw_mci_k3_dev_pm_ops = { 459 - SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) 460 - RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_runtime_resume, NULL) 461 - }; 462 - 463 458 static struct platform_driver dw_mci_k3_pltfm_driver = { 464 459 .probe = dw_mci_k3_probe, 465 460 .remove = dw_mci_pltfm_remove, ··· 462 467 .name = "dwmmc_k3", 463 468 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 464 469 .of_match_table = dw_mci_k3_match, 465 - .pm = pm_ptr(&dw_mci_k3_dev_pm_ops), 470 + .pm = pm_ptr(&dw_mci_pltfm_pmops), 466 471 }, 467 472 }; 468 473
+2 -6
drivers/mmc/host/dw_mmc-pci.c
··· 16 16 #include <linux/mmc/host.h> 17 17 #include <linux/mmc/mmc.h> 18 18 #include "dw_mmc.h" 19 + #include "dw_mmc-pltfm.h" 19 20 20 21 #define SYNOPSYS_DW_MCI_VENDOR_ID 0x700 21 22 #define SYNOPSYS_DW_MCI_DEVICE_ID 0x1107 ··· 72 71 dw_mci_remove(host); 73 72 } 74 73 75 - static const struct dev_pm_ops dw_mci_pci_dev_pm_ops = { 76 - SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) 77 - RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_runtime_resume, NULL) 78 - }; 79 - 80 74 static const struct pci_device_id dw_mci_pci_id[] = { 81 75 { PCI_DEVICE(SYNOPSYS_DW_MCI_VENDOR_ID, SYNOPSYS_DW_MCI_DEVICE_ID) }, 82 76 {} ··· 84 88 .probe = dw_mci_pci_probe, 85 89 .remove = dw_mci_pci_remove, 86 90 .driver = { 87 - .pm = pm_ptr(&dw_mci_pci_dev_pm_ops), 91 + .pm = pm_ptr(&dw_mci_pltfm_pmops), 88 92 }, 89 93 }; 90 94
+2 -2
drivers/mmc/host/dw_mmc-pltfm.c
··· 57 57 EXPORT_SYMBOL_GPL(dw_mci_pltfm_register); 58 58 59 59 const struct dev_pm_ops dw_mci_pltfm_pmops = { 60 - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 60 + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 61 61 pm_runtime_force_resume) 62 - SET_RUNTIME_PM_OPS(dw_mci_runtime_suspend, 62 + RUNTIME_PM_OPS(dw_mci_runtime_suspend, 63 63 dw_mci_runtime_resume, 64 64 NULL) 65 65 };
-2
drivers/mmc/host/dw_mmc.c
··· 3440 3440 } 3441 3441 EXPORT_SYMBOL(dw_mci_remove); 3442 3442 3443 - #ifdef CONFIG_PM 3444 3443 int dw_mci_runtime_suspend(struct device *dev) 3445 3444 { 3446 3445 struct dw_mci *host = dev_get_drvdata(dev); ··· 3525 3526 return ret; 3526 3527 } 3527 3528 EXPORT_SYMBOL(dw_mci_runtime_resume); 3528 - #endif /* CONFIG_PM */ 3529 3529 3530 3530 static int __init dw_mci_init(void) 3531 3531 {
-5
drivers/mmc/host/dw_mmc.h
··· 497 497 extern struct dw_mci *dw_mci_alloc_host(struct device *device); 498 498 extern int dw_mci_probe(struct dw_mci *host); 499 499 extern void dw_mci_remove(struct dw_mci *host); 500 - #ifdef CONFIG_PM 501 500 extern int dw_mci_runtime_suspend(struct device *device); 502 501 extern int dw_mci_runtime_resume(struct device *device); 503 - #else 504 - static inline int dw_mci_runtime_suspend(struct device *device) { return -EOPNOTSUPP; } 505 - static inline int dw_mci_runtime_resume(struct device *device) { return -EOPNOTSUPP; } 506 - #endif 507 502 508 503 /** 509 504 * dw_mci driver data - dw-mshc implementation specific driver data.