include: sbi_utils: Remove driver pointer from struct i2c_adapter
authorAnup Patel <apatel@ventanamicro.com>
Fri, 21 Jul 2023 08:09:43 +0000 (13:39 +0530)
committerAnup Patel <anup@brainfault.org>
Mon, 31 Jul 2023 08:39:06 +0000 (14:09 +0530)
The "driver" pointer in struct i2c_adapter is not used anywhere
so let us remove it.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Xiang W <wxjstz@126.com>
include/sbi_utils/i2c/i2c.h
lib/utils/i2c/fdt_i2c_dw.c
lib/utils/i2c/fdt_i2c_sifive.c

index 5a70364144b15493f2bcbc1d007332db51ab4673..93a44f4e49ad4b0739b5e2199d2d2c898622e7cc 100644 (file)
@@ -15,9 +15,6 @@
 
 /** Representation of a I2C adapter */
 struct i2c_adapter {
-       /** Pointer to I2C driver owning this I2C adapter */
-       void *driver;
-
        /** Unique ID of the I2C adapter assigned by the driver */
        int id;
 
index 99b2ddb84111380207b1e3ffed5c9be46b017f84..358ad3c7743f47ff5aa28ffa090ef4205d6a82ad 100644 (file)
@@ -15,8 +15,6 @@
 #include <sbi_utils/i2c/dw_i2c.h>
 #include <sbi_utils/i2c/fdt_i2c.h>
 
-extern struct fdt_i2c_adapter fdt_i2c_adapter_dw;
-
 static int fdt_dw_i2c_init(void *fdt, int nodeoff,
                             const struct fdt_match *match)
 {
@@ -35,7 +33,6 @@ static int fdt_dw_i2c_init(void *fdt, int nodeoff,
        }
 
        adapter->addr = addr;
-       adapter->adapter.driver = &fdt_i2c_adapter_dw;
 
        rc = dw_i2c_init(&adapter->adapter, nodeoff);
        if (rc) {
index b85b245c75f72e0b1e0b5e1788983f8dbae6b719..11740624b405d624dc3e9028e492ed19938c3a96 100644 (file)
@@ -46,8 +46,6 @@ struct sifive_i2c_adapter {
        struct i2c_adapter adapter;
 };
 
-extern struct fdt_i2c_adapter fdt_i2c_adapter_sifive;
-
 static inline void sifive_i2c_setreg(struct sifive_i2c_adapter *adap,
                                     uint8_t reg, uint8_t value)
 {
@@ -250,7 +248,6 @@ static int sifive_i2c_init(void *fdt, int nodeoff,
        }
 
        adapter->addr = addr;
-       adapter->adapter.driver = &fdt_i2c_adapter_sifive;
        adapter->adapter.id = nodeoff;
        adapter->adapter.write = sifive_i2c_adapter_write;
        adapter->adapter.read = sifive_i2c_adapter_read;