Skip to contentSkip to conversation

regulator: Fix incorrect casting in tps6230-regulator.c

PATCH In review Luis Gonzalez Fernandez 2 participants 2 messages Sep 10, 2012 – Sep 11, 2012 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: Fix incorrect casting in tps6230-regulator.c

linux-3.6/drivers/regulator/tps62360-regulator.c: In function ‘tps62360_probe’:
linux-3.6/drivers/regulator/tps62360-regulator.c:364:13: warning: cast from poi$

Fix incorrect cast in tps62360_probe() function.

---
 drivers/regulator/tps62360-regulator.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/tps62360-regulator.c +1 -1
index 68729a7..02ff11c 100644
@@ -361,7 +361,7 @@ static int __devinit tps62360_probe(struct i2c_client *client,
 			dev_err(&client->dev, "Error: No device match found\n");
 			return -ENODEV;
 		}
-		chip_id = (int)match->data;
+		chip_id = *((int *)match->data);
 		if (!pdata)
 			pdata = of_get_tps62360_platform_data(&client->dev);
 	}
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 4 lines · Luis Gonzalez Fernandez

linux-3.6/drivers/regulator/tps62360-regulator.c: In function ‘tps62360_probe’:
linux-3.6/drivers/regulator/tps62360-regulator.c:364:13: warning: cast from poi$

Fix incorrect cast in tps62360_probe() function.

This fix isn't at all obvious and the warning doesn't show up for me. In general you need to supply some words explaining what you're doing, simply pasting a copy of an error message doesn't explain why your new code is good.