drivers: i2c_nrfx_twim: Fix compilation with disabled PINCTRL

This is a follow-up to commits 9974bb043f
and 00ecc66677.

Add one missing `#ifdef CONFIG_PINCTRL` and remove a no longer needed
one to restore the possibility to use this driver without PINCTRL.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2022-09-19 10:22:45 +02:00 committed by Carles Cufí
parent 52e2493842
commit 3a6584b0ae

View file

@ -289,8 +289,10 @@ static int i2c_nrfx_twim_recover_bus(const struct device *dev)
/* restore peripheral if it was active before */
if (state == PM_DEVICE_STATE_ACTIVE) {
#ifdef CONFIG_PINCTRL
(void)pinctrl_apply_state(dev_config->pcfg,
PINCTRL_STATE_DEFAULT);
#endif
nrfx_twim_enable(&dev_config->twim);
}
@ -307,9 +309,7 @@ static const struct i2c_driver_api i2c_nrfx_twim_driver_api = {
static int twim_nrfx_pm_action(const struct device *dev,
enum pm_device_action action)
{
#ifdef CONFIG_PINCTRL
const struct i2c_nrfx_twim_config *dev_config = dev->config;
#endif
int ret = 0;
switch (action) {