Skip to content

Commit e29ebbe

Browse files
etienne-lmsjhedberg
authored andcommitted
drivers: i2c: stm32: drop few redundant guards in RTIO driver
Drop few CONFIG_PM_DEVICE_RUNTIME guards, the pm_device_runtime functions they are masking are no-op automatically when the corresponding config option is not selected. This change is related to the change made in the STM32 non-RTIO driver trough commit 4f3523d ("i2c: stm32: drop few redundant guards"). Signed-off-by: Etienne Carriere <[email protected]>
1 parent 181e544 commit e29ebbe

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

drivers/i2c/i2c_ll_stm32_rtio.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,7 @@ static int i2c_stm32_init(const struct device *dev)
269269
return ret;
270270
}
271271

272-
#ifdef CONFIG_PM_DEVICE_RUNTIME
273272
(void)pm_device_runtime_enable(dev);
274-
#endif
275273

276274
return 0;
277275
}

drivers/i2c/i2c_ll_stm32_v2_rtio.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ int i2c_stm32_target_register(const struct device *dev,
209209
return ret;
210210
}
211211

212-
#if defined(CONFIG_PM_DEVICE_RUNTIME)
213212
/* Mark device as active */
214213
(void)pm_device_runtime_get(dev);
215214

@@ -218,7 +217,6 @@ int i2c_stm32_target_register(const struct device *dev,
218217
LOG_DBG("i2c: enabling wakeup from stop");
219218
LL_I2C_EnableWakeUpFromStop(cfg->i2c);
220219
}
221-
#endif /* defined(CONFIG_PM_DEVICE_RUNTIME) */
222220

223221
LL_I2C_Enable(i2c);
224222

@@ -299,13 +297,11 @@ int i2c_stm32_target_unregister(const struct device *dev,
299297

300298
LL_I2C_Disable(i2c);
301299

302-
#if defined(CONFIG_PM_DEVICE_RUNTIME)
303300
if (pm_device_wakeup_is_capable(dev)) {
304301
/* Disable wake-up from STOP */
305302
LOG_DBG("i2c: disabling wakeup from stop");
306303
LL_I2C_DisableWakeUpFromStop(i2c);
307304
}
308-
#endif /* defined(CONFIG_PM_DEVICE_RUNTIME) */
309305

310306
/* Release the device */
311307
(void)pm_device_runtime_put(dev);

0 commit comments

Comments
 (0)