From 22167e9f739df5619fe7b5968ab1f64e9d9ec2eb Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Sun, 14 Jul 2013 20:28:05 +0800 Subject: [PATCH] ENGR00269945: reset: handle cansleep case in gpio-reset Some gpio reset may be backed by a gpio that can sleep, e.g. pca953x gpio output. For such gpio, gpio_set_value_cansleep() should be called. Otherwise, the WARN_ON(chip->can_sleep) in gpiod_set_value() will be hit. Add a gpio_cansleep() check to handle cansleep gpio. Signed-off-by: Shawn Guo --- drivers/reset/gpio-reset.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/reset/gpio-reset.c b/drivers/reset/gpio-reset.c index 5d2515af6a5f..4f372f9e437b 100644 --- a/drivers/reset/gpio-reset.c +++ b/drivers/reset/gpio-reset.c @@ -32,7 +32,10 @@ static void gpio_reset_set(struct reset_controller_dev *rcdev, int asserted) if (drvdata->active_low) value = !value; - gpio_set_value(drvdata->gpio, value); + if (gpio_cansleep(drvdata->gpio)) + gpio_set_value_cansleep(drvdata->gpio, value); + else + gpio_set_value(drvdata->gpio, value); } static int gpio_reset(struct reset_controller_dev *rcdev, unsigned long id) -- 2.39.5