i2c/designware: Constify struct device * parameter to dw_i2c_soc_dev_to_bus

dw_i2c_soc_dev_to_bus() does not need to modify the device
structure. Thus, this change makes the struct device * parameter to
dw_i2c_soc_dev_to_bus as const.

Change-Id: Ibf5c8d8127dff2ab2ccbd1f6b4f553e98e81955f
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40704
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Furquan Shaikh 2020-04-24 21:33:02 -07:00
parent 5b5c233e90
commit 00296ea96f
4 changed files with 4 additions and 4 deletions

View File

@ -129,7 +129,7 @@ int dw_i2c_transfer(unsigned int bus,
* -1 = failure
* >=0 = logical bus number
*/
int dw_i2c_soc_dev_to_bus(struct device *dev);
int dw_i2c_soc_dev_to_bus(const struct device *dev);
/*
* Common device_operations implementation to initialize the i2c host

View File

@ -63,7 +63,7 @@ const char *i2c_acpi_name(const struct device *dev)
}
}
int dw_i2c_soc_dev_to_bus(struct device *dev)
int dw_i2c_soc_dev_to_bus(const struct device *dev)
{
switch (dev->path.mmio.addr) {
case APU_I2C2_BASE:

View File

@ -64,7 +64,7 @@ const char *i2c_acpi_name(const struct device *dev)
}
}
int dw_i2c_soc_dev_to_bus(struct device *dev)
int dw_i2c_soc_dev_to_bus(const struct device *dev)
{
switch (dev->path.mmio.addr) {
case I2CA_BASE_ADDRESS:

View File

@ -14,7 +14,7 @@
#include <soc/iomap.h>
#include <soc/pci_devs.h>
int dw_i2c_soc_dev_to_bus(struct device *dev)
int dw_i2c_soc_dev_to_bus(const struct device *dev)
{
pci_devfn_t devfn = dev->path.pci.devfn;
return dw_i2c_soc_devfn_to_bus(devfn);