diff options
author | 2025-03-04 17:05:30 +0000 | |
---|---|---|
committer | 2025-03-05 23:08:00 +0100 | |
commit | afe5f9f94d1116e14c84908c64f589aa142745c4 (patch) | |
tree | 7946f0b407b7730220af6d23f4072f88e84daa22 | |
parent | rtc: max77686: drop needless struct max77686_rtc_info::rtc member (diff) | |
download | wireguard-linux-afe5f9f94d1116e14c84908c64f589aa142745c4.tar.xz wireguard-linux-afe5f9f94d1116e14c84908c64f589aa142745c4.zip |
rtc: s5m: drop needless struct s5m_rtc_info::i2c member
When this driver was converted to using the devres managed i2c device
in commit 7db7ad0817fe ("rtc: s5m: use devm_i2c_new_dummy_device()"),
struct s5m_rtc_info::i2c became essentially unused.
We can drop it from the structure and just use a local temporary
variable, reducing runtime memory consumption by a few bytes.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/20250304-rtc-cleanups-v2-2-d4689a71668c@linaro.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r-- | drivers/rtc/rtc-s5m.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c index 36acca5b2639..88aed2766034 100644 --- a/drivers/rtc/rtc-s5m.c +++ b/drivers/rtc/rtc-s5m.c @@ -146,7 +146,6 @@ static const struct s5m_rtc_reg_config s2mps15_rtc_regs = { struct s5m_rtc_info { struct device *dev; - struct i2c_client *i2c; struct sec_pmic_dev *s5m87xx; struct regmap *regmap; struct rtc_device *rtc_dev; @@ -640,6 +639,7 @@ static int s5m_rtc_probe(struct platform_device *pdev) { struct sec_pmic_dev *s5m87xx = dev_get_drvdata(pdev->dev.parent); struct s5m_rtc_info *info; + struct i2c_client *i2c; const struct regmap_config *regmap_cfg; int ret, alarm_irq; @@ -675,14 +675,14 @@ static int s5m_rtc_probe(struct platform_device *pdev) return -ENODEV; } - info->i2c = devm_i2c_new_dummy_device(&pdev->dev, s5m87xx->i2c->adapter, - RTC_I2C_ADDR); - if (IS_ERR(info->i2c)) { + i2c = devm_i2c_new_dummy_device(&pdev->dev, s5m87xx->i2c->adapter, + RTC_I2C_ADDR); + if (IS_ERR(i2c)) { dev_err(&pdev->dev, "Failed to allocate I2C for RTC\n"); - return PTR_ERR(info->i2c); + return PTR_ERR(i2c); } - info->regmap = devm_regmap_init_i2c(info->i2c, regmap_cfg); + info->regmap = devm_regmap_init_i2c(i2c, regmap_cfg); if (IS_ERR(info->regmap)) { ret = PTR_ERR(info->regmap); dev_err(&pdev->dev, "Failed to allocate RTC register map: %d\n", |