lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230725143023.86325-3-andriy.shevchenko@linux.intel.com>
Date:   Tue, 25 Jul 2023 17:30:16 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Jarkko Nikula <jarkko.nikula@...ux.intel.com>,
        Mario Limonciello <mario.limonciello@....com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Wolfram Sang <wsa@...nel.org>, linux-i2c@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     Mika Westerberg <mika.westerberg@...ux.intel.com>,
        Jan Dabros <jsd@...ihalf.com>,
        Andi Shyti <andi.shyti@...nel.org>
Subject: [PATCH v1 2/9] i2c: designware: Change i2c_dw_acpi_configure() prototype

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@...ux.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(-)

diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c
index 683f7a9beb46..222b530c0441 100644
--- a/drivers/i2c/busses/i2c-designware-common.c
+++ b/drivers/i2c/busses/i2c-designware-common.c
@@ -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);
 
diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h
index cf4f684f5356..03f4d44ae94c 100644
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -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
diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index d9d80650fbdc..7f5a04538c71 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -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) {
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 4eedb0734438..c60e55b8398e 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -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)
-- 
2.40.0.1.gaa8946217a0b

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ