Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5814436pxb; Sun, 7 Nov 2021 21:08:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwffz/Sz4vZEnfwKPSRq94J+af0Nu3UOaxUTNDa9AaR7cBkBPFfmL71ZJ9iZktQCA7a+TQ+ X-Received: by 2002:a05:6402:5242:: with SMTP id t2mr26367579edd.27.1636348087962; Sun, 07 Nov 2021 21:08:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636348087; cv=none; d=google.com; s=arc-20160816; b=ulmKuCVY46DHm0JDqMC7PNegNjWTP47ILu173m6kq8gzlNN1ik+rurYA9t+6WxopmR M/KItd4mzrMV0dSTuu2XTj9GuIRWbiQ4VI2aQXTtoopXROHYO1+cH7zjUqDs4D8eE48/ JJ1rCTVfefaEu6kG9yTirTuOFkyfSvin23vdDiSqs6Vhsud0yB4yEPv2/2X4B7pparT5 CMNima79VoO/kG6UMxeO4htMetQU/nOCQtNeXnSUrmKcJz7/79vI50A8Kpm0gBPwHsrx 6ZtvvkU05/MX2tdjAmihg6yO0GAp1czrAYVQvd7ArowfXm7oAMJd2Ucbmb5gT/dB8KUs coqg== 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=4IvGEPHyFYLhSi6VISeraSWLNRSHx9XjjRfC0p27Q0U=; b=qY39DpKP+YORdgNS/J7qnR+ljejFNHI/1t+8Pvv2gXsHeBjJiPViTIt3+B15qCB8q/ /EX8nfr9QEsz4pZ6ygTfNbRcMTxtDuk6TAltI0MuDsR3SpO7/PesemnVk3EDH5r46Pda LCZ0bTAdwJLemDXAr9LsP+rdWRy/Ch6iyF9t58tA+VovM9FkgDNuodW7JMUkm7/v52oV WIMAZRxsPZuhStMF0P+ByKJXSyVhsj6VpBWcHHQgv+9dGH5YEp3b3frbrf8M6Z50HTi3 +mSjUpzBy0wgXlkg0x4x1oZaTtOx+hOlcYMTxIUlOEsWRZFhxANRkTLv3/TtRbhh4IRz oGhA== 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 jy1si21586137ejc.592.2021.11.07.21.07.45; Sun, 07 Nov 2021 21:08:07 -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 S236869AbhKGW6K (ORCPT + 99 others); Sun, 7 Nov 2021 17:58:10 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:38423 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236758AbhKGW5z (ORCPT ); Sun, 7 Nov 2021 17:57:55 -0500 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id E1FE7100007; Sun, 7 Nov 2021 22:55:10 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/12] rtc: rx8025: use rtc_add_group Date: Sun, 7 Nov 2021 23:54:56 +0100 Message-Id: <20211107225458.111068-11-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 Remove open coded sysfs registration by using rtc_add_group. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-rx8025.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c index fcfdefe94a7c..c5b3814f8c8e 100644 --- a/drivers/rtc/rtc-rx8025.c +++ b/drivers/rtc/rtc-rx8025.c @@ -502,15 +502,14 @@ static DEVICE_ATTR(clock_adjust_ppb, S_IRUGO | S_IWUSR, rx8025_sysfs_show_clock_adjust, rx8025_sysfs_store_clock_adjust); -static int rx8025_sysfs_register(struct device *dev) -{ - return device_create_file(dev, &dev_attr_clock_adjust_ppb); -} +static struct attribute *rx8025_attrs[] = { + &dev_attr_clock_adjust_ppb.attr, + NULL +}; -static void rx8025_sysfs_unregister(struct device *dev) -{ - device_remove_file(dev, &dev_attr_clock_adjust_ppb); -} +static const struct attribute_group rx8025_attr_group = { + .attrs = rx8025_attrs, +}; static int rx8025_probe(struct i2c_client *client, const struct i2c_device_id *id) @@ -562,18 +561,11 @@ static int rx8025_probe(struct i2c_client *client, set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rx8025->rtc->features); clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rx8025->rtc->features); - err = devm_rtc_register_device(rx8025->rtc); + err = rtc_add_group(rx8025->rtc, &rx8025_attr_group); if (err) return err; - err = rx8025_sysfs_register(&client->dev); - return err; -} - -static int rx8025_remove(struct i2c_client *client) -{ - rx8025_sysfs_unregister(&client->dev); - return 0; + return devm_rtc_register_device(rx8025->rtc); } static struct i2c_driver rx8025_driver = { @@ -581,7 +573,6 @@ static struct i2c_driver rx8025_driver = { .name = "rtc-rx8025", }, .probe = rx8025_probe, - .remove = rx8025_remove, .id_table = rx8025_id, }; -- 2.31.1