Skip to content

Commit 6866c91

Browse files
billy-tsaialexandrebelloni
authored andcommitted
i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API
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 <[email protected]> Reviewed-by: Frank Li <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Acked-by: Mukesh Kumar Savaliya <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent bdffad8 commit 6866c91

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

drivers/i3c/master/dw-i3c-master.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ static void dw_i3c_master_detach_i3c_dev(struct i3c_dev_desc *dev)
10791079
}
10801080

10811081
static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
1082-
const struct i2c_msg *i2c_xfers,
1082+
struct i2c_msg *i2c_xfers,
10831083
int i2c_nxfers)
10841084
{
10851085
struct dw_i3c_i2c_dev_data *data = i2c_dev_get_master_data(dev);

drivers/i3c/master/i3c-master-cdns.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ static int cdns_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
813813
}
814814

815815
static int cdns_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
816-
const struct i2c_msg *xfers, int nxfers)
816+
struct i2c_msg *xfers, int nxfers)
817817
{
818818
struct i3c_master_controller *m = i2c_dev_get_master(dev);
819819
struct cdns_i3c_master *master = to_cdns_i3c_master(m);

drivers/i3c/master/mipi-i3c-hci/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static int i3c_hci_priv_xfers(struct i3c_dev_desc *dev,
367367
}
368368

369369
static int i3c_hci_i2c_xfers(struct i2c_dev_desc *dev,
370-
const struct i2c_msg *i2c_xfers, int nxfers)
370+
struct i2c_msg *i2c_xfers, int nxfers)
371371
{
372372
struct i3c_master_controller *m = i2c_dev_get_master(dev);
373373
struct i3c_hci *hci = to_i3c_hci(m);

drivers/i3c/master/svc-i3c-master.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ static int svc_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
15841584
}
15851585

15861586
static int svc_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
1587-
const struct i2c_msg *xfers,
1587+
struct i2c_msg *xfers,
15881588
int nxfers)
15891589
{
15901590
struct i3c_master_controller *m = i2c_dev_get_master(dev);

include/linux/i3c/master.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ struct i3c_master_controller_ops {
475475
int (*attach_i2c_dev)(struct i2c_dev_desc *dev);
476476
void (*detach_i2c_dev)(struct i2c_dev_desc *dev);
477477
int (*i2c_xfers)(struct i2c_dev_desc *dev,
478-
const struct i2c_msg *xfers, int nxfers);
478+
struct i2c_msg *xfers, int nxfers);
479479
int (*request_ibi)(struct i3c_dev_desc *dev,
480480
const struct i3c_ibi_setup *req);
481481
void (*free_ibi)(struct i3c_dev_desc *dev);

0 commit comments

Comments
 (0)