mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 13:11:40 +00:00
ACPI: LPSS: Deduplicate skipping device in acpi_lpss_create_device()
Add a new label to deduplicate skipping device code in the acpi_lpss_create_device(). No functional change intended. While at it, convert the last conditional to use the classical pattern, i.e. if (err) ...handle err... Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
da13b3361b
commit
6cc401be16
@ -670,9 +670,7 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
|
|||||||
if (!pdata->mmio_base) {
|
if (!pdata->mmio_base) {
|
||||||
/* Avoid acpi_bus_attach() instantiating a pdev for this dev. */
|
/* Avoid acpi_bus_attach() instantiating a pdev for this dev. */
|
||||||
adev->pnp.type.platform_id = 0;
|
adev->pnp.type.platform_id = 0;
|
||||||
/* Skip the device, but continue the namespace scan. */
|
goto out_free;
|
||||||
ret = 0;
|
|
||||||
goto err_out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pdata->adev = adev;
|
pdata->adev = adev;
|
||||||
@ -683,11 +681,8 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
|
|||||||
|
|
||||||
if (dev_desc->flags & LPSS_CLK) {
|
if (dev_desc->flags & LPSS_CLK) {
|
||||||
ret = register_device_clock(adev, pdata);
|
ret = register_device_clock(adev, pdata);
|
||||||
if (ret) {
|
if (ret)
|
||||||
/* Skip the device, but continue the namespace scan. */
|
goto out_free;
|
||||||
ret = 0;
|
|
||||||
goto err_out;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -699,15 +694,19 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
|
|||||||
|
|
||||||
adev->driver_data = pdata;
|
adev->driver_data = pdata;
|
||||||
pdev = acpi_create_platform_device(adev, dev_desc->properties);
|
pdev = acpi_create_platform_device(adev, dev_desc->properties);
|
||||||
if (!IS_ERR_OR_NULL(pdev)) {
|
if (IS_ERR_OR_NULL(pdev)) {
|
||||||
acpi_lpss_create_device_links(adev, pdev);
|
adev->driver_data = NULL;
|
||||||
return 1;
|
ret = PTR_ERR(pdev);
|
||||||
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = PTR_ERR(pdev);
|
acpi_lpss_create_device_links(adev, pdev);
|
||||||
adev->driver_data = NULL;
|
return 1;
|
||||||
|
|
||||||
err_out:
|
out_free:
|
||||||
|
/* Skip the device, but continue the namespace scan */
|
||||||
|
ret = 0;
|
||||||
|
err_out:
|
||||||
kfree(pdata);
|
kfree(pdata);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user