arm/imx6: we use spin_lock_irqsave replace enter_critical_section to protect gpio init
,because enter_critical_section may be called before os initialized Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
2ee8aa6f2b
commit
ace5dde1a9
|
@ -29,6 +29,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/spinlock.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "arm_internal.h"
|
||||
|
@ -512,7 +513,7 @@ int imx_config_gpio(gpio_pinset_t pinset)
|
|||
|
||||
/* Configure the pin as an input initially to avoid any spurious outputs */
|
||||
|
||||
flags = enter_critical_section();
|
||||
flags = spin_lock_irqsave(NULL);
|
||||
|
||||
/* Configure based upon the pin mode */
|
||||
|
||||
|
@ -555,7 +556,7 @@ int imx_config_gpio(gpio_pinset_t pinset)
|
|||
break;
|
||||
}
|
||||
|
||||
leave_critical_section(flags);
|
||||
spin_unlock_irqrestore(NULL, flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue