Skip to content

Commit 546a251

Browse files
committed
[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]>
1 parent c189222 commit 546a251

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

components/drivers/include/drivers/dev_pin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ struct rt_device_pin
111111
const struct rt_pin_ops *ops;
112112
};
113113

114-
#define PIN_NONE (-1)
114+
#define PIN_NONE (-RT_EEMPTY)
115115

116116
#define PIN_LOW 0x00 /*!< low level */
117117
#define PIN_HIGH 0x01 /*!< high level */

components/drivers/regulator/regulator-gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static rt_err_t regulator_gpio_probe(struct rt_platform_device *pdev)
193193
/* GPIO flags are ignored, we check by enable-active-high */
194194
rg->enable_pin = rt_pin_get_named_pin(dev, "enable", 0, RT_NULL, RT_NULL);
195195

196-
if (rg->enable_pin < 0 && rg->enable_pin != -RT_EEMPTY)
196+
if (rg->enable_pin < 0 && rg->enable_pin != PIN_NONE)
197197
{
198198
err = rg->enable_pin;
199199
goto _fail;

0 commit comments

Comments
 (0)