Skip to content

Commit f38bdd7

Browse files
Xianwei Zhaoalexandrebelloni
authored andcommitted
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>
1 parent 75b002a commit f38bdd7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/rtc/rtc-amlogic-a4.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@ struct aml_rtc_data {
7272
const struct aml_rtc_config *config;
7373
};
7474

75-
static const struct regmap_config aml_rtc_regmap_config = {
76-
.reg_bits = 32,
77-
.val_bits = 32,
78-
.reg_stride = 4,
79-
.max_register = RTC_REAL_TIME,
80-
};
81-
8275
static inline u32 gray_to_binary(u32 gray)
8376
{
8477
u32 bcd = gray;
@@ -328,6 +321,13 @@ static int aml_rtc_probe(struct platform_device *pdev)
328321
void __iomem *base;
329322
int ret = 0;
330323

324+
const struct regmap_config aml_rtc_regmap_config = {
325+
.reg_bits = 32,
326+
.val_bits = 32,
327+
.reg_stride = 4,
328+
.max_register = RTC_REAL_TIME,
329+
};
330+
331331
rtc = devm_kzalloc(dev, sizeof(*rtc), GFP_KERNEL);
332332
if (!rtc)
333333
return -ENOMEM;

0 commit comments

Comments
 (0)