Skip to content

Commit 19b7858

Browse files
committed
PCI: Convert to new *_PM_OPS macros
Replace SET_*_PM_OPS with *_PM_OPS, which which have the advantage that the compiler always sees the PM callbacks as referenced, so they don't need to be wrapped with "#ifdef CONFIG_PM_SLEEP" or tagged with "__maybe_unused" to avoid "defined but not used" warnings. See 1a3c7bb ("PM: core: Add new *_PM_OPS macros, deprecate old ones"). Link: https://lore.kernel.org/r/[email protected] Tested-by: Arnd Bergmann <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Pali Rohár <[email protected]> # pci-mvebu.c Reviewed-by: Arnd Bergmann <[email protected]>
1 parent f2906aa commit 19b7858

File tree

10 files changed

+35
-42
lines changed

10 files changed

+35
-42
lines changed

drivers/pci/controller/cadence/pcie-cadence.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie)
243243
return ret;
244244
}
245245

246-
#ifdef CONFIG_PM_SLEEP
247246
static int cdns_pcie_suspend_noirq(struct device *dev)
248247
{
249248
struct cdns_pcie *pcie = dev_get_drvdata(dev);
@@ -266,9 +265,8 @@ static int cdns_pcie_resume_noirq(struct device *dev)
266265

267266
return 0;
268267
}
269-
#endif
270268

271269
const struct dev_pm_ops cdns_pcie_pm_ops = {
272-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(cdns_pcie_suspend_noirq,
273-
cdns_pcie_resume_noirq)
270+
NOIRQ_SYSTEM_SLEEP_PM_OPS(cdns_pcie_suspend_noirq,
271+
cdns_pcie_resume_noirq)
274272
};

drivers/pci/controller/dwc/pci-dra7xx.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,6 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
862862
return ret;
863863
}
864864

865-
#ifdef CONFIG_PM_SLEEP
866865
static int dra7xx_pcie_suspend(struct device *dev)
867866
{
868867
struct dra7xx_pcie *dra7xx = dev_get_drvdata(dev);
@@ -919,7 +918,6 @@ static int dra7xx_pcie_resume_noirq(struct device *dev)
919918

920919
return 0;
921920
}
922-
#endif
923921

924922
static void dra7xx_pcie_shutdown(struct platform_device *pdev)
925923
{
@@ -940,9 +938,9 @@ static void dra7xx_pcie_shutdown(struct platform_device *pdev)
940938
}
941939

942940
static const struct dev_pm_ops dra7xx_pcie_pm_ops = {
943-
SET_SYSTEM_SLEEP_PM_OPS(dra7xx_pcie_suspend, dra7xx_pcie_resume)
944-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(dra7xx_pcie_suspend_noirq,
945-
dra7xx_pcie_resume_noirq)
941+
SYSTEM_SLEEP_PM_OPS(dra7xx_pcie_suspend, dra7xx_pcie_resume)
942+
NOIRQ_SYSTEM_SLEEP_PM_OPS(dra7xx_pcie_suspend_noirq,
943+
dra7xx_pcie_resume_noirq)
946944
};
947945

948946
static struct platform_driver dra7xx_pcie_driver = {

drivers/pci/controller/dwc/pci-exynos.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static int __exit exynos_pcie_remove(struct platform_device *pdev)
390390
return 0;
391391
}
392392

393-
static int __maybe_unused exynos_pcie_suspend_noirq(struct device *dev)
393+
static int exynos_pcie_suspend_noirq(struct device *dev)
394394
{
395395
struct exynos_pcie *ep = dev_get_drvdata(dev);
396396

@@ -402,7 +402,7 @@ static int __maybe_unused exynos_pcie_suspend_noirq(struct device *dev)
402402
return 0;
403403
}
404404

405-
static int __maybe_unused exynos_pcie_resume_noirq(struct device *dev)
405+
static int exynos_pcie_resume_noirq(struct device *dev)
406406
{
407407
struct exynos_pcie *ep = dev_get_drvdata(dev);
408408
struct dw_pcie *pci = &ep->pci;
@@ -421,8 +421,8 @@ static int __maybe_unused exynos_pcie_resume_noirq(struct device *dev)
421421
}
422422

423423
static const struct dev_pm_ops exynos_pcie_pm_ops = {
424-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(exynos_pcie_suspend_noirq,
425-
exynos_pcie_resume_noirq)
424+
NOIRQ_SYSTEM_SLEEP_PM_OPS(exynos_pcie_suspend_noirq,
425+
exynos_pcie_resume_noirq)
426426
};
427427

428428
static const struct of_device_id exynos_pcie_of_match[] = {

drivers/pci/controller/dwc/pcie-intel-gw.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ static int intel_pcie_remove(struct platform_device *pdev)
351351
return 0;
352352
}
353353

354-
static int __maybe_unused intel_pcie_suspend_noirq(struct device *dev)
354+
static int intel_pcie_suspend_noirq(struct device *dev)
355355
{
356356
struct intel_pcie *pcie = dev_get_drvdata(dev);
357357
int ret;
@@ -366,7 +366,7 @@ static int __maybe_unused intel_pcie_suspend_noirq(struct device *dev)
366366
return ret;
367367
}
368368

369-
static int __maybe_unused intel_pcie_resume_noirq(struct device *dev)
369+
static int intel_pcie_resume_noirq(struct device *dev)
370370
{
371371
struct intel_pcie *pcie = dev_get_drvdata(dev);
372372

@@ -442,8 +442,8 @@ static int intel_pcie_probe(struct platform_device *pdev)
442442
}
443443

444444
static const struct dev_pm_ops intel_pcie_pm_ops = {
445-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(intel_pcie_suspend_noirq,
446-
intel_pcie_resume_noirq)
445+
NOIRQ_SYSTEM_SLEEP_PM_OPS(intel_pcie_suspend_noirq,
446+
intel_pcie_resume_noirq)
447447
};
448448

449449
static const struct of_device_id of_intel_pcie_match[] = {

drivers/pci/controller/pci-mvebu.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,6 @@ static int mvebu_get_tgt_attr(struct device_node *np, int devfn,
12161216
return -ENOENT;
12171217
}
12181218

1219-
#ifdef CONFIG_PM_SLEEP
12201219
static int mvebu_pcie_suspend(struct device *dev)
12211220
{
12221221
struct mvebu_pcie *pcie;
@@ -1249,7 +1248,6 @@ static int mvebu_pcie_resume(struct device *dev)
12491248

12501249
return 0;
12511250
}
1252-
#endif
12531251

12541252
static void mvebu_pcie_port_clk_put(void *data)
12551253
{
@@ -1737,7 +1735,7 @@ static const struct of_device_id mvebu_pcie_of_match_table[] = {
17371735
};
17381736

17391737
static const struct dev_pm_ops mvebu_pcie_pm_ops = {
1740-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mvebu_pcie_suspend, mvebu_pcie_resume)
1738+
NOIRQ_SYSTEM_SLEEP_PM_OPS(mvebu_pcie_suspend, mvebu_pcie_resume)
17411739
};
17421740

17431741
static struct platform_driver mvebu_pcie_driver = {

drivers/pci/controller/pci-tegra.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,7 +2707,7 @@ static int tegra_pcie_remove(struct platform_device *pdev)
27072707
return 0;
27082708
}
27092709

2710-
static int __maybe_unused tegra_pcie_pm_suspend(struct device *dev)
2710+
static int tegra_pcie_pm_suspend(struct device *dev)
27112711
{
27122712
struct tegra_pcie *pcie = dev_get_drvdata(dev);
27132713
struct tegra_pcie_port *port;
@@ -2742,7 +2742,7 @@ static int __maybe_unused tegra_pcie_pm_suspend(struct device *dev)
27422742
return 0;
27432743
}
27442744

2745-
static int __maybe_unused tegra_pcie_pm_resume(struct device *dev)
2745+
static int tegra_pcie_pm_resume(struct device *dev)
27462746
{
27472747
struct tegra_pcie *pcie = dev_get_drvdata(dev);
27482748
int err;
@@ -2798,9 +2798,8 @@ static int __maybe_unused tegra_pcie_pm_resume(struct device *dev)
27982798
}
27992799

28002800
static const struct dev_pm_ops tegra_pcie_pm_ops = {
2801-
SET_RUNTIME_PM_OPS(tegra_pcie_pm_suspend, tegra_pcie_pm_resume, NULL)
2802-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(tegra_pcie_pm_suspend,
2803-
tegra_pcie_pm_resume)
2801+
RUNTIME_PM_OPS(tegra_pcie_pm_suspend, tegra_pcie_pm_resume, NULL)
2802+
NOIRQ_SYSTEM_SLEEP_PM_OPS(tegra_pcie_pm_suspend, tegra_pcie_pm_resume)
28042803
};
28052804

28062805
static struct platform_driver tegra_pcie_driver = {

drivers/pci/controller/pcie-mediatek-gen3.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ static int mtk_pcie_remove(struct platform_device *pdev)
917917
return 0;
918918
}
919919

920-
static void __maybe_unused mtk_pcie_irq_save(struct mtk_gen3_pcie *pcie)
920+
static void mtk_pcie_irq_save(struct mtk_gen3_pcie *pcie)
921921
{
922922
int i;
923923

@@ -935,7 +935,7 @@ static void __maybe_unused mtk_pcie_irq_save(struct mtk_gen3_pcie *pcie)
935935
raw_spin_unlock(&pcie->irq_lock);
936936
}
937937

938-
static void __maybe_unused mtk_pcie_irq_restore(struct mtk_gen3_pcie *pcie)
938+
static void mtk_pcie_irq_restore(struct mtk_gen3_pcie *pcie)
939939
{
940940
int i;
941941

@@ -953,7 +953,7 @@ static void __maybe_unused mtk_pcie_irq_restore(struct mtk_gen3_pcie *pcie)
953953
raw_spin_unlock(&pcie->irq_lock);
954954
}
955955

956-
static int __maybe_unused mtk_pcie_turn_off_link(struct mtk_gen3_pcie *pcie)
956+
static int mtk_pcie_turn_off_link(struct mtk_gen3_pcie *pcie)
957957
{
958958
u32 val;
959959

@@ -968,7 +968,7 @@ static int __maybe_unused mtk_pcie_turn_off_link(struct mtk_gen3_pcie *pcie)
968968
50 * USEC_PER_MSEC);
969969
}
970970

971-
static int __maybe_unused mtk_pcie_suspend_noirq(struct device *dev)
971+
static int mtk_pcie_suspend_noirq(struct device *dev)
972972
{
973973
struct mtk_gen3_pcie *pcie = dev_get_drvdata(dev);
974974
int err;
@@ -994,7 +994,7 @@ static int __maybe_unused mtk_pcie_suspend_noirq(struct device *dev)
994994
return 0;
995995
}
996996

997-
static int __maybe_unused mtk_pcie_resume_noirq(struct device *dev)
997+
static int mtk_pcie_resume_noirq(struct device *dev)
998998
{
999999
struct mtk_gen3_pcie *pcie = dev_get_drvdata(dev);
10001000
int err;
@@ -1015,8 +1015,8 @@ static int __maybe_unused mtk_pcie_resume_noirq(struct device *dev)
10151015
}
10161016

10171017
static const struct dev_pm_ops mtk_pcie_pm_ops = {
1018-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_pcie_suspend_noirq,
1019-
mtk_pcie_resume_noirq)
1018+
NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_pcie_suspend_noirq,
1019+
mtk_pcie_resume_noirq)
10201020
};
10211021

10221022
static const struct of_device_id mtk_pcie_of_match[] = {

drivers/pci/controller/pcie-mediatek.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ static int mtk_pcie_remove(struct platform_device *pdev)
11501150
return 0;
11511151
}
11521152

1153-
static int __maybe_unused mtk_pcie_suspend_noirq(struct device *dev)
1153+
static int mtk_pcie_suspend_noirq(struct device *dev)
11541154
{
11551155
struct mtk_pcie *pcie = dev_get_drvdata(dev);
11561156
struct mtk_pcie_port *port;
@@ -1174,7 +1174,7 @@ static int __maybe_unused mtk_pcie_suspend_noirq(struct device *dev)
11741174
return 0;
11751175
}
11761176

1177-
static int __maybe_unused mtk_pcie_resume_noirq(struct device *dev)
1177+
static int mtk_pcie_resume_noirq(struct device *dev)
11781178
{
11791179
struct mtk_pcie *pcie = dev_get_drvdata(dev);
11801180
struct mtk_pcie_port *port, *tmp;
@@ -1195,8 +1195,8 @@ static int __maybe_unused mtk_pcie_resume_noirq(struct device *dev)
11951195
}
11961196

11971197
static const struct dev_pm_ops mtk_pcie_pm_ops = {
1198-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_pcie_suspend_noirq,
1199-
mtk_pcie_resume_noirq)
1198+
NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_pcie_suspend_noirq,
1199+
mtk_pcie_resume_noirq)
12001200
};
12011201

12021202
static const struct mtk_pcie_soc mtk_pcie_soc_v1 = {

drivers/pci/controller/pcie-rcar-host.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
10721072
return err;
10731073
}
10741074

1075-
static int __maybe_unused rcar_pcie_resume(struct device *dev)
1075+
static int rcar_pcie_resume(struct device *dev)
10761076
{
10771077
struct rcar_pcie_host *host = dev_get_drvdata(dev);
10781078
struct rcar_pcie *pcie = &host->pcie;
@@ -1127,7 +1127,7 @@ static int rcar_pcie_resume_noirq(struct device *dev)
11271127
}
11281128

11291129
static const struct dev_pm_ops rcar_pcie_pm_ops = {
1130-
SET_SYSTEM_SLEEP_PM_OPS(NULL, rcar_pcie_resume)
1130+
SYSTEM_SLEEP_PM_OPS(NULL, rcar_pcie_resume)
11311131
.resume_noirq = rcar_pcie_resume_noirq,
11321132
};
11331133

drivers/pci/controller/pcie-rockchip-host.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ static int rockchip_pcie_wait_l2(struct rockchip_pcie *rockchip)
864864
return 0;
865865
}
866866

867-
static int __maybe_unused rockchip_pcie_suspend_noirq(struct device *dev)
867+
static int rockchip_pcie_suspend_noirq(struct device *dev)
868868
{
869869
struct rockchip_pcie *rockchip = dev_get_drvdata(dev);
870870
int ret;
@@ -889,7 +889,7 @@ static int __maybe_unused rockchip_pcie_suspend_noirq(struct device *dev)
889889
return ret;
890890
}
891891

892-
static int __maybe_unused rockchip_pcie_resume_noirq(struct device *dev)
892+
static int rockchip_pcie_resume_noirq(struct device *dev)
893893
{
894894
struct rockchip_pcie *rockchip = dev_get_drvdata(dev);
895895
int err;
@@ -1035,8 +1035,8 @@ static int rockchip_pcie_remove(struct platform_device *pdev)
10351035
}
10361036

10371037
static const struct dev_pm_ops rockchip_pcie_pm_ops = {
1038-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(rockchip_pcie_suspend_noirq,
1039-
rockchip_pcie_resume_noirq)
1038+
NOIRQ_SYSTEM_SLEEP_PM_OPS(rockchip_pcie_suspend_noirq,
1039+
rockchip_pcie_resume_noirq)
10401040
};
10411041

10421042
static const struct of_device_id rockchip_pcie_of_match[] = {

0 commit comments

Comments
 (0)