Skip to content

Commit 99189d8

Browse files
Nikolaus Vossgregkh
Nikolaus Voss
authored andcommitted
drivers/usb/typec/tps6598x.c: fix 4CC cmd write
commit 2681795 upstream. Writing 4CC commands with tps6598x_write_4cc() already has a pointer arg, don't reference it when using as arg to tps6598x_block_write(). Correcting this enforces the constness of the pointer to propagate to tps6598x_block_write(), so add the const qualifier there to avoid the warning. Fixes: 0a4c005 ("usb: typec: driver for TI TPS6598x USB Power Delivery controllers") Signed-off-by: Nikolaus Voss <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 582aa3a commit 99189d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/typec/tps6598x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ tps6598x_block_read(struct tps6598x *tps, u8 reg, void *val, size_t len)
127127
}
128128

129129
static int tps6598x_block_write(struct tps6598x *tps, u8 reg,
130-
void *val, size_t len)
130+
const void *val, size_t len)
131131
{
132132
u8 data[TPS_MAX_LEN + 1];
133133

@@ -173,7 +173,7 @@ static inline int tps6598x_write64(struct tps6598x *tps, u8 reg, u64 val)
173173
static inline int
174174
tps6598x_write_4cc(struct tps6598x *tps, u8 reg, const char *val)
175175
{
176-
return tps6598x_block_write(tps, reg, &val, sizeof(u32));
176+
return tps6598x_block_write(tps, reg, val, 4);
177177
}
178178

179179
static int tps6598x_read_partner_identity(struct tps6598x *tps)

0 commit comments

Comments
 (0)