From 9c19131f6b4e84fd4eaa1777e965e509f62f9b72 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:02 +0000 Subject: Input: ambakmi - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-30-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/serio/ambakmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c index c391700fc4ae..8fbfa448be4a 100644 --- a/drivers/input/serio/ambakmi.c +++ b/drivers/input/serio/ambakmi.c @@ -170,7 +170,7 @@ static void amba_kmi_remove(struct amba_device *dev) amba_release_regions(dev); } -static int __maybe_unused amba_kmi_resume(struct device *dev) +static int amba_kmi_resume(struct device *dev) { struct amba_kmi_port *kmi = dev_get_drvdata(dev); @@ -180,7 +180,7 @@ static int __maybe_unused amba_kmi_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(amba_kmi_dev_pm_ops, NULL, amba_kmi_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(amba_kmi_dev_pm_ops, NULL, amba_kmi_resume); static const struct amba_id amba_kmi_idtable[] = { { @@ -196,7 +196,7 @@ static struct amba_driver ambakmi_driver = { .drv = { .name = "kmi-pl050", .owner = THIS_MODULE, - .pm = &amba_kmi_dev_pm_ops, + .pm = pm_sleep_ptr(&amba_kmi_dev_pm_ops), }, .id_table = amba_kmi_idtable, .probe = amba_kmi_probe, -- cgit v1.2.3 From 6cb86b0a87bedd42b2c77c2714d66f812cf6fe74 Mon Sep 17 00:00:00 2001 From: ye xingchen Date: Sun, 29 Jan 2023 18:29:22 -0800 Subject: Input: altera_ps2 - use devm_platform_get_and_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/202301281603290601283@zte.com.cn Signed-off-by: Dmitry Torokhov --- drivers/input/serio/altera_ps2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/altera_ps2.c b/drivers/input/serio/altera_ps2.c index 3a92304f64fb..9f8d7b332d1b 100644 --- a/drivers/input/serio/altera_ps2.c +++ b/drivers/input/serio/altera_ps2.c @@ -78,7 +78,6 @@ static void altera_ps2_close(struct serio *io) static int altera_ps2_probe(struct platform_device *pdev) { struct ps2if *ps2if; - struct resource *res; struct serio *serio; int error, irq; @@ -86,8 +85,7 @@ static int altera_ps2_probe(struct platform_device *pdev) if (!ps2if) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - ps2if->base = devm_ioremap_resource(&pdev->dev, res); + ps2if->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(ps2if->base)) return PTR_ERR(ps2if->base); -- cgit v1.2.3 From 12b11142ee95e68891211268ce6a826f3396e870 Mon Sep 17 00:00:00 2001 From: ye xingchen Date: Sun, 29 Jan 2023 18:29:35 -0800 Subject: Input: apbps2 - use devm_platform_get_and_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/202301281604596831304@zte.com.cn Signed-off-by: Dmitry Torokhov --- drivers/input/serio/apbps2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/apbps2.c b/drivers/input/serio/apbps2.c index 9c9ce097f8bf..513d96e40e0e 100644 --- a/drivers/input/serio/apbps2.c +++ b/drivers/input/serio/apbps2.c @@ -132,7 +132,6 @@ static int apbps2_of_probe(struct platform_device *ofdev) struct apbps2_priv *priv; int irq, err; u32 freq_hz; - struct resource *res; priv = devm_kzalloc(&ofdev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) { @@ -141,8 +140,7 @@ static int apbps2_of_probe(struct platform_device *ofdev) } /* Find Device Address */ - res = platform_get_resource(ofdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(&ofdev->dev, res); + priv->regs = devm_platform_get_and_ioremap_resource(ofdev, 0, NULL); if (IS_ERR(priv->regs)) return PTR_ERR(priv->regs); -- cgit v1.2.3 From 24b915d1664a90f1871a96df426721b99bae7265 Mon Sep 17 00:00:00 2001 From: ye xingchen Date: Sun, 29 Jan 2023 18:29:58 -0800 Subject: Input: arc_ps2 - use devm_platform_get_and_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/202301281606309671328@zte.com.cn Signed-off-by: Dmitry Torokhov --- drivers/input/serio/arc_ps2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/arc_ps2.c b/drivers/input/serio/arc_ps2.c index 0af9fba5d16d..a6debb13d527 100644 --- a/drivers/input/serio/arc_ps2.c +++ b/drivers/input/serio/arc_ps2.c @@ -182,7 +182,6 @@ static int arc_ps2_create_port(struct platform_device *pdev, static int arc_ps2_probe(struct platform_device *pdev) { struct arc_ps2_data *arc_ps2; - struct resource *res; int irq; int error, id, i; @@ -197,8 +196,7 @@ static int arc_ps2_probe(struct platform_device *pdev) return -ENOMEM; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - arc_ps2->addr = devm_ioremap_resource(&pdev->dev, res); + arc_ps2->addr = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(arc_ps2->addr)) return PTR_ERR(arc_ps2->addr); -- cgit v1.2.3 From 492ec555a59a674c030ba1b429fb2d50e1b8de67 Mon Sep 17 00:00:00 2001 From: ye xingchen Date: Sun, 29 Jan 2023 18:30:09 -0800 Subject: Input: olpc_apsp - use devm_platform_get_and_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/202301281608287301370@zte.com.cn Signed-off-by: Dmitry Torokhov --- drivers/input/serio/olpc_apsp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c index 04d2db982fb8..33a8e5889bd8 100644 --- a/drivers/input/serio/olpc_apsp.c +++ b/drivers/input/serio/olpc_apsp.c @@ -169,7 +169,6 @@ static int olpc_apsp_probe(struct platform_device *pdev) { struct serio *kb_serio, *pad_serio; struct olpc_apsp *priv; - struct resource *res; int error; priv = devm_kzalloc(&pdev->dev, sizeof(struct olpc_apsp), GFP_KERNEL); @@ -178,8 +177,7 @@ static int olpc_apsp_probe(struct platform_device *pdev) priv->dev = &pdev->dev; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->base = devm_ioremap_resource(&pdev->dev, res); + priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(priv->base)) { dev_err(&pdev->dev, "Failed to map WTM registers\n"); return PTR_ERR(priv->base); -- cgit v1.2.3