mbox series

[00/18] a few rtc driver cleanups

Message ID 20250228-rtc-cleanups-v1-0-b44cec078481@linaro.org (mailing list archive)
Headers show
Series a few rtc driver cleanups | expand

Message

André Draszik Feb. 28, 2025, 2:07 p.m. UTC
Hi,

While looking at RTC, I noticed that various drivers are keeping
pointers to data that they're not using themselves throughout their
lifetime.

So I took the liberty to drop these pointers and this series is the
result.

The last two patches also convert two drivers to using dev_err_probe(),
as I looked slightly closer into those two. They don't exactly fit the
general subject of removal of unneeded pointers, but I wanted to share
them anyway, since they're ready.

All of this was compile-tested only.

Cheers,
Andre'

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
André Draszik (18):
      rtc: max77686: drop needless struct max77686_rtc_info::rtc member
      rtc: s5m: drop needless struct s5m_rtc_info::i2c member
      rtc: aspeed: drop needless struct aspeed_rtc::rtc_dev member
      rtc: ds2404: drop needless struct ds2404::rtc member
      rtc: ep93xx: drop needless struct ep93xx_rtc::rtc member
      rtc: ftrtc010: drop needless struct ftrtc010_rtc::rtc_dev member
      rtc: m48t86: drop needless struct m48t86_rtc_info::rtc member
      rtc: meson: drop needless struct meson_rtc::rtc member
      rtc: meson-vrtc: drop needless struct meson_vrtc_data::rtc member
      rtc: pl030: drop needless struct pl030_rtc::rtc member
      rtc: rx8581: drop needless struct rx8581::rtc member
      rtc: s35390a: drop needless struct s35390a::rtc member
      rtc: sd2405al: drop needless struct sd2405al::rtc member
      rtc: sd3078: drop needless struct sd3078::rtc member
      rtc: rx8581: drop needless struct rx8581
      rtc: sd3078: drop needless struct sd3078
      rtc: max77686: use dev_err_probe() where appropriate
      rtc: s5m: convert to dev_err_probe() where appropriate

 drivers/rtc/rtc-aspeed.c     | 16 ++++-----
 drivers/rtc/rtc-ds2404.c     | 14 ++++----
 drivers/rtc/rtc-ep93xx.c     | 16 ++++-----
 drivers/rtc/rtc-ftrtc010.c   | 17 +++++----
 drivers/rtc/rtc-m48t86.c     | 14 ++++----
 drivers/rtc/rtc-max77686.c   | 37 +++++++++----------
 drivers/rtc/rtc-meson-vrtc.c | 12 +++----
 drivers/rtc/rtc-meson.c      | 16 ++++-----
 drivers/rtc/rtc-pl030.c      | 14 ++++----
 drivers/rtc/rtc-rx8581.c     | 85 +++++++++++++++++++-------------------------
 drivers/rtc/rtc-s35390a.c    | 22 ++++++------
 drivers/rtc/rtc-s5m.c        | 58 +++++++++++++-----------------
 drivers/rtc/rtc-sd2405al.c   | 16 ++++-----
 drivers/rtc/rtc-sd3078.c     | 71 +++++++++++++++---------------------
 14 files changed, 183 insertions(+), 225 deletions(-)
---
base-commit: 0226d0ce98a477937ed295fb7df4cc30b46fc304
change-id: 20250228-rtc-cleanups-12c0b5123ea4

Best regards,

Comments

Alexandre Belloni March 1, 2025, 8:36 p.m. UTC | #1
On 28/02/2025 14:07:13+0000, André Draszik wrote:
> Hi,
> 
> While looking at RTC, I noticed that various drivers are keeping
> pointers to data that they're not using themselves throughout their
> lifetime.
> 
> So I took the liberty to drop these pointers and this series is the
> result.
> 
> The last two patches also convert two drivers to using dev_err_probe(),
> as I looked slightly closer into those two. They don't exactly fit the
> general subject of removal of unneeded pointers, but I wanted to share
> them anyway, since they're ready.
> 
> All of this was compile-tested only.
> 
> Cheers,
> Andre'
> 
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
> André Draszik (18):
>       rtc: max77686: drop needless struct max77686_rtc_info::rtc member
>       rtc: s5m: drop needless struct s5m_rtc_info::i2c member
>       rtc: aspeed: drop needless struct aspeed_rtc::rtc_dev member
>       rtc: ds2404: drop needless struct ds2404::rtc member
>       rtc: ep93xx: drop needless struct ep93xx_rtc::rtc member
>       rtc: ftrtc010: drop needless struct ftrtc010_rtc::rtc_dev member
>       rtc: m48t86: drop needless struct m48t86_rtc_info::rtc member
>       rtc: meson: drop needless struct meson_rtc::rtc member
>       rtc: meson-vrtc: drop needless struct meson_vrtc_data::rtc member
>       rtc: pl030: drop needless struct pl030_rtc::rtc member
>       rtc: rx8581: drop needless struct rx8581::rtc member
>       rtc: s35390a: drop needless struct s35390a::rtc member
>       rtc: sd2405al: drop needless struct sd2405al::rtc member
>       rtc: sd3078: drop needless struct sd3078::rtc member

My main concern with this is that as soon as we introduce irq support,
we are going to need the rtc pointer back in the struct. But I guess
that most of them are old enough to say that nobody is interested in irq
support.

>       rtc: rx8581: drop needless struct rx8581
>       rtc: sd3078: drop needless struct sd3078

I guess you could squash those two with the previous ones touching the
respective drivers because you are the one removing the last remaining
struct member.

>       rtc: max77686: use dev_err_probe() where appropriate
>       rtc: s5m: convert to dev_err_probe() where appropriate
> 
>  drivers/rtc/rtc-aspeed.c     | 16 ++++-----
>  drivers/rtc/rtc-ds2404.c     | 14 ++++----
>  drivers/rtc/rtc-ep93xx.c     | 16 ++++-----
>  drivers/rtc/rtc-ftrtc010.c   | 17 +++++----
>  drivers/rtc/rtc-m48t86.c     | 14 ++++----
>  drivers/rtc/rtc-max77686.c   | 37 +++++++++----------
>  drivers/rtc/rtc-meson-vrtc.c | 12 +++----
>  drivers/rtc/rtc-meson.c      | 16 ++++-----
>  drivers/rtc/rtc-pl030.c      | 14 ++++----
>  drivers/rtc/rtc-rx8581.c     | 85 +++++++++++++++++++-------------------------
>  drivers/rtc/rtc-s35390a.c    | 22 ++++++------
>  drivers/rtc/rtc-s5m.c        | 58 +++++++++++++-----------------
>  drivers/rtc/rtc-sd2405al.c   | 16 ++++-----
>  drivers/rtc/rtc-sd3078.c     | 71 +++++++++++++++---------------------
>  14 files changed, 183 insertions(+), 225 deletions(-)
> ---
> base-commit: 0226d0ce98a477937ed295fb7df4cc30b46fc304
> change-id: 20250228-rtc-cleanups-12c0b5123ea4
> 
> Best regards,
> -- 
> André Draszik <andre.draszik@linaro.org>
>
André Draszik March 3, 2025, 8:45 a.m. UTC | #2
Hi Alexandre,

On Sat, 2025-03-01 at 21:36 +0100, Alexandre Belloni wrote:
> On 28/02/2025 14:07:13+0000, André Draszik wrote:
> > Hi,
> > 
> > While looking at RTC, I noticed that various drivers are keeping
> > pointers to data that they're not using themselves throughout their
> > lifetime.
> > 
> > So I took the liberty to drop these pointers and this series is the
> > result.
> > 
> > The last two patches also convert two drivers to using dev_err_probe(),
> > as I looked slightly closer into those two. They don't exactly fit the
> > general subject of removal of unneeded pointers, but I wanted to share
> > them anyway, since they're ready.
> > 
> > All of this was compile-tested only.
> > 
> > Cheers,
> > Andre'
> > 
> > Signed-off-by: André Draszik <andre.draszik@linaro.org>
> > ---
> > André Draszik (18):
> >       rtc: max77686: drop needless struct max77686_rtc_info::rtc member
> >       rtc: s5m: drop needless struct s5m_rtc_info::i2c member
> >       rtc: aspeed: drop needless struct aspeed_rtc::rtc_dev member
> >       rtc: ds2404: drop needless struct ds2404::rtc member
> >       rtc: ep93xx: drop needless struct ep93xx_rtc::rtc member
> >       rtc: ftrtc010: drop needless struct ftrtc010_rtc::rtc_dev member
> >       rtc: m48t86: drop needless struct m48t86_rtc_info::rtc member
> >       rtc: meson: drop needless struct meson_rtc::rtc member
> >       rtc: meson-vrtc: drop needless struct meson_vrtc_data::rtc member
> >       rtc: pl030: drop needless struct pl030_rtc::rtc member
> >       rtc: rx8581: drop needless struct rx8581::rtc member
> >       rtc: s35390a: drop needless struct s35390a::rtc member
> >       rtc: sd2405al: drop needless struct sd2405al::rtc member
> >       rtc: sd3078: drop needless struct sd3078::rtc member
> 
> My main concern with this is that as soon as we introduce irq support,
> we are going to need the rtc pointer back in the struct. But I guess
> that most of them are old enough to say that nobody is interested in irq
> support.

Thanks for your thoughts Alexandre - I don't know the history of
these drivers and don't mind either way. I can drop those patches
that would require reintroducing if irq support is added in the
future. I think overall you're OK with keeping them, but please
let me know if I'm misunderstanding :-)

> 
> >       rtc: rx8581: drop needless struct rx8581
> >       rtc: sd3078: drop needless struct sd3078
> 
> I guess you could squash those two with the previous ones touching the
> respective drivers because you are the one removing the last remaining
> struct member.

Will do.

Cheers,
Andre'