diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-11-05 12:05:30 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2020-11-24 11:33:22 +0100 |
commit | 469bc41c29e616cadd641ac39070bde9b63acfdf (patch) | |
tree | 280db8c8c74cef5c9d30781fb854de68182dfd4f /drivers/platform | |
parent | platform/x86: i2c-multi-instantiate: Simplify with dev_err_probe() (diff) | |
download | linux-469bc41c29e616cadd641ac39070bde9b63acfdf.tar.xz linux-469bc41c29e616cadd641ac39070bde9b63acfdf.zip |
platform/x86: i2c-multi-instantiate: Use device_get_match_data() to get driver data
Use device_get_match_data() to get driver data instead of boilerplate code.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20201105110530.27888-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/i2c-multi-instantiate.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c index ce4d921c3301..b457b0babde3 100644 --- a/drivers/platform/x86/i2c-multi-instantiate.c +++ b/drivers/platform/x86/i2c-multi-instantiate.c @@ -13,6 +13,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/types.h> #define IRQ_RESOURCE_TYPE GENMASK(1, 0) @@ -59,7 +60,6 @@ static int i2c_multi_inst_count_resources(struct acpi_device *adev) static int i2c_multi_inst_probe(struct platform_device *pdev) { struct i2c_multi_inst_data *multi; - const struct acpi_device_id *match; const struct i2c_inst_data *inst_data; struct i2c_board_info board_info = {}; struct device *dev = &pdev->dev; @@ -67,12 +67,11 @@ static int i2c_multi_inst_probe(struct platform_device *pdev) char name[32]; int i, ret; - match = acpi_match_device(dev->driver->acpi_match_table, dev); - if (!match) { + inst_data = device_get_match_data(dev); + if (!inst_data) { dev_err(dev, "Error ACPI match data is missing\n"); return -ENODEV; } - inst_data = (const struct i2c_inst_data *)match->driver_data; adev = ACPI_COMPANION(dev); |