Commit 469bc41c authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Hans de Goede

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20201105110530.27888-4-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent a9d1c250
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/types.h> #include <linux/types.h>
#define IRQ_RESOURCE_TYPE GENMASK(1, 0) #define IRQ_RESOURCE_TYPE GENMASK(1, 0)
...@@ -59,7 +60,6 @@ static int i2c_multi_inst_count_resources(struct acpi_device *adev) ...@@ -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) static int i2c_multi_inst_probe(struct platform_device *pdev)
{ {
struct i2c_multi_inst_data *multi; struct i2c_multi_inst_data *multi;
const struct acpi_device_id *match;
const struct i2c_inst_data *inst_data; const struct i2c_inst_data *inst_data;
struct i2c_board_info board_info = {}; struct i2c_board_info board_info = {};
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -67,12 +67,11 @@ static int i2c_multi_inst_probe(struct platform_device *pdev) ...@@ -67,12 +67,11 @@ static int i2c_multi_inst_probe(struct platform_device *pdev)
char name[32]; char name[32];
int i, ret; int i, ret;
match = acpi_match_device(dev->driver->acpi_match_table, dev); inst_data = device_get_match_data(dev);
if (!match) { if (!inst_data) {
dev_err(dev, "Error ACPI match data is missing\n"); dev_err(dev, "Error ACPI match data is missing\n");
return -ENODEV; return -ENODEV;
} }
inst_data = (const struct i2c_inst_data *)match->driver_data;
adev = ACPI_COMPANION(dev); adev = ACPI_COMPANION(dev);
......
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