ret = gpio_request(GTP_INT_PORT, "GTP_INT_IRQ");
if (ret < 0) {
GTP_ERROR("Failed to request GPIO:%d, ERRNO:%d", (s32) GTP_INT_PORT, ret);
- ret = -ENODEV;
+ return -ENODEV;
} else {
GTP_GPIO_AS_INT(GTP_INT_PORT);
gt1x_i2c_client->irq = GTP_INT_IRQ;
ret = gpio_request(GTP_RST_PORT, "GTP_RST_PORT");
if (ret < 0) {
GTP_ERROR("Failed to request GPIO:%d, ERRNO:%d", (s32) GTP_RST_PORT, ret);
- ret = -ENODEV;
+ gpio_free(GTP_INT_PORT);
+ return -ENODEV;
}
GTP_GPIO_AS_INPUT(GTP_RST_PORT);
- if (ret < 0) {
- gpio_free(GTP_RST_PORT);
- gpio_free(GTP_INT_PORT);
- }
return ret;
}