HID: i2c-hid: Move i2c_hid_acpi_pdata error reporting to inside the function
Log an error in all error paths of i2c_hid_acpi_pdata() instead of having the caller log a generic error. This is a preparation patch for allowing i2c_hid_acpi_pdata() to fail silently under certain conditions. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
e8403b493f
commit
67767a5f7c
|
@ -874,13 +874,15 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client,
|
||||||
acpi_handle handle;
|
acpi_handle handle;
|
||||||
|
|
||||||
handle = ACPI_HANDLE(&client->dev);
|
handle = ACPI_HANDLE(&client->dev);
|
||||||
if (!handle || acpi_bus_get_device(handle, &adev))
|
if (!handle || acpi_bus_get_device(handle, &adev)) {
|
||||||
|
dev_err(&client->dev, "Error could not get ACPI device\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
obj = acpi_evaluate_dsm_typed(handle, &i2c_hid_guid, 1, 1, NULL,
|
obj = acpi_evaluate_dsm_typed(handle, &i2c_hid_guid, 1, 1, NULL,
|
||||||
ACPI_TYPE_INTEGER);
|
ACPI_TYPE_INTEGER);
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
dev_err(&client->dev, "device _DSM execution failed\n");
|
dev_err(&client->dev, "Error _DSM call to get HID descriptor address failed\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -995,11 +997,8 @@ static int i2c_hid_probe(struct i2c_client *client,
|
||||||
goto err;
|
goto err;
|
||||||
} else if (!platform_data) {
|
} else if (!platform_data) {
|
||||||
ret = i2c_hid_acpi_pdata(client, &ihid->pdata);
|
ret = i2c_hid_acpi_pdata(client, &ihid->pdata);
|
||||||
if (ret) {
|
if (ret)
|
||||||
dev_err(&client->dev,
|
|
||||||
"HID register address not provided\n");
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
ihid->pdata = *platform_data;
|
ihid->pdata = *platform_data;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue