From patchwork Sat Nov 5 06:01:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 621983 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 83D4AC433FE for ; Sat, 5 Nov 2022 06:02:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229846AbiKEGCW (ORCPT ); Sat, 5 Nov 2022 02:02:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229668AbiKEGBf (ORCPT ); Sat, 5 Nov 2022 02:01:35 -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 7612230560; Fri, 4 Nov 2022 23:01:34 -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 58488609EB; Sat, 5 Nov 2022 06:01:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5D5EC433C1; Sat, 5 Nov 2022 06:01:33 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFl-007P0H-3B; Sat, 05 Nov 2022 02:02:01 -0400 Message-ID: <20221105060201.829050575@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:01:02 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [PATCH v4a 38/38] timers: PM: Use timer_shutdown_sync() References: <20221105060024.598488967@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: "Steven Rostedt (Google)" Instead of open coding making the timer look like it was not registered by setting the function pointer to NULL, call timer_shutdown_sync() that does the same thing. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Pavel Machek Cc: Greg Kroah-Hartman Cc: linux-pm@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/base/power/wakeup.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index 7cc0c0cf8eaa..c6d68bdcac68 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -202,12 +202,7 @@ void wakeup_source_remove(struct wakeup_source *ws) raw_spin_unlock_irqrestore(&events_lock, flags); synchronize_srcu(&wakeup_srcu); - del_timer_sync(&ws->timer); - /* - * Clear timer.function to make wakeup_source_not_registered() treat - * this wakeup source as not registered. - */ - ws->timer.function = NULL; + timer_shutdown_sync(&ws->timer); } EXPORT_SYMBOL_GPL(wakeup_source_remove);