Commit f38bdd73 authored by Xianwei Zhao's avatar Xianwei Zhao Committed by Alexandre Belloni
Browse files

rtc: amlogic-a4: Optimize global variables



Convert a global variable into a local one of aml_rtc_probe().

Signed-off-by: default avatarXianwei Zhao <xianwei.zhao@amlogic.com>
Link: https://lore.kernel.org/r/20250722-rtc-regmap-v2-1-58bc17187a11@amlogic.com


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 75b002a3
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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;