mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
rtc: max77686: drop needless struct max77686_rtc_info::rtc member
When this driver was converted to using the devres managed i2c device
in commit 59a7f24fce ("rtc: max77686: convert to
devm_i2c_new_dummy_device()"), struct max77686_rtc_info::rtc 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-1-d4689a71668c@linaro.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
d659dfec7d
commit
6c9405fd25
|
|
@ -85,7 +85,6 @@ struct max77686_rtc_driver_data {
|
|||
|
||||
struct max77686_rtc_info {
|
||||
struct device *dev;
|
||||
struct i2c_client *rtc;
|
||||
struct rtc_device *rtc_dev;
|
||||
struct mutex lock;
|
||||
|
||||
|
|
@ -691,6 +690,7 @@ static int max77686_init_rtc_regmap(struct max77686_rtc_info *info)
|
|||
{
|
||||
struct device *parent = info->dev->parent;
|
||||
struct i2c_client *parent_i2c = to_i2c_client(parent);
|
||||
struct i2c_client *client;
|
||||
int ret;
|
||||
|
||||
if (info->drv_data->rtc_irq_from_platform) {
|
||||
|
|
@ -714,14 +714,14 @@ static int max77686_init_rtc_regmap(struct max77686_rtc_info *info)
|
|||
goto add_rtc_irq;
|
||||
}
|
||||
|
||||
info->rtc = devm_i2c_new_dummy_device(info->dev, parent_i2c->adapter,
|
||||
info->drv_data->rtc_i2c_addr);
|
||||
if (IS_ERR(info->rtc)) {
|
||||
client = devm_i2c_new_dummy_device(info->dev, parent_i2c->adapter,
|
||||
info->drv_data->rtc_i2c_addr);
|
||||
if (IS_ERR(client)) {
|
||||
dev_err(info->dev, "Failed to allocate I2C device for RTC\n");
|
||||
return PTR_ERR(info->rtc);
|
||||
return PTR_ERR(client);
|
||||
}
|
||||
|
||||
info->rtc_regmap = devm_regmap_init_i2c(info->rtc,
|
||||
info->rtc_regmap = devm_regmap_init_i2c(client,
|
||||
info->drv_data->regmap_config);
|
||||
if (IS_ERR(info->rtc_regmap)) {
|
||||
ret = PTR_ERR(info->rtc_regmap);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user