From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF8DEC433E2 for ; Fri, 11 Sep 2020 17:40:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF0C2221ED for ; Fri, 11 Sep 2020 17:40:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726107AbgIKRkU (ORCPT ); Fri, 11 Sep 2020 13:40:20 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:35725 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726001AbgIKMpc (ORCPT ); Fri, 11 Sep 2020 08:45:32 -0400 X-Originating-IP: 90.65.88.165 Received: from localhost (lfbn-lyo-1-1908-165.w90-65.abo.wanadoo.fr [90.65.88.165]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A36C960007; Fri, 11 Sep 2020 12:44:12 +0000 (UTC) Date: Fri, 11 Sep 2020 14:44:12 +0200 From: Alexandre Belloni To: Bartosz Golaszewski Cc: Bartosz Golaszewski , Alessandro Zummo , linux-rtc@vger.kernel.org, LKML Subject: Re: [PATCH 7/8] rtc: rx8010: fix indentation in probe() Message-ID: <20200911124412.GE230586@piout.net> References: <20200904152116.2157-1-brgl@bgdev.pl> <20200904152116.2157-8-brgl@bgdev.pl> <20200904154144.GL230586@piout.net> <20200911122837.GC230586@piout.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/09/2020 14:33:46+0200, Bartosz Golaszewski wrote: > I'm seeing this pattern elsewhere in the kernel too and I just > recently fixed this for MDIO. I think it's just a matter of people > copy-pasting a bad implementation. > > > was an actual reason this was done this way and it was the ordering of > > the rtc_nvmem_register/rtc_nvmem_unregister with rtc_device_unregister. > > I'm not sure this is still necessary though. > > > > To me - each of these should have their own 'unregister' function and > appropriate devres helpers *OR* RTC-related nvmem structures could be > set up and assigned to struct rtc_device after > devm_rtc_allocate_device() and picked up by the registration function > (and also undone by rtc_unregister_device()). > > I'll try to allocate some time to look into this but it's not like > it's urgent or anything - it's just a potential improvement. > Well, this could simply be done by adding a devres_add in __rtc_register_device. I'm planning to remove rtc_nvmem_unregister after the next LTS which will make that even easier. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com