diff options
author | André Draszik <andre.draszik@linaro.org> | 2025-03-04 17:05:38 +0000 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2025-03-05 23:08:00 +0100 |
commit | 3d5d0fe1cb82eea1831d33a8db08b142d208d7fe (patch) | |
tree | 4175c996bffdeb58cd874fb63f8301eacf1cabfb /drivers/rtc | |
parent | 38c7aaeab8b888180abaec88c4304a95e1f74b76 (diff) |
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>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-pl030.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c index 1326f310bf93..5caaa714f448 100644 --- a/drivers/rtc/rtc-pl030.c +++ b/drivers/rtc/rtc-pl030.c @@ -21,7 +21,6 @@ #define RTC_CR_MIE (1 << 0) struct pl030_rtc { - struct rtc_device *rtc; void __iomem *base; }; @@ -86,6 +85,7 @@ static int pl030_probe(struct amba_device *dev, const struct amba_id *id) { struct pl030_rtc *rtc; int ret; + struct rtc_device *rtc_dev; ret = amba_request_regions(dev, NULL); if (ret) @@ -97,14 +97,14 @@ static int pl030_probe(struct amba_device *dev, const struct amba_id *id) goto err_rtc; } - rtc->rtc = devm_rtc_allocate_device(&dev->dev); - if (IS_ERR(rtc->rtc)) { - ret = PTR_ERR(rtc->rtc); + rtc_dev = devm_rtc_allocate_device(&dev->dev); + if (IS_ERR(rtc_dev)) { + ret = PTR_ERR(rtc_dev); goto err_rtc; } - rtc->rtc->ops = &pl030_ops; - rtc->rtc->range_max = U32_MAX; + rtc_dev->ops = &pl030_ops; + rtc_dev->range_max = U32_MAX; rtc->base = ioremap(dev->res.start, resource_size(&dev->res)); if (!rtc->base) { ret = -ENOMEM; @@ -121,7 +121,7 @@ static int pl030_probe(struct amba_device *dev, const struct amba_id *id) if (ret) goto err_irq; - ret = devm_rtc_register_device(rtc->rtc); + ret = devm_rtc_register_device(rtc_dev); if (ret) goto err_reg; |