Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: pl030: drop needless struct pl030_rtc::rtc member

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.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/20250304-rtc-cleanups-v2-10-d4689a71668c@linaro.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

André Draszik and committed by
Alexandre Belloni
3d5d0fe1 38c7aaea

+7 -7
+7 -7
drivers/rtc/rtc-pl030.c
··· 21 21 #define RTC_CR_MIE (1 << 0) 22 22 23 23 struct pl030_rtc { 24 - struct rtc_device *rtc; 25 24 void __iomem *base; 26 25 }; 27 26 ··· 85 86 { 86 87 struct pl030_rtc *rtc; 87 88 int ret; 89 + struct rtc_device *rtc_dev; 88 90 89 91 ret = amba_request_regions(dev, NULL); 90 92 if (ret) ··· 97 97 goto err_rtc; 98 98 } 99 99 100 - rtc->rtc = devm_rtc_allocate_device(&dev->dev); 101 - if (IS_ERR(rtc->rtc)) { 102 - ret = PTR_ERR(rtc->rtc); 100 + rtc_dev = devm_rtc_allocate_device(&dev->dev); 101 + if (IS_ERR(rtc_dev)) { 102 + ret = PTR_ERR(rtc_dev); 103 103 goto err_rtc; 104 104 } 105 105 106 - rtc->rtc->ops = &pl030_ops; 107 - rtc->rtc->range_max = U32_MAX; 106 + rtc_dev->ops = &pl030_ops; 107 + rtc_dev->range_max = U32_MAX; 108 108 rtc->base = ioremap(dev->res.start, resource_size(&dev->res)); 109 109 if (!rtc->base) { 110 110 ret = -ENOMEM; ··· 121 121 if (ret) 122 122 goto err_irq; 123 123 124 - ret = devm_rtc_register_device(rtc->rtc); 124 + ret = devm_rtc_register_device(rtc_dev); 125 125 if (ret) 126 126 goto err_reg; 127 127