drivers: gpio: use gpio_is_ready_dt helper function
Update `struct gpio_dt_spec` use with gpio_is_ready_dt() Signed-off-by: Nick Ward <nix.ward@gmail.com>
This commit is contained in:
parent
3f0ee7f6db
commit
2d65acca3a
184 changed files with 248 additions and 248 deletions
|
@ -188,7 +188,7 @@ static void configure_button_irq(const struct gpio_dt_spec btn)
|
|||
{
|
||||
int ret;
|
||||
|
||||
if (!device_is_ready(btn.port)) {
|
||||
if (!gpio_is_ready_dt(&btn)) {
|
||||
printk("Error: button device %s is not ready\n", btn.port->name);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -269,7 +269,7 @@ static int hci_spi_init(void)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!device_is_ready(irq.port)) {
|
||||
if (!gpio_is_ready_dt(&irq)) {
|
||||
LOG_ERR("IRQ GPIO port %s is not ready", irq.port->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
@ -296,7 +296,7 @@ int main(void)
|
|||
#if defined(HAS_LED)
|
||||
printk("Get reference to LED device...");
|
||||
|
||||
if (!device_is_ready(led_gpio.port)) {
|
||||
if (!gpio_is_ready_dt(&led_gpio)) {
|
||||
printk("LED gpio device not ready.\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -269,8 +269,8 @@ int board_init(uint16_t *addr)
|
|||
struct mb_display *disp = mb_display_get();
|
||||
|
||||
if (!(device_is_ready(nvm) && device_is_ready(pwm) &&
|
||||
device_is_ready(button_a.port) &&
|
||||
device_is_ready(button_b.port))) {
|
||||
gpio_is_ready_dt(&button_a) &&
|
||||
gpio_is_ready_dt(&button_b))) {
|
||||
printk("One or more devices are not ready\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
|
|
@ -328,7 +328,7 @@ static void button_init(void)
|
|||
{
|
||||
int ret;
|
||||
|
||||
if (!device_is_ready(button.port)) {
|
||||
if (!gpio_is_ready_dt(&button)) {
|
||||
printk("Error: button device %s is not ready\n", button.port->name);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ int main(void)
|
|||
|
||||
#if defined(HAS_LED)
|
||||
printk("Checking LED device...");
|
||||
if (!device_is_ready(led.port)) {
|
||||
if (!gpio_is_ready_dt(&led)) {
|
||||
printk("failed.\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ int button_init(gpio_callback_handler_t handler)
|
|||
{
|
||||
int ret;
|
||||
|
||||
if (!device_is_ready(button.port)) {
|
||||
if (!gpio_is_ready_dt(&button)) {
|
||||
LOG_ERR("Error: button GPIO device %s is not ready",
|
||||
button.port->name);
|
||||
return -ENODEV;
|
||||
|
|
|
@ -35,7 +35,7 @@ int led_init(void)
|
|||
{
|
||||
int ret;
|
||||
|
||||
led_ok = device_is_ready(led.port);
|
||||
led_ok = gpio_is_ready_dt(&led);
|
||||
if (!led_ok) {
|
||||
LOG_ERR("Error: LED on GPIO %s pin %d is not ready",
|
||||
led.port->name, led.pin);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue