Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5814439pxb; Sun, 7 Nov 2021 21:08:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyteP2ZQJuvNVdRc9VyWCgpHOWFnIJhKkROltnft3xYCGdF73JlIzh0z7hmGMzNzKeS4+V X-Received: by 2002:a17:907:6d1e:: with SMTP id sa30mr52323950ejc.394.1636348088010; Sun, 07 Nov 2021 21:08:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636348088; cv=none; d=google.com; s=arc-20160816; b=QCDwTAF3qxQL1VEoWq9HxmpZzBGfZr+Ix7vLVIH99T64dtbLd96/STjHpbg8nH/9XE aJ57J+ZV3ClWkDBl538Tr30vjYrgt/P2daP55YIJ18nXjk3cMaXJzXhV7y6VAjt1uIor tuxoUCoxMP7hE4zNQUyP956yDmoRmOYHH4bC5TjYJ4FiHCWXoEQp7HrobuGV9S+edA+l o6ajE/BUiDTuLxc0tZmcWIVj4F8iM/cvF6qOtramUwxfiSCVQx0brH77MES23TXAAHGt mb/uMnS3/TEzguSuy85tCETRrBMle2KzdWhE/azm7IabLR3KeHcAAgg26bx4n9LkWag/ Ynyg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rH1NivBz2RUL2egg2bUgYf63oy0hrPT4grcSJ5gIWpI=; b=OVbIWMarqMgM2Q14QnbMo4eQJhqxGX5kSxdaiWG9Rbajuegrv9LKvw4jRTk8cYK9CS Vz46pCJnpqVbOF72Oy0QcUr79UGUs9VaZmohOyIjKBA9xBdfY7VWfShbjgBQD1hOoGxj Ce+az9O61DUWt7HgnR5xUSpjPWUHp17/uZPo1ldbnLHyAfOXEr6J3NBXAmiDGX8xui1X nv6WTDet0649KZgGEDWjR0TnY4NKRF6j4PTq/CLhXODcNmtORdj90qFxFmIlcPbx6U+c cJm5lqYdR5cqwErFpHOesCEgPZaE0w9LyrHIt8KM30cDGyVdyMonmxgDoQQS1b4XhqLD LCAg== 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 h10si36833849ede.214.2021.11.07.21.07.45; Sun, 07 Nov 2021 21:08:08 -0800 (PST) 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 S236856AbhKGW6I (ORCPT + 99 others); Sun, 7 Nov 2021 17:58:08 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:33085 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236748AbhKGW5y (ORCPT ); Sun, 7 Nov 2021 17:57:54 -0500 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 1658D240008; Sun, 7 Nov 2021 22:55:09 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/12] rtc: rx8025: clear RTC_FEATURE_ALARM when alarm are not supported Date: Sun, 7 Nov 2021 23:54:55 +0100 Message-Id: <20211107225458.111068-10-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211107225458.111068-1-alexandre.belloni@bootlin.com> References: <20211107225458.111068-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clear RTC_FEATURE_ALARM to signal alarms are not supported to the core instead of checking client->irq. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-rx8025.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c index 6002305efa2d..fcfdefe94a7c 100644 --- a/drivers/rtc/rtc-rx8025.c +++ b/drivers/rtc/rtc-rx8025.c @@ -315,9 +315,6 @@ static int rx8025_read_alarm(struct device *dev, struct rtc_wkalrm *t) u8 ald[2]; int ctrl2, err; - if (client->irq <= 0) - return -EINVAL; - err = rx8025_read_regs(client, RX8025_REG_ALDMIN, 2, ald); if (err) return err; @@ -352,9 +349,6 @@ static int rx8025_set_alarm(struct device *dev, struct rtc_wkalrm *t) u8 ald[2]; int err; - if (client->irq <= 0) - return -EINVAL; - ald[0] = bin2bcd(t->time.tm_min); if (rx8025->ctrl1 & RX8025_BIT_CTRL1_1224) ald[1] = bin2bcd(t->time.tm_hour); @@ -559,10 +553,8 @@ static int rx8025_probe(struct i2c_client *client, rx8025_handle_irq, IRQF_ONESHOT, "rx8025", client); - if (err) { - dev_err(&client->dev, "unable to request IRQ, alarms disabled\n"); - client->irq = 0; - } + if (err) + clear_bit(RTC_FEATURE_ALARM, rx8025->rtc->features); } rx8025->rtc->max_user_freq = 1; -- 2.31.1