]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
spi: bcmbca-hsspi: Fix missing pm_runtime_disable()
authorJinjie Ruan <ruanjinjie@huawei.com>
Mon, 26 Aug 2024 12:49:02 +0000 (20:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:32:35 +0000 (16:32 +0200)
[ Upstream commit 4439a2e92cb89028b22c5d7ba1b99e75d7d889f6 ]

The pm_runtime_disable() is missing in remove function, use
devm_pm_runtime_enable() to fix it. So the pm_runtime_disable() in
the probe error path can also be removed.

Fixes: a38a2233f23b ("spi: bcmbca-hsspi: Add driver for newer HSSPI controller")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Link: https://patch.msgid.link/20240826124903.3429235-2-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-bcmbca-hsspi.c

index 9f64afd8164ea95317df09aa8ede7ff5a5cd7e52..4965bc86d7f52ad053ea5aa7daf59bd0547c7f42 100644 (file)
@@ -546,12 +546,14 @@ static int bcmbca_hsspi_probe(struct platform_device *pdev)
                        goto out_put_host;
        }
 
-       pm_runtime_enable(&pdev->dev);
+       ret = devm_pm_runtime_enable(&pdev->dev);
+       if (ret)
+               goto out_put_host;
 
        ret = sysfs_create_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
        if (ret) {
                dev_err(&pdev->dev, "couldn't register sysfs group\n");
-               goto out_pm_disable;
+               goto out_put_host;
        }
 
        /* register and we are done */
@@ -565,8 +567,6 @@ static int bcmbca_hsspi_probe(struct platform_device *pdev)
 
 out_sysgroup_disable:
        sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
-out_pm_disable:
-       pm_runtime_disable(&pdev->dev);
 out_put_host:
        spi_controller_put(host);
 out_disable_pll_clk: