usb: typec: tps6598x: Check mode of operation
Quoted 11 lines · Sergei Shtylyov
Quoted 9 lines · Heikki Krogerus
Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +6
-0+static int tps6598x_check_mode(struct tps6598x *tps) +{ + char mode[5] = { }; + int ret; + + ret = tps6598x_read32(tps, TPS_REG_MODE, (void *)mode);Casting pointers to 'void *' happens automagically, doesn't i?
Quoted 3 lines
Quoted 1 line
The third parameter in
tps6598x_read32()is 'u32 *'.Then why cast to 'void *'?
Because if we don't cast:
drivers/usb/typec/tps6598x.c:408:43: error: passing argument 3 of ‘tps6598x_read32’ from incompatible pointer type