1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/cst816s: use gpio_is_valid where appropriate

This commit is contained in:
Alexandre Abadie 2022-03-25 18:20:13 +01:00
parent 2d33b5f3a5
commit dbc59aa75b
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -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) {