Skip to content

Commit 4e57d14

Browse files
krzklag-linaro
authored andcommitted
mfd: wm31x: Fix Wvoid-pointer-to-enum-cast warning
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: wm831x-spi.c:36:10: error: cast to smaller integer type 'enum wm831x_parent' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 5033fb9 commit 4e57d14

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/mfd/wm831x-i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static int wm831x_i2c_probe(struct i2c_client *i2c)
3636
dev_err(&i2c->dev, "Failed to match device\n");
3737
return -ENODEV;
3838
}
39-
type = (enum wm831x_parent)of_id->data;
39+
type = (uintptr_t)of_id->data;
4040
} else {
4141
type = (enum wm831x_parent)id->driver_data;
4242
}

drivers/mfd/wm831x-spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static int wm831x_spi_probe(struct spi_device *spi)
3333
dev_err(&spi->dev, "Failed to match device\n");
3434
return -ENODEV;
3535
}
36-
type = (enum wm831x_parent)of_id->data;
36+
type = (uintptr_t)of_id->data;
3737
} else {
3838
type = (enum wm831x_parent)id->driver_data;
3939
}

0 commit comments

Comments
 (0)