@@ -286,14 +286,10 @@ static void i2c_dw_acpi_do_configure(struct dw_i2c_dev *dev, struct device *devi
}
}
-int i2c_dw_acpi_configure(struct device *device)
+void i2c_dw_acpi_configure(struct dw_i2c_dev *dev)
{
- struct dw_i2c_dev *dev = dev_get_drvdata(device);
-
- if (has_acpi_companion(device))
- i2c_dw_acpi_do_configure(dev, device);
-
- return 0;
+ if (has_acpi_companion(dev->dev))
+ i2c_dw_acpi_do_configure(dev, dev->dev);
}
EXPORT_SYMBOL_GPL(i2c_dw_acpi_configure);
@@ -394,7 +394,7 @@ int i2c_dw_validate_speed(struct dw_i2c_dev *dev);
void i2c_dw_adjust_bus_speed(struct dw_i2c_dev *dev);
#if IS_ENABLED(CONFIG_ACPI)
-int i2c_dw_acpi_configure(struct device *device);
+void i2c_dw_acpi_configure(struct dw_i2c_dev *dev);
#else
-static inline int i2c_dw_acpi_configure(struct device *device) { return -ENODEV; }
+static inline void i2c_dw_acpi_configure(struct dw_i2c_dev *dev) { }
#endif
@@ -303,7 +303,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
i2c_dw_adjust_bus_speed(dev);
- i2c_dw_acpi_configure(&pdev->dev);
+ i2c_dw_acpi_configure(dev);
r = i2c_dw_validate_speed(dev);
if (r) {
@@ -314,7 +314,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
if (pdev->dev.of_node)
dw_i2c_of_configure(pdev);
- i2c_dw_acpi_configure(&pdev->dev);
+ i2c_dw_acpi_configure(dev);
ret = i2c_dw_validate_speed(dev);
if (ret)
There is no point to have it being int and at the same time it may take struct dw_i2c_dev pointer instead of plain device. Change the prototype and implementation accordingly. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/i2c/busses/i2c-designware-common.c | 10 +++------- drivers/i2c/busses/i2c-designware-core.h | 4 ++-- drivers/i2c/busses/i2c-designware-pcidrv.c | 2 +- drivers/i2c/busses/i2c-designware-platdrv.c | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-)