From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3419C77B7A for ; Wed, 31 May 2023 13:53:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237292AbjEaNxC (ORCPT ); Wed, 31 May 2023 09:53:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237314AbjEaNuW (ORCPT ); Wed, 31 May 2023 09:50:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 539E41BF5; Wed, 31 May 2023 06:45:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B23B963B45; Wed, 31 May 2023 13:45:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 708CEC4339B; Wed, 31 May 2023 13:45:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685540745; bh=jGT0wa0bpRdZdJH2PPUkmPt6NzzL059nbaf9hn/z5tw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZpZBlU0Xsy3dL5lFwI6SFDPyPa4sM5Anqz/Gr0UvYVH2MLeXQOF9X+kTEohWE8B12 wp1Q5IAXEKTorLpeBVDdp/zm+ieKhBaU5BNlKo1M6fUAIokpK8kn/MyIA9FA8YMYX8 FvYkbhiOuFnLKSfIhbSrkhkfHNPHS1/SwKGyct+GtWgGeBVay8ohiPdGmwEadWtbNY J8BdU6CJH0QQT3ugLxAwSf2Ms9EGrYOL0aO9zz6y+kAhWMV+T28rXcEp1utJjdX4Yv MF5tqV+8FUg78M+hWP8ZpcvhD1cVO3fZm4JJq7KmKzyefajE+DYRWP+Nr/GynV7S9U YhGGShIhDXgFw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hans de Goede , Sebastian Reichel , Sasha Levin , sre@kernel.org, linux-pm@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 02/13] power: supply: bq27xxx: Use mod_delayed_work() instead of cancel() + schedule() Date: Wed, 31 May 2023 09:45:30 -0400 Message-Id: <20230531134541.3385043-2-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230531134541.3385043-1-sashal@kernel.org> References: <20230531134541.3385043-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit 59dddea9879713423c7b2ade43c423bb71e0d216 ] Use mod_delayed_work() instead of separate cancel_delayed_work_sync() + schedule_delayed_work() calls. Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/supply/bq27xxx_battery.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c index b7dc881268666..b3a0c2e22a5f4 100644 --- a/drivers/power/supply/bq27xxx_battery.c +++ b/drivers/power/supply/bq27xxx_battery.c @@ -877,10 +877,8 @@ static int poll_interval_param_set(const char *val, const struct kernel_param *k return ret; mutex_lock(&bq27xxx_list_lock); - list_for_each_entry(di, &bq27xxx_battery_devices, list) { - cancel_delayed_work_sync(&di->work); - schedule_delayed_work(&di->work, 0); - } + list_for_each_entry(di, &bq27xxx_battery_devices, list) + mod_delayed_work(system_wq, &di->work, 0); mutex_unlock(&bq27xxx_list_lock); return ret; -- 2.39.2