From dbc59aa75bce130c6d4152b4957f45f466918e48 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 25 Mar 2022 18:20:13 +0100 Subject: [PATCH] drivers/cst816s: use gpio_is_valid where appropriate --- drivers/cst816s/cst816s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cst816s/cst816s.c b/drivers/cst816s/cst816s.c index 38a3aab11c..72c1c4cbe7 100644 --- a/drivers/cst816s/cst816s.c +++ b/drivers/cst816s/cst816s.c @@ -89,12 +89,12 @@ int cst816s_init(cst816s_t *dev, const cst816s_params_t *params, dev->cb = cb; dev->cb_arg = arg; - if (dev->params->reset != GPIO_UNDEF) { + if (gpio_is_valid(dev->params->reset)) { gpio_init(dev->params->reset, GPIO_OUT); _cst816s_reset(dev); } - if ((dev->params->irq != GPIO_UNDEF) && cb) { + if (gpio_is_valid(dev->params->irq) && cb) { if (gpio_init_int(dev->params->irq, GPIO_IN, dev->params->irq_flank, _gpio_irq, dev) < 0) {