mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
rtc: s5m: drop needless struct s5m_rtc_info::i2c member
When this driver was converted to using the devres managed i2c device
in commit 7db7ad0817 ("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>
This commit is contained in:
parent
6c9405fd25
commit
afe5f9f94d
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user