diff --git a/components/drivers/include/drivers/dev_pin.h b/components/drivers/include/drivers/dev_pin.h index b1705ae6dd..0cb15c3af9 100644 --- a/components/drivers/include/drivers/dev_pin.h +++ b/components/drivers/include/drivers/dev_pin.h @@ -111,7 +111,7 @@ struct rt_device_pin const struct rt_pin_ops *ops; }; -#define PIN_NONE (-1) +#define PIN_NONE (-RT_EEMPTY) #define PIN_LOW 0x00 /*!< low level */ #define PIN_HIGH 0x01 /*!< high level */ diff --git a/components/drivers/regulator/regulator-gpio.c b/components/drivers/regulator/regulator-gpio.c index 069831835f..0ba9b9534c 100644 --- a/components/drivers/regulator/regulator-gpio.c +++ b/components/drivers/regulator/regulator-gpio.c @@ -193,7 +193,7 @@ static rt_err_t regulator_gpio_probe(struct rt_platform_device *pdev) /* GPIO flags are ignored, we check by enable-active-high */ rg->enable_pin = rt_pin_get_named_pin(dev, "enable", 0, RT_NULL, RT_NULL); - if (rg->enable_pin < 0 && rg->enable_pin != -RT_EEMPTY) + if (rg->enable_pin < 0 && rg->enable_pin != PIN_NONE) { err = rg->enable_pin; goto _fail;