[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200911124412.GE230586@piout.net>
Date: Fri, 11 Sep 2020 14:44:12 +0200
From: Alexandre Belloni <alexandre.belloni@...tlin.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Bartosz Golaszewski <bgolaszewski@...libre.com>,
Alessandro Zummo <a.zummo@...ertech.it>,
linux-rtc@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 7/8] rtc: rx8010: fix indentation in probe()
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
Powered by blists - more mailing lists