/* Obtain the GPIO descriptor from the number specified in param.  */
int32_t gpio_get(struct gpio_desc **desc, const struct gpio_init_param *param)
/* Obtain the GPIO descriptor from the number specified in param.  */
int32_t gpio_get(struct gpio_desc **desc, const struct gpio_init_param *param)
{
	if (!desc || !param)
		return FAILURE;
	(*desc) = calloc(1, sizeof(**desc));
	if (!(*desc))
		return FAILURE;
	(*desc)->number = param->number;
	if (nb_gpio == 0)
		if (SUCCESS != adi_gpio_Init(mem_gpio_handler,
					     ADI_GPIO_MEMORY_SIZE)) {
			free(*desc);
			*desc = NULL;
			return FAILURE;
		}
	nb_gpio++;
	return SUCCESS;
}