From: Hans de Goede Date: Sun, 7 Mar 2021 15:17:59 +0000 (+0100) Subject: extcon: arizona: Always use pm_runtime_get_sync() when we need the device to be awake X-Git-Tag: v5.15~1250^2~46^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=505eb8df97d9a6c51f5168f69984d116e9c27470;p=platform%2Fkernel%2Flinux-starfive.git extcon: arizona: Always use pm_runtime_get_sync() when we need the device to be awake Before this commit the extcon-arizona code was mixing pm_runtime_get() and pm_runtime_get_sync() in different places. In all places where pm_runtime_get[_sync]() is called, the code makes use of the device immediately after the call. This means that we should always use pm_runtime_get_sync(). Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Acked-by: Charles Keepax Tested-by: Charles Keepax Acked-by: Chanwoo Choi Signed-off-by: Lee Jones --- diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index 72d23b1..56d2ce0 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c @@ -290,7 +290,7 @@ static void arizona_start_mic(struct arizona_extcon_info *info) unsigned int mode; /* Microphone detection can't use idle mode */ - pm_runtime_get(info->dev); + pm_runtime_get_sync(info->dev); if (info->detecting) { ret = regulator_allow_bypass(info->micvdd, false); @@ -695,7 +695,7 @@ static void arizona_identify_headphone(struct arizona_extcon_info *info) dev_dbg(arizona->dev, "Starting HPDET\n"); /* Make sure we keep the device enabled during the measurement */ - pm_runtime_get(info->dev); + pm_runtime_get_sync(info->dev); info->hpdet_active = true;