summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-aspeed.c
diff options
context:
space:
mode:
authorAndré Draszik <andre.draszik@linaro.org>2025-03-04 17:05:31 +0000
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2025-03-05 23:08:00 +0100
commitd19111dff9c2dd0fcafaaea634236ecd0ec29c6a (patch)
tree39a18d12e17447d49c646b515257aedb878a6c9d /drivers/rtc/rtc-aspeed.c
parentafe5f9f94d1116e14c84908c64f589aa142745c4 (diff)
rtc: aspeed: drop needless struct aspeed_rtc::rtc_dev member
The memory pointed to by the ::rtc_dev 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-3-d4689a71668c@linaro.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-aspeed.c')
-rw-r--r--drivers/rtc/rtc-aspeed.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-aspeed.c b/drivers/rtc/rtc-aspeed.c
index 880b015eebaf..0d0053b52f9b 100644
--- a/drivers/rtc/rtc-aspeed.c
+++ b/drivers/rtc/rtc-aspeed.c
@@ -8,7 +8,6 @@
#include <linux/io.h>
struct aspeed_rtc {
- struct rtc_device *rtc_dev;
void __iomem *base;
};
@@ -85,6 +84,7 @@ static const struct rtc_class_ops aspeed_rtc_ops = {
static int aspeed_rtc_probe(struct platform_device *pdev)
{
struct aspeed_rtc *rtc;
+ struct rtc_device *rtc_dev;
rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
if (!rtc)
@@ -94,17 +94,17 @@ static int aspeed_rtc_probe(struct platform_device *pdev)
if (IS_ERR(rtc->base))
return PTR_ERR(rtc->base);
- rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
- if (IS_ERR(rtc->rtc_dev))
- return PTR_ERR(rtc->rtc_dev);
+ rtc_dev = devm_rtc_allocate_device(&pdev->dev);
+ if (IS_ERR(rtc_dev))
+ return PTR_ERR(rtc_dev);
platform_set_drvdata(pdev, rtc);
- rtc->rtc_dev->ops = &aspeed_rtc_ops;
- rtc->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_1900;
- rtc->rtc_dev->range_max = 38814989399LL; /* 3199-12-31 23:59:59 */
+ rtc_dev->ops = &aspeed_rtc_ops;
+ rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_1900;
+ rtc_dev->range_max = 38814989399LL; /* 3199-12-31 23:59:59 */
- return devm_rtc_register_device(rtc->rtc_dev);
+ return devm_rtc_register_device(rtc_dev);
}
static const struct of_device_id aspeed_rtc_match[] = {