reg = pdata->pad1;
ret = regmap_write(palmas->regmap[slave], addr, reg);
if (ret)
- goto err;
+ goto err_irq;
} else {
ret = regmap_read(palmas->regmap[slave], addr, ®);
if (ret)
- goto err;
+ goto err_irq;
}
if (!(reg & PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_0))
reg = pdata->pad2;
ret = regmap_write(palmas->regmap[slave], addr, reg);
if (ret)
- goto err;
+ goto err_irq;
} else {
ret = regmap_read(palmas->regmap[slave], addr, ®);
if (ret)
- goto err;
+ goto err_irq;
}
if (!(reg & PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_4))
ret = regmap_write(palmas->regmap[slave], addr, reg);
if (ret)
- goto err;
+ goto err_irq;
children = kmemdup(palmas_children, sizeof(palmas_children),
GFP_KERNEL);
if (!children) {
ret = -ENOMEM;
- goto err;
+ goto err_irq;
}
children[PALMAS_PMIC_ID].platform_data = pdata->pmic_pdata;
kfree(children);
if (ret < 0)
- goto err;
+ goto err_devices;
return ret;
-err:
+err_devices:
mfd_remove_devices(palmas->dev);
+err_irq:
+ regmap_del_irq_chip(palmas->irq, palmas->irq_data);
+err:
return ret;
}