]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rtc: meson-vrtc: drop needless struct meson_vrtc_data::rtc member
authorAndré Draszik <andre.draszik@linaro.org>
Tue, 4 Mar 2025 17:05:37 +0000 (17:05 +0000)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 5 Mar 2025 22:08:00 +0000 (23:08 +0100)
The memory pointed to by the ::rtc member is managed via devres, and
no code in this driver uses it past _probe().

We can drop it from the structure and just use a local temporary
variable, reducing runtime memory consumption by a few bytes.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/20250304-rtc-cleanups-v2-9-d4689a71668c@linaro.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-meson-vrtc.c

index 5849729f7d01d7ec7868ff3bbdc5ed599aaa8238..7d38258cbe376e5a1b2af6250cb6d04c313175fb 100644 (file)
@@ -13,7 +13,6 @@
 
 struct meson_vrtc_data {
        void __iomem *io_alarm;
-       struct rtc_device *rtc;
        unsigned long alarm_time;
        bool enabled;
 };
@@ -65,6 +64,7 @@ static const struct rtc_class_ops meson_vrtc_ops = {
 static int meson_vrtc_probe(struct platform_device *pdev)
 {
        struct meson_vrtc_data *vrtc;
+       struct rtc_device *rtc;
 
        vrtc = devm_kzalloc(&pdev->dev, sizeof(*vrtc), GFP_KERNEL);
        if (!vrtc)
@@ -78,12 +78,12 @@ static int meson_vrtc_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, vrtc);
 
-       vrtc->rtc = devm_rtc_allocate_device(&pdev->dev);
-       if (IS_ERR(vrtc->rtc))
-               return PTR_ERR(vrtc->rtc);
+       rtc = devm_rtc_allocate_device(&pdev->dev);
+       if (IS_ERR(rtc))
+               return PTR_ERR(rtc);
 
-       vrtc->rtc->ops = &meson_vrtc_ops;
-       return devm_rtc_register_device(vrtc->rtc);
+       rtc->ops = &meson_vrtc_ops;
+       return devm_rtc_register_device(rtc);
 }
 
 static int __maybe_unused meson_vrtc_suspend(struct device *dev)