Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1786271pxy; Thu, 29 Apr 2021 14:45:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyslZuz9b10QP2pJwy9KeNFK7AZs0l+iAMftWPEaAopNJePVWv+bpGizhSIN1AiNi+Gxjdl X-Received: by 2002:a17:902:7b92:b029:eb:6fc0:39e6 with SMTP id w18-20020a1709027b92b02900eb6fc039e6mr1666654pll.83.1619732708182; Thu, 29 Apr 2021 14:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619732708; cv=none; d=google.com; s=arc-20160816; b=T9fJT3Vxi2wRSBJ1oIJPCiinDUQr9bu1dHRPs7q29LuuawfC6H/iyegjLIstfiKHD+ VkgKSubZqQPzTpf0Kxj+JVHDgZ9gAC6rlgClKGrMQTA7kyLnyh4bbUv+4dtv+1VDiNIP GDyzqOfVfUGp9/pxgWHEBziKT8wa0MIsDK8A/R64dvTHduO8hKo5ekCOQvMsCBx2+Xse 0Bbak7H1i8DWy5vgKIe0SfDx3lFL6TcIOmJ//NzdRxtFofkbp6B8gIVJ53rt1DdyQRRd 6WrPKt5pKjS4ILW1qteU1pJhvC/Kq4qmuGx0YIuliTDmU5Pa/dv487yK5xwH3S1V0PAT aAHw== 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=g58i+j8fmS3YRx5rADzxXpOONePK4Z5CmIh3OXwqMvI=; b=vGJp23Qp43suuwHtuby5/NvKeCsDeoFknS6y1xdlF+T9SOcNyQnIr+NNmzsLcmRNnA gtCRMZBDnRJqgHPF5T7LrRVNJCbO4LdugYvWlcM1X9LdYRBwb4+JCSaEcC8XiXdS0nEB /qdpVbZ7dAa7ajZwg06+6GY7FI5kAEd90eHNz6HyMeT0MNTy4S3CakeyNkSO+o1g43Yr oJGFhqkk4307JQ2GDNdJ+ZGCLPmcVrlbQJeBgzf0mbSGKKpSdISNBPO21/KbyfEzUaw2 6sDPV0CYlzCUd4jYmXlAdaLos/7IK5GfrcX0I7NlPKLbwe1l386oilkIfnlkUjcScvkE v6pQ== 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 e10si987095plt.411.2021.04.29.14.44.53; Thu, 29 Apr 2021 14:45:08 -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 S237495AbhD2Vo4 (ORCPT + 99 others); Thu, 29 Apr 2021 17:44:56 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:53125 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237337AbhD2Voz (ORCPT ); Thu, 29 Apr 2021 17:44:55 -0400 Received: from localhost (lfbn-lyo-1-1676-55.w90-65.abo.wanadoo.fr [90.65.108.55]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id A129D200002; Thu, 29 Apr 2021 21:44:07 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rtc: sysfs: check features instead of ops Date: Thu, 29 Apr 2021 23:44:03 +0200 Message-Id: <20210429214403.2610952-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.30.2 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 .set_alarm to know whether alarms are available. Signed-off-by: Alexandre Belloni --- drivers/rtc/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/sysfs.c b/drivers/rtc/sysfs.c index 8a957d31a1a4..74026f67fdfb 100644 --- a/drivers/rtc/sysfs.c +++ b/drivers/rtc/sysfs.c @@ -273,7 +273,7 @@ static bool rtc_does_wakealarm(struct rtc_device *rtc) if (!device_can_wakeup(rtc->dev.parent)) return false; - return rtc->ops->set_alarm != NULL; + return !!test_bit(RTC_FEATURE_ALARM, rtc->features); } static umode_t rtc_attr_is_visible(struct kobject *kobj, -- 2.30.2