Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp612799pxp; Wed, 9 Mar 2022 09:06:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4wK4d/L4Etxy4TnALpuctaSy4RNFSh9EO2HR8a9EFJeKjAtavbOac+KSr8EtJXa1D0HGB X-Received: by 2002:a17:90a:f3cf:b0:1bc:6732:3db7 with SMTP id ha15-20020a17090af3cf00b001bc67323db7mr386430pjb.199.1646845589013; Wed, 09 Mar 2022 09:06:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646845589; cv=none; d=google.com; s=arc-20160816; b=BX3BKmP722bG9HF69XccnCCvTC7tgkt9YqL8qJs7P2Pu0AY2T4aRxtO4JP63gCkpkA EmVNOC8WzeQP3IvjAYsig7swoX/GYg2NHliV18cLdbuRH8TT3Qen0DGvYkBVG89XzYS7 bTbxzI+H8nPB1f9GARWHYbqMVqU9D2KRNHN6tFyD98tPehMMKP+8C9iM1/Y6ucxWSfdr TXah8zC6A0ZgKapHA9ISJvO+L3uc5BzgeH5KvzkzXflGg3W9aanbq2JbCLwHjfv5bKUO pnNWU7+YoFvPMMA5E6RO3EiLXrT6NXsSGjgZJNLNXV8EJakh0OMZLzhSGMleLnPP65Fd 7zvw== 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 :dkim-signature; bh=TC37O2ric69U3FFRyq2ia8q71I6rWSh/IoFJaPBo2tc=; b=Gc4HAsOgFxqEAiGuDA+jQukoX2olRlrm0mhBB6oLEpglMkhIdzrAjSvW43XynqA+Ar LpWS/0TpJg1iqMF8XXPsa3CUVyL+UgLN9dlbpQzt6gxWtB1acu1YWxh3f3MHbqvVKXll oruW0Y/x3oNXP2gpohA+Vg3KjPggnQffM8KNfpmmgFG6auyuBADIYmFjNLZYbvHQCUDi 9+J4ICHuhcQm8H5mihPFxoa75rXXU6Y8xoYl00kBBuPGWHGXuR/Om0oSuzvkl07F0Sqi jJcSDVvWWFvMtkMPqYoEkFjKgSX5OIjrV1eugUTV0X+HJjZjSlHdce43RnxaX/83lTde Qriw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=S1M86rLk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o3-20020a170902bcc300b00151e53056dasi2243163pls.245.2022.03.09.09.06.06; Wed, 09 Mar 2022 09:06:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=S1M86rLk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236723AbiCIQsH (ORCPT + 99 others); Wed, 9 Mar 2022 11:48:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236839AbiCIQaX (ORCPT ); Wed, 9 Mar 2022 11:30:23 -0500 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26962E0AD1; Wed, 9 Mar 2022 08:23:40 -0800 (PST) Received: (Authenticated sender: alexandre.belloni@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 14F851BF20D; Wed, 9 Mar 2022 16:23:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1646843016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TC37O2ric69U3FFRyq2ia8q71I6rWSh/IoFJaPBo2tc=; b=S1M86rLkfIKWGmyTYxs9hx081iIDlL5XVRsP4yRzkSWFXG5cEUfKh2o9QoGm2lMfg6Zz7h V553CB6j5u+uDuM7nbK2CgNB2XC2j6ai1dKdwyQfmpNaV7dT/1Q9pKCZi8D6DK8nkquw+2 mxfs9WBrRIuTp8I4EDOrvy/9+bOWlT1HXTFQ4fBqFIyMCxdalt30VxjnQtNRpzAKWF/61n Z0huTXx5QqVWI+l2TjkRXrq8DcBJM9nfMRN0skUul73E1FQJuCxoXv61DzH/jg3o2YOGsm a10qURi0QPNjlfplNPK43Qwi9vrbqP36Ph4oah4j00H0oOzGY2vnQPd9tetozQ== From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 25/29] rtc: hym8563: switch to devm_rtc_allocate_device Date: Wed, 9 Mar 2022 17:22:56 +0100 Message-Id: <20220309162301.61679-25-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220309162301.61679-1-alexandre.belloni@bootlin.com> References: <20220309162301.61679-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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-hym8563.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c index 0751cae27285..ce4cbf0f48e7 100644 --- a/drivers/rtc/rtc-hym8563.c +++ b/drivers/rtc/rtc-hym8563.c @@ -523,6 +523,10 @@ static int hym8563_probe(struct i2c_client *client, if (!hym8563) return -ENOMEM; + hym8563->rtc = devm_rtc_allocate_device(&client->dev); + if (IS_ERR(hym8563->rtc)) + return PTR_ERR(hym8563->rtc); + hym8563->client = client; i2c_set_clientdata(client, hym8563); @@ -557,11 +561,7 @@ static int hym8563_probe(struct i2c_client *client, dev_dbg(&client->dev, "rtc information is %s\n", (ret & HYM8563_SEC_VL) ? "invalid" : "valid"); - hym8563->rtc = devm_rtc_device_register(&client->dev, client->name, - &hym8563_rtc_ops, THIS_MODULE); - if (IS_ERR(hym8563->rtc)) - return PTR_ERR(hym8563->rtc); - + hym8563->rtc->ops = &hym8563_rtc_ops; /* the hym8563 alarm only supports a minute accuracy */ hym8563->rtc->uie_unsupported = 1; @@ -569,7 +569,7 @@ static int hym8563_probe(struct i2c_client *client, hym8563_clkout_register_clk(hym8563); #endif - return 0; + return devm_rtc_register_device(hym8563->rtc); } static const struct i2c_device_id hym8563_id[] = { -- 2.35.1