Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
return -ENODEV;
}
- chip = kzalloc(sizeof(*chip), GFP_KERNEL);
+ chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
if (ret) {
dev_err(&client->dev, "failed to request irq %d\n",
chip->irq);
- goto out_free_chip;
+ return ret;
}
}
if (chip->irq)
free_irq(chip->irq, chip);
-out_free_chip:
- kfree(chip);
-
return ret;
}
adp5520_remove_subdevs(chip);
adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0);
- kfree(chip);
return 0;
}