Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp37403pxt; Wed, 4 Aug 2021 05:26:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsTbvIAtctRlykd08oTyle+k3rgeXKm5iQSBHJKi9rPq9LAXdp8O0MAPfO52xl84iIUui8 X-Received: by 2002:a05:6e02:4d2:: with SMTP id f18mr433376ils.21.1628080005001; Wed, 04 Aug 2021 05:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628080004; cv=none; d=google.com; s=arc-20160816; b=rpL7i9jNMpZfSY4NxLXunWnGHu5fqvI1f6ywG1fH/jrh5XiGshIjIeg8xr3bDNtlhu PPWq3Q8Xr1haU8of8IMUeEd0XtFg0KJwA9s8p2Lzzky4L/OHftTOE2DXk1cO/rYr4BbO ns1umAYUR7xZdRqGEmy/uEvu5/MhbGS55KCet4yeb7ZlzyevJA6ikXUfiqgvNgqNvQFv o9EZhbE1XFarz2hmHcrOE861H2FICqCoEo4cHmgklWiOcnLOxligWqDgdf8bJ6+1p5vJ vWMgKqvCmVYbt+LIJGtuj5X6Xh+2q3m7MOiGi4N7MCwWKT6iIiRDL//Q8Isz80npwi16 QuIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Em4d/MiDT//rYnJwIR6D0lTLLlYW4rV0rYua49h1MuI=; b=F2NGZOJrGoE5NGlkq4s7e7IrhGrwlBw5sN0yIv+aHE0TJ8fhNsjE52ufG7sic25KzW Spu2BxYR5cP2xh4mhycWY2FeaoXl20rK+aysFj8MY4P+yVHcdsBA7s5Uwh0EyDkjBeWg 95115ZzXPb+Zmt9ywB3gf3luMFlR20RhqqPl5UymNEMfUbvdpkCzU4T/HGzPQo6dwK85 1Iot5cZ1XeLijeGtR720yxyaYkCdwqFhIN3fZTfVAFjkhzyz21+pm1Yok4ANWUjRQJn5 arW7WPcJN9wXgs1FHRo6CVGHsXQNei4O6lkck0+SbUwarlnp/acrbWr43mW/130i2wwu TJFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u5si913458jai.92.2021.08.04.05.26.32; Wed, 04 Aug 2021 05:26:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237569AbhHDKoq (ORCPT + 99 others); Wed, 4 Aug 2021 06:44:46 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:60311 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236993AbhHDKoi (ORCPT ); Wed, 4 Aug 2021 06:44:38 -0400 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 4A23D20005; Wed, 4 Aug 2021 10:44:22 +0000 (UTC) From: Alexandre Belloni To: "Rafael J. Wysocki" , Len Brown , Pavel Machek Cc: Alexandre Belloni , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PM / sleep: check RTC features instead of ops in suspend_test Date: Wed, 4 Aug 2021 12:44:07 +0200 Message-Id: <20210804104407.5600-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Test RTC_FEATURE_ALARM instead of relying on ops->set_alarm to know whether alarms are available. Signed-off-by: Alexandre Belloni --- kernel/power/suspend_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/power/suspend_test.c b/kernel/power/suspend_test.c index e1ed58adb69e..d20526c5be15 100644 --- a/kernel/power/suspend_test.c +++ b/kernel/power/suspend_test.c @@ -129,7 +129,7 @@ static int __init has_wakealarm(struct device *dev, const void *data) { struct rtc_device *candidate = to_rtc_device(dev); - if (!candidate->ops->set_alarm) + if (!test_bit(RTC_FEATURE_ALARM, candidate->features)) return 0; if (!device_may_wakeup(candidate->dev.parent)) return 0; -- 2.31.1