]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API
authorBilly Tsai <billy_tsai@aspeedtech.com>
Tue, 4 Feb 2025 09:17:01 +0000 (17:17 +0800)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 20 Feb 2025 21:54:28 +0000 (22:54 +0100)
The change is necessary to enable the use of the
`i2c_get_dma_safe_msg_buf()` API, which requires a non-const
`struct i2c_msg *` to operate. The `i2c_get_dma_safe_msg_buf()` function
ensures safe handling of I2C messages when using DMA, making it essential
for scenarios where DMA transfers are involved. By removing the `const`
qualifier, this patch allows drivers to prepare and manage DMA-safe
buffers directly.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
Link: https://lore.kernel.org/r/20250204091702.4014466-1-billy_tsai@aspeedtech.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master/dw-i3c-master.c
drivers/i3c/master/i3c-master-cdns.c
drivers/i3c/master/mipi-i3c-hci/core.c
drivers/i3c/master/svc-i3c-master.c
include/linux/i3c/master.h

index 2fbf8b2addd0c2a1490054483a8480bb66122414..611c22b72c1572ddf717c8ad473e44a3b8fcceaf 100644 (file)
@@ -1079,7 +1079,7 @@ static void dw_i3c_master_detach_i3c_dev(struct i3c_dev_desc *dev)
 }
 
 static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
-                                  const struct i2c_msg *i2c_xfers,
+                                  struct i2c_msg *i2c_xfers,
                                   int i2c_nxfers)
 {
        struct dw_i3c_i2c_dev_data *data = i2c_dev_get_master_data(dev);
index fedbe6624a1c89b800e71206b3cf939dea933abe..fd3752cea654954ed1e37337754e45fddbbbf68e 100644 (file)
@@ -813,7 +813,7 @@ static int cdns_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
 }
 
 static int cdns_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
-                                    const struct i2c_msg *xfers, int nxfers)
+                                    struct i2c_msg *xfers, int nxfers)
 {
        struct i3c_master_controller *m = i2c_dev_get_master(dev);
        struct cdns_i3c_master *master = to_cdns_i3c_master(m);
index 648c501407ced8dc8cd47b7a9df9f87aba677b04..a34eec850bcc5f8e941714860f1e77f4fb7e2b9b 100644 (file)
@@ -367,7 +367,7 @@ out:
 }
 
 static int i3c_hci_i2c_xfers(struct i2c_dev_desc *dev,
-                            const struct i2c_msg *i2c_xfers, int nxfers)
+                            struct i2c_msg *i2c_xfers, int nxfers)
 {
        struct i3c_master_controller *m = i2c_dev_get_master(dev);
        struct i3c_hci *hci = to_i3c_hci(m);
index d6057d8c7dec4ea90e1e9206290f0c1d75f749ad..413479b12ba696a6dccdd4238e17398d8d4c856a 100644 (file)
@@ -1584,7 +1584,7 @@ static int svc_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
 }
 
 static int svc_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
-                                   const struct i2c_msg *xfers,
+                                   struct i2c_msg *xfers,
                                    int nxfers)
 {
        struct i3c_master_controller *m = i2c_dev_get_master(dev);
index 12d532b012c5ae742b0d5ff2e5abfcf78a45d017..c67922ece617d6320c0c7e4838c2e7edda8c19f5 100644 (file)
@@ -475,7 +475,7 @@ struct i3c_master_controller_ops {
        int (*attach_i2c_dev)(struct i2c_dev_desc *dev);
        void (*detach_i2c_dev)(struct i2c_dev_desc *dev);
        int (*i2c_xfers)(struct i2c_dev_desc *dev,
-                        const struct i2c_msg *xfers, int nxfers);
+                        struct i2c_msg *xfers, int nxfers);
        int (*request_ibi)(struct i3c_dev_desc *dev,
                           const struct i3c_ibi_setup *req);
        void (*free_ibi)(struct i3c_dev_desc *dev);