From 6b269a41a4520f7eb639e61a45ebbb9c9267d5e0 Mon Sep 17 00:00:00 2001 From: Sapthagiri Baratam Date: Tue, 21 Aug 2018 19:52:44 +0530 Subject: mfd: arizona: Correct calling of runtime_put_sync Don't call runtime_put_sync when clk32k_ref is ARIZONA_32KZ_MCLK2 as there is no corresponding runtime_get_sync call. MCLK1 is not in the AoD power domain so if it is used as 32kHz clock source we need to hold a runtime PM reference to keep the device from going into low power mode. Fixes: cdd8da8cc66b ("mfd: arizona: Add gating of external MCLKn clocks") Signed-off-by: Sapthagiri Baratam Acked-by: Charles Keepax Signed-off-by: Lee Jones --- drivers/mfd/arizona-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/mfd/arizona-core.c') diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 5f1e37d23943..057906e3c16e 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -52,8 +52,10 @@ int arizona_clk32k_enable(struct arizona *arizona) if (ret != 0) goto err_ref; ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK1]); - if (ret != 0) - goto err_pm; + if (ret != 0) { + pm_runtime_put_sync(arizona->dev); + goto err_ref; + } break; case ARIZONA_32KZ_MCLK2: ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK2]); @@ -67,8 +69,6 @@ int arizona_clk32k_enable(struct arizona *arizona) ARIZONA_CLK_32K_ENA); } -err_pm: - pm_runtime_put_sync(arizona->dev); err_ref: if (ret != 0) arizona->clk32k_ref--; -- cgit v1.2.3 From 8e27a5638ab5c1b5434a0c22bc43ec6c3f7f5b6b Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 4 Sep 2018 15:15:53 +0100 Subject: mfd: arizona: Make array mclk_name static, shrinks object size Don't populate the array mclk_name on the stack but instead make it static. Makes the object code smaller by 23 bytes: Before: text data bss dec hex filename 38050 11604 64 49718 c236 linux/drivers/mfd/arizona-core.o After: text data bss dec hex filename 38027 11604 64 49695 c21f linux/drivers/mfd/arizona-core.o (gcc version 8.2.0 x86_64) Signed-off-by: Colin Ian King Acked-by: Charles Keepax Signed-off-by: Lee Jones --- drivers/mfd/arizona-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/mfd/arizona-core.c') diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 057906e3c16e..27b61639cdc7 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -990,7 +990,7 @@ static const struct mfd_cell wm8998_devs[] = { int arizona_dev_init(struct arizona *arizona) { - const char * const mclk_name[] = { "mclk1", "mclk2" }; + static const char * const mclk_name[] = { "mclk1", "mclk2" }; struct device *dev = arizona->dev; const char *type_name = NULL; unsigned int reg, val; -- cgit v1.2.3