summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXianwei Zhao <xianwei.zhao@amlogic.com>2025-07-22 19:30:48 +0800
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2025-10-05 23:11:00 +0200
commitf38bdd730914be1fcd63240af89a2dc802148c8a (patch)
tree1b535149e78751acc5b59a44a4607912bab5c3a5
parent75b002a38d4f740d51f0e09dcd778541f61a2797 (diff)
rtc: amlogic-a4: Optimize global variables
Convert a global variable into a local one of aml_rtc_probe(). Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com> Link: https://lore.kernel.org/r/20250722-rtc-regmap-v2-1-58bc17187a11@amlogic.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r--drivers/rtc/rtc-amlogic-a4.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-amlogic-a4.c b/drivers/rtc/rtc-amlogic-a4.c
index 09d78c2cc691..1928b29c1045 100644
--- a/drivers/rtc/rtc-amlogic-a4.c
+++ b/drivers/rtc/rtc-amlogic-a4.c
@@ -72,13 +72,6 @@ struct aml_rtc_data {
const struct aml_rtc_config *config;
};
-static const struct regmap_config aml_rtc_regmap_config = {
- .reg_bits = 32,
- .val_bits = 32,
- .reg_stride = 4,
- .max_register = RTC_REAL_TIME,
-};
-
static inline u32 gray_to_binary(u32 gray)
{
u32 bcd = gray;
@@ -328,6 +321,13 @@ static int aml_rtc_probe(struct platform_device *pdev)
void __iomem *base;
int ret = 0;
+ const struct regmap_config aml_rtc_regmap_config = {
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_stride = 4,
+ .max_register = RTC_REAL_TIME,
+ };
+
rtc = devm_kzalloc(dev, sizeof(*rtc), GFP_KERNEL);
if (!rtc)
return -ENOMEM;