Skip to content

Commit

Permalink
drivers/usb/typec/tps6598x.c: fix 4CC cmd write
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Nikolaus Voss authored and gregkh committed Jul 14, 2019
1 parent 8a2f9af commit 52a7655
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/typec/tps6598x.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ tps6598x_block_read(struct tps6598x *tps, u8 reg, void *val, size_t len)
}

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

Expand Down Expand Up @@ -173,7 +173,7 @@ static inline int tps6598x_write64(struct tps6598x *tps, u8 reg, u64 val)
static inline int
tps6598x_write_4cc(struct tps6598x *tps, u8 reg, const char *val)
{
return tps6598x_block_write(tps, reg, &val, sizeof(u32));
return tps6598x_block_write(tps, reg, val, 4);
}

static int tps6598x_read_partner_identity(struct tps6598x *tps)
Expand Down

0 comments on commit 52a7655

Please sign in to comment.