فهرست منبع

[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 <2991707448@qq.com>
GuEe-GUI 4 ماه پیش
والد
کامیت
5a455cb615
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      components/drivers/include/drivers/dev_pin.h
  2. 1 1
      components/drivers/regulator/regulator-gpio.c

+ 1 - 1
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 */

+ 1 - 1
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;