mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-26 04:20:54 +07:00
gpio: pca953x: Use of_device_get_match_data()
Use of_device_get_match_data() instead of open-coding it. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
fd46d5c350
commit
67bab93533
@ -810,13 +810,11 @@ static int pca953x_probe(struct i2c_client *client,
|
|||||||
chip->driver_data = i2c_id->driver_data;
|
chip->driver_data = i2c_id->driver_data;
|
||||||
} else {
|
} else {
|
||||||
const struct acpi_device_id *acpi_id;
|
const struct acpi_device_id *acpi_id;
|
||||||
const struct of_device_id *match;
|
struct device *dev = &client->dev;
|
||||||
|
|
||||||
match = of_match_device(pca953x_dt_ids, &client->dev);
|
chip->driver_data = (uintptr_t)of_device_get_match_data(dev);
|
||||||
if (match) {
|
if (!chip->driver_data) {
|
||||||
chip->driver_data = (int)(uintptr_t)match->data;
|
acpi_id = acpi_match_device(pca953x_acpi_ids, dev);
|
||||||
} else {
|
|
||||||
acpi_id = acpi_match_device(pca953x_acpi_ids, &client->dev);
|
|
||||||
if (!acpi_id) {
|
if (!acpi_id) {
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto err_exit;
|
goto err_exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user