Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp602309pxp; Wed, 9 Mar 2022 08:56:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhoKbuFwz9cWpEsUmCa6yu264QQ0WgdRK0rXPz/HrT4FkIJ/Nvq2YKh70U3vE/3Z5Z/ItG X-Received: by 2002:a17:906:b157:b0:6d0:9f3b:a6aa with SMTP id bt23-20020a170906b15700b006d09f3ba6aamr610914ejb.365.1646844988355; Wed, 09 Mar 2022 08:56:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646844988; cv=none; d=google.com; s=arc-20160816; b=FBQLJYp6dOiH8xosK+b3uBWs0xVVvABSJaf6bkL7f1Ae6yu0v/0j6dcgaF+qKpY1SN hCveXhZxbtAisS8EoWVw4tFRK450YpiQqn+gJX91QlUOkHzKbRuVrbSp+DWzIhVpZ5K4 5xFPyw39eNLaPVs09kVY1iIHHVVnkFfWgVNDk85muNng6BFAcsOgLMXn+RHs0UvsWvO1 Rl7+hSAiFECrh8DYV5Y+WMoHDwuFYPFAK7odH6I6UUS9oLvu5hm4vGZN3xLeVTHtWrpi GyvErneg8RDAyWFUSP1xXWiJql4VRTw706R2QiU5cY+2dLaK87RhW96/L+DpaVm276Fd EWAw== 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=b1v8hoEMEPlpmNJSzmlXHIwdl3V5o7G8xMhECs9EIvM=; b=Wn/wjIOzyk1+4Fq00H/SrGnvyyFlp8gJni2ervNeojqtwAoXCeOzJMXdubpgEAPWlj qt9QuBAf4AIZmmd3+Brb581wVzH4frJs8RVx3Ikj7fJkstt28sJbq/5zJhh3toCPEOdO gnEbjmfiyAda+HkcdupJ2Bq4h+0H4xmS7gHUe83iQAwlNwkhUtS6p4uGI4Dsi2RgnEwZ viveVjN+sbaspIZQJf0uUgQst7f7K3Xj5l1ajDwQvxEeMwknpNrNuo1vcPavGJZ4BNXS Gnh/X3yqRONjlBMOe68sZfp+0M3iIZ/ZdYTHxWJc9ho7QjDzMDmRs13l+dcDQgV+Oc++ a+xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=poGiOXCw; 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 g21-20020a50ec15000000b004162725fb84si1689458edr.296.2022.03.09.08.56.05; Wed, 09 Mar 2022 08:56: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=poGiOXCw; 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 S236051AbiCIQh5 (ORCPT + 99 others); Wed, 9 Mar 2022 11:37:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236777AbiCIQaM (ORCPT ); Wed, 9 Mar 2022 11:30:12 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97EF9DCE07; Wed, 9 Mar 2022 08:23:36 -0800 (PST) Received: (Authenticated sender: alexandre.belloni@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 3CD80240003; Wed, 9 Mar 2022 16:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1646843010; 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=b1v8hoEMEPlpmNJSzmlXHIwdl3V5o7G8xMhECs9EIvM=; b=poGiOXCwGlvoMhV7VbU1v92bZuHnzzilvQU8JhLEAp8Bn9qMhrXWW9eA4E07HHNSvUaBh4 9ASh8wTtWpcMl7ysUfDo6e7BEIGarzFkCwT2TnSu4YyVYRWIZrORHp7DzfnVQwmnJesu7v 3CyyU3AheWaDOE7zjxPby7FzaOWGijK5Epz49sn4VhOV3vylCERf5h4xnoehlzKprDTWOY 2bCiEV6/BuVS6Z8VC1ULlsk3yepSO9io8nC7A9XtBk1VPtVHhYLOgwQh//5tktGnHSm8IO Qztsg3533tg1Hm145/ubAHr/UOWAURqnJCuj8T4H0kaCI3p5HPJFuYwEcqt6Xw== From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/29] rtc: spear: switch to devm_rtc_allocate_device Date: Wed, 9 Mar 2022 17:22:49 +0100 Message-Id: <20220309162301.61679-18-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-spear.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c index b4a520056b1a..1b40380aaba2 100644 --- a/drivers/rtc/rtc-spear.c +++ b/drivers/rtc/rtc-spear.c @@ -352,6 +352,10 @@ static int spear_rtc_probe(struct platform_device *pdev) if (!config) return -ENOMEM; + config->rtc = devm_rtc_allocate_device(&pdev->dev); + if (IS_ERR(config->rtc)) + return PTR_ERR(config->rtc); + /* alarm irqs */ irq = platform_get_irq(pdev, 0); if (irq < 0) @@ -380,17 +384,13 @@ static int spear_rtc_probe(struct platform_device *pdev) spin_lock_init(&config->lock); platform_set_drvdata(pdev, config); - config->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, - &spear_rtc_ops, THIS_MODULE); - if (IS_ERR(config->rtc)) { - dev_err(&pdev->dev, "can't register RTC device, err %ld\n", - PTR_ERR(config->rtc)); - status = PTR_ERR(config->rtc); - goto err_disable_clock; - } - + config->rtc->ops = &spear_rtc_ops; config->rtc->uie_unsupported = 1; + status = devm_rtc_register_device(config->rtc); + if (status) + goto err_disable_clock; + if (!device_can_wakeup(&pdev->dev)) device_init_wakeup(&pdev->dev, 1); -- 2.35.1