Commit 8eeb467d authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Bartosz Golaszewski

gpio: pca953x: Switch to use device_get_match_data()

Instead of open coded variants, switch to direct use of
device_get_match_data().
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
parent 7beb620f
...@@ -949,19 +949,15 @@ static int pca953x_probe(struct i2c_client *client, ...@@ -949,19 +949,15 @@ static int pca953x_probe(struct i2c_client *client,
if (i2c_id) { if (i2c_id) {
chip->driver_data = i2c_id->driver_data; chip->driver_data = i2c_id->driver_data;
} else { } else {
const struct acpi_device_id *acpi_id; const void *match;
struct device *dev = &client->dev;
match = device_get_match_data(&client->dev);
chip->driver_data = (uintptr_t)of_device_get_match_data(dev); if (!match) {
if (!chip->driver_data) { ret = -ENODEV;
acpi_id = acpi_match_device(pca953x_acpi_ids, dev); goto err_exit;
if (!acpi_id) {
ret = -ENODEV;
goto err_exit;
}
chip->driver_data = acpi_id->driver_data;
} }
chip->driver_data = (uintptr_t)match;
} }
i2c_set_clientdata(client, chip); i2c_set_clientdata(client, chip);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment