Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5813583pxb; Sun, 7 Nov 2021 21:06:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoM80LqtN8R3tlI0FhfpILxecM+FR2q7ISIOrAGJf9RNmPkRvfZjx70VM4sJQTAnqt0ph/ X-Received: by 2002:a17:907:1c1f:: with SMTP id nc31mr80165186ejc.210.1636348010253; Sun, 07 Nov 2021 21:06:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636348010; cv=none; d=google.com; s=arc-20160816; b=I3uvUhgHHbsJ9tmiHw8GAQj7jL4dysiNR3atWSFzZ2jG4iMhGK7sVPV7a5OFmTZvsF MqNJqZQUglTD9lJ0xu4nHwM7ojQtlVbzUBfvAEGdoBejT2aTIFXz730wHU8rv36xWXdQ zqnL6L6BP1Ew96f9r1da0uFGVPXtQpYOHeb+e9jIc2wZiNLIYWKNegrPC0vOz5cl6AF9 9EPghOxTEaSXh4QzlRvM5dZDjWZ52qWcL2jouv0S9Boua9MEmFreI8UZZJ+7DOJVDE75 jxnvjH8ApaTtYShLd9aTMnJ8hQ14xnqO1EvIIGbcUD9HHUbBuoOfpQfa5GEuIfHNlHGo 46CA== 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=RzzcgYKenfaDmWW2tOAo1X0g0eFQj5ZFRITEDTWcJG8=; b=vVLfkH92i6Bajz7sotSfWIeyN5cAbvd9pKjSHbp9APC1Mh+l//6PGui6vkXcpnOpm7 ounvGYjhOJLdNk44ND0H8MW+FR/+NFcY6jxa4jcPNHghawKk90mTQBnqdXdZ2qrEga1x fxAdjw5btTrJ3NZBXgTcGyu/bG4eXbQ/cMS4CPiJ8z/+94CHPjWMN/uLSlZ84CySeawS W7mLmiAxLb8WL7URj64PyBFFn08r+a1PlcbXQXaxaF0av2pUm14TsMg5Ur19CURIAIAd 840nygzbwrcdVGoc/H9PbtbNBJnDno0aYFUKR3YxEjLsYGv6evT5S8uEa4lrxZ3znfIt taow== 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 q12si25246117edd.387.2021.11.07.21.06.26; Sun, 07 Nov 2021 21:06:50 -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 S236759AbhKGW56 (ORCPT + 99 others); Sun, 7 Nov 2021 17:57:58 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:44423 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236719AbhKGW5v (ORCPT ); Sun, 7 Nov 2021 17:57:51 -0500 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 6EE8520003; Sun, 7 Nov 2021 22:55:07 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/12] rtc: rx8025: switch to devm_rtc_allocate_device Date: Sun, 7 Nov 2021 23:54:52 +0100 Message-Id: <20211107225458.111068-7-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 Switch to devm_rtc_allocate_device/devm_rtc_register_device, this allows for further improvement of the driver. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-rx8025.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c index d38aaf08108c..617b044c66f0 100644 --- a/drivers/rtc/rtc-rx8025.c +++ b/drivers/rtc/rtc-rx8025.c @@ -559,12 +559,11 @@ static int rx8025_probe(struct i2c_client *client, if (err) return err; - rx8025->rtc = devm_rtc_device_register(&client->dev, client->name, - &rx8025_rtc_ops, THIS_MODULE); - if (IS_ERR(rx8025->rtc)) { - dev_err(&client->dev, "unable to register the class device\n"); + rx8025->rtc = devm_rtc_allocate_device(&client->dev); + if (IS_ERR(rx8025->rtc)) return PTR_ERR(rx8025->rtc); - } + + rx8025->rtc->ops = &rx8025_rtc_ops; if (client->irq > 0) { dev_info(&client->dev, "IRQ %d supplied\n", client->irq); @@ -583,6 +582,10 @@ static int rx8025_probe(struct i2c_client *client, /* the rx8025 alarm only supports a minute accuracy */ rx8025->rtc->uie_unsupported = 1; + err = devm_rtc_register_device(rx8025->rtc); + if (err) + return err; + err = rx8025_sysfs_register(&client->dev); return err; } -- 2.31.1