summaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk-gpio.c
diff options
context:
space:
mode:
authorMike Looijmans <mike.looijmans@topic.nl>2018-03-13 09:54:03 +0100
committerStephen Boyd <sboyd@kernel.org>2018-03-19 21:53:08 +0100
commit2e838e7f3a8979f9f323214dccb9263fde526b11 (patch)
tree293e7e8501a487c4dc5584f3ab4aa880591f01aa /drivers/clk/clk-gpio.c
parentLinux 4.16-rc1 (diff)
downloadlinux-2e838e7f3a8979f9f323214dccb9263fde526b11.tar.xz
linux-2e838e7f3a8979f9f323214dccb9263fde526b11.zip
clk: clk-gpio: Allow GPIO to sleep in set/get_parent
When changing or retrieving clock parents, the caller is in a sleepable state (like prepare) so the GPIO operation need not be atomic. Replace gpiod_{g|s}et_value with gpiod_{g|s}et_value_cansleep in the {g|s}et_parent calls for the GPIO based clock mux. This fixes a "slowpath" warning when the GPIO controller is an I2C expander or something similar. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk-gpio.c')
-rw-r--r--drivers/clk/clk-gpio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c
index 151513c655c3..40af4fbab4d2 100644
--- a/drivers/clk/clk-gpio.c
+++ b/drivers/clk/clk-gpio.c
@@ -73,14 +73,14 @@ static u8 clk_gpio_mux_get_parent(struct clk_hw *hw)
{
struct clk_gpio *clk = to_clk_gpio(hw);
- return gpiod_get_value(clk->gpiod);
+ return gpiod_get_value_cansleep(clk->gpiod);
}
static int clk_gpio_mux_set_parent(struct clk_hw *hw, u8 index)
{
struct clk_gpio *clk = to_clk_gpio(hw);
- gpiod_set_value(clk->gpiod, index);
+ gpiod_set_value_cansleep(clk->gpiod, index);
return 0;
}