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

rtc: ep93xx: drop needless struct ep93xx_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.

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

authored by

André Draszik and committed by
Alexandre Belloni
5d0ad519 1b625aaf

+8 -8
+8 -8
drivers/rtc/rtc-ep93xx.c
··· 28 28 29 29 struct ep93xx_rtc { 30 30 void __iomem *mmio_base; 31 - struct rtc_device *rtc; 32 31 }; 33 32 34 33 static int ep93xx_rtc_get_swcomp(struct device *dev, unsigned short *preload, ··· 122 123 static int ep93xx_rtc_probe(struct platform_device *pdev) 123 124 { 124 125 struct ep93xx_rtc *ep93xx_rtc; 126 + struct rtc_device *rtc; 125 127 int err; 126 128 127 129 ep93xx_rtc = devm_kzalloc(&pdev->dev, sizeof(*ep93xx_rtc), GFP_KERNEL); ··· 135 135 136 136 platform_set_drvdata(pdev, ep93xx_rtc); 137 137 138 - ep93xx_rtc->rtc = devm_rtc_allocate_device(&pdev->dev); 139 - if (IS_ERR(ep93xx_rtc->rtc)) 140 - return PTR_ERR(ep93xx_rtc->rtc); 138 + rtc = devm_rtc_allocate_device(&pdev->dev); 139 + if (IS_ERR(rtc)) 140 + return PTR_ERR(rtc); 141 141 142 - ep93xx_rtc->rtc->ops = &ep93xx_rtc_ops; 143 - ep93xx_rtc->rtc->range_max = U32_MAX; 142 + rtc->ops = &ep93xx_rtc_ops; 143 + rtc->range_max = U32_MAX; 144 144 145 - err = rtc_add_group(ep93xx_rtc->rtc, &ep93xx_rtc_sysfs_files); 145 + err = rtc_add_group(rtc, &ep93xx_rtc_sysfs_files); 146 146 if (err) 147 147 return err; 148 148 149 - return devm_rtc_register_device(ep93xx_rtc->rtc); 149 + return devm_rtc_register_device(rtc); 150 150 } 151 151 152 152 static const struct of_device_id ep93xx_rtc_of_ids[] = {