info->dev = &i2c->dev;
info->i2c = i2c;
info->int_gpiod = devm_gpiod_get(&i2c->dev, "int", GPIOD_IN);
- if (!info->int_gpiod) {
+ if (IS_ERR(info->int_gpiod)) {
dev_err(dev, "failed to get INT GPIO\n");
- return -EINVAL;
+ return PTR_ERR(info->int_gpiod);
}
info->vbus_gpiod = devm_gpiod_get(&i2c->dev, "vbus", GPIOD_IN);
- if (!info->vbus_gpiod) {
+ if (IS_ERR(info->vbus_gpiod)) {
dev_err(dev, "failed to get VBUS GPIO\n");
- return -EINVAL;
+ return PTR_ERR(info->vbus_gpiod);
}
ret = gpiod_direction_output(info->vbus_gpiod, 0);
if (ret) {