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

spi: bcm63xx-hsspi: fix pm_runtime

The driver sets auto_runtime_pm to true, but it doesn't call
pm_runtime_enable(), which results in "Failed to power device" when PM support
is enabled.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Link: https://lore.kernel.org/r/20210223151851.4110-3-noltari@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Álvaro Fernández Rojas and committed by
Mark Brown
fb8695e3 2d13f2ff

+6 -1
+6 -1
drivers/spi/spi-bcm63xx-hsspi.c
··· 21 21 #include <linux/mutex.h> 22 22 #include <linux/of.h> 23 23 #include <linux/reset.h> 24 + #include <linux/pm_runtime.h> 24 25 25 26 #define HSSPI_GLOBAL_CTRL_REG 0x0 26 27 #define GLOBAL_CTRL_CS_POLARITY_SHIFT 0 ··· 440 439 if (ret) 441 440 goto out_put_master; 442 441 442 + pm_runtime_enable(&pdev->dev); 443 + 443 444 /* register and we are done */ 444 445 ret = devm_spi_register_master(dev, master); 445 446 if (ret) 446 - goto out_put_master; 447 + goto out_pm_disable; 447 448 448 449 return 0; 449 450 451 + out_pm_disable: 452 + pm_runtime_disable(&pdev->dev); 450 453 out_put_master: 451 454 spi_master_put(master); 452 455 out_disable_pll_clk: