Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2257596imm; Thu, 7 Jun 2018 07:49:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKoBDMIlVYWiqDYaVb55sD3N7Efl9SPjaTp9lj8/kKtmK1V+7Y3serJvZT5ifMhY0nYyoWN X-Received: by 2002:a17:902:7685:: with SMTP id m5-v6mr2389725pll.76.1528382967066; Thu, 07 Jun 2018 07:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528382967; cv=none; d=google.com; s=arc-20160816; b=JP2L3hCEYzEJXLO65Qh+S38NU4GkBMhrrOiOc24Gfu7vjwMPaOv1SBz7MYVuOGHtvU qzC9ohs+tjiGbRtcHR9XlleimalL+OjvGdCeaarNOzLqy6+7sMIcjkCiq8XeUHIt53Fj DM3juutnSyaFGCDq0YNKtP/eza0gTeibkEAZqqOsV4yO3aR+BBbQCfTKhQVl4UefzL3h OY7p2GO7R4T1/YFcRlC5xuMUqNUdSBKNGjGy63nTvYjJmQcWmPUgcWIQ+YqXbx8FjMDx Gy7I63qTAg+FezbKxYEZRnuA9W7yvJXE2VICB8I4qO1cfbq+Oe0faTC2/62fcrxhpts4 R/NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=s89pfoMA2+9mEjIvyYRvDJJMTEs1+yH8R12DucrWV1Y=; b=HBX6WlNvcRRbVnD8hW36lZJFMLJps9iQoxlRgp7+7Bzo5ypgMgJhHSz1JaVyMBWZ8/ o7uQ1KkY+vtB10fntjFHPERfVuVahFbEoI8fQNVQw8Jy8Xiq/Pfv7l1IE676TORbnv0h 7CqwpEe0e5zgmQm6I9c+shTiFvJeKXpj3y6E8+duvBS5RsBGhWJQ2C0hUaHY4in5sGX1 m5Gr/tarphjCJi96UIVzA+vqu+wayUqtNvK8i0eC7UKR6DbntLMiuemsorU5w/X7s4nO cHFrOfodQf94595o01e0kTUqIfC3R3536KMxJ27l18VwBj50RpCJa6VCIBTMsHVCp6Pc ayRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=XKFlDw9I; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k186-v6si28153481pge.375.2018.06.07.07.49.12; Thu, 07 Jun 2018 07:49:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=XKFlDw9I; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935040AbeFGOsE (ORCPT + 99 others); Thu, 7 Jun 2018 10:48:04 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:34254 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934706AbeFGOru (ORCPT ); Thu, 7 Jun 2018 10:47:50 -0400 Received: by mail-wr0-f196.google.com with SMTP id a12-v6so10169802wro.1; Thu, 07 Jun 2018 07:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=s89pfoMA2+9mEjIvyYRvDJJMTEs1+yH8R12DucrWV1Y=; b=XKFlDw9IVUmn03IDwbu4g3HAvZqbzbSlEC4RmqLVW2qZZrp2sxRE6Mm5WzFOrjtHkO tHShNuzZ1+vl8gm/L39EibTcxbrWMeSWD3JlyQSn1aBQGhYeu63D20tC+ihI0wAGQI0V g/EoGyDcQT0/X8F1AoW81Kyu9p8L1emG/YEdC97Dx+OGj4tNi/Oh/SfENwWilMvCjnox /c0ENwBeR6i46XgcZ6mu/lwyJklYOl7nGdSa8wGW79oj76k1vAHYBenyNXSrKht4H1d1 0po7QHEsQ/myFW1cXfnNc4b1JRQHwhYWlznLhu/If8iyQp2N5kL1yzr9NfbkuYv1JQQS ElOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=s89pfoMA2+9mEjIvyYRvDJJMTEs1+yH8R12DucrWV1Y=; b=feLFbu6peivTDfBg5cxc+aX1F8k4a8NjNUOybkZTTaMkIVKaGIebg7rboHWHEs6x+K RHs6wVEGqmcFiPQmCiFmmWOC1TBwfiUjvaxH2wEAEHj9Eox68W/2fJr5PunwoSt4VO8B /VVr4OBcWmqXhGOxRSIbu7jN79rANwMd+9mdzlCz+E2/FcrYFGZTbBnYlh9S9RjLKjoD TKqHlLacLLElybftUegEf3yojOyQUcfNn4RN9c5g4iCsGwKaz51edTtbJA07fv3cKTvM SydlTBngb9/Jd8DPrtW3TbD1NMHKe+b6apF2krJwDCtzHppElrODYGsIcjjZTWakidyl cCYA== X-Gm-Message-State: APt69E0gKV8zro8vcNg54N+UQ+LxdZ89NEqRqElowKLdylKeXvTXknO8 DrB4KPGwFEdvxkonxR/s3KY= X-Received: by 2002:adf:bbcd:: with SMTP id z13-v6mr2055740wrg.183.1528382869123; Thu, 07 Jun 2018 07:47:49 -0700 (PDT) Received: from localhost (cable-78-34-23-77.netcologne.de. [78.34.23.77]) by smtp.gmail.com with ESMTPSA id t1-v6sm2049601wmt.40.2018.06.07.07.47.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Jun 2018 07:47:48 -0700 (PDT) Date: Thu, 7 Jun 2018 16:43:31 +0200 (CEST) From: Hans Ulli Kroll X-X-Sender: elektroman@T420s To: Alexandre Belloni cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Ulli Kroll , Linus Walleij , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/3] rtc: ftrtc010: switch to devm_rtc_allocate_device In-Reply-To: <20180604141528.15635-1-alexandre.belloni@bootlin.com> Message-ID: References: <20180604141528.15635-1-alexandre.belloni@bootlin.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 4 Jun 2018, Alexandre Belloni wrote: > Switch to devm_rtc_allocate_device/rtc_register_device. This allow or > further improvement and simplifies ftrtc010_rtc_remove(). > > Signed-off-by: Alexandre Belloni > --- > drivers/rtc/rtc-ftrtc010.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/rtc/rtc-ftrtc010.c b/drivers/rtc/rtc-ftrtc010.c > index af8d6beae20c..165d0b62db00 100644 > --- a/drivers/rtc/rtc-ftrtc010.c > +++ b/drivers/rtc/rtc-ftrtc010.c > @@ -166,14 +166,18 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev) > if (!rtc->rtc_base) > return -ENOMEM; > > + rtc->rtc_dev = devm_rtc_allocate_device(dev); > + if (IS_ERR(rtc->rtc_dev)) > + return PTR_ERR(rtc->rtc_dev); > + > + rtc->rtc_dev->ops = &ftrtc010_rtc_ops; > + > ret = devm_request_irq(dev, rtc->rtc_irq, ftrtc010_rtc_interrupt, > IRQF_SHARED, pdev->name, dev); > if (unlikely(ret)) > return ret; > > - rtc->rtc_dev = rtc_device_register(pdev->name, dev, > - &ftrtc010_rtc_ops, THIS_MODULE); > - return PTR_ERR_OR_ZERO(rtc->rtc_dev); > + return rtc_register_device(rtc->rtc_dev); > } > > static int ftrtc010_rtc_remove(struct platform_device *pdev) > @@ -184,7 +188,6 @@ static int ftrtc010_rtc_remove(struct platform_device *pdev) > clk_disable_unprepare(rtc->extclk); > if (!IS_ERR(rtc->pclk)) > clk_disable_unprepare(rtc->pclk); > - rtc_device_unregister(rtc->rtc_dev); > > return 0; > } > -- > 2.17.1 > > Acked-by: Hans Ulli Kroll