mfd: intel_soc_pmic_chtwc: Use dev_err_probe()
Simplify the mux error path a bit by using dev_err_probe(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220616171009.43524-1-andriy.shevchenko@linux.intel.com
This commit is contained in:
parent
c55333064d
commit
352de78076
@ -179,18 +179,13 @@ static int cht_wc_probe(struct i2c_client *client)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
status = acpi_evaluate_integer(ACPI_HANDLE(dev), "_HRV", NULL, &hrv);
|
status = acpi_evaluate_integer(ACPI_HANDLE(dev), "_HRV", NULL, &hrv);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status))
|
||||||
dev_err(dev, "Failed to get PMIC hardware revision\n");
|
return dev_err_probe(dev, -ENODEV, "Failed to get PMIC hardware revision\n");
|
||||||
return -ENODEV;
|
if (hrv != CHT_WC_HRV)
|
||||||
}
|
return dev_err_probe(dev, -ENODEV, "Invalid PMIC hardware revision: %llu\n", hrv);
|
||||||
if (hrv != CHT_WC_HRV) {
|
|
||||||
dev_err(dev, "Invalid PMIC hardware revision: %llu\n", hrv);
|
if (client->irq < 0)
|
||||||
return -ENODEV;
|
return dev_err_probe(dev, -EINVAL, "Invalid IRQ\n");
|
||||||
}
|
|
||||||
if (client->irq < 0) {
|
|
||||||
dev_err(dev, "Invalid IRQ\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
pmic = devm_kzalloc(dev, sizeof(*pmic), GFP_KERNEL);
|
pmic = devm_kzalloc(dev, sizeof(*pmic), GFP_KERNEL);
|
||||||
if (!pmic)
|
if (!pmic)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user