summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuEe-GUI <[email protected]>2024-12-30 11:41:13 +0800
committerRbb666 <[email protected]>2025-02-11 14:58:18 +0800
commit5a455cb6151908cc9ac891bdedc89e383423e7f6 (patch)
tree39abe6a9a004a813295952dc63d60d5e0f866623
parent578cfc0b2a8c769630199f8a1cc12fcef42e8b8f (diff)
[DM/PIN] Reset the value of PIN_NONE
PIN_NONE is '-1', is similar to '-RT_ERROR', '-RT_EEMPTY' is better. Signed-off-by: GuEe-GUI <[email protected]>
-rw-r--r--components/drivers/include/drivers/dev_pin.h2
-rw-r--r--components/drivers/regulator/regulator-gpio.c2
2 files changed, 2 insertions, 2 deletions
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;