Commit b29f42c6 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Mark Brown

regulator: max77857: Fix Wvoid-pointer-to-enum-cast warning

'id' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  max77857-regulator.c:56:24: error: cast to smaller integer type 'enum max77857_id' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast]
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810111914.204847-2-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent fddc9bb6
......@@ -53,7 +53,7 @@ enum max77857_id {
static bool max77857_volatile_reg(struct device *dev, unsigned int reg)
{
enum max77857_id id = (enum max77857_id)dev_get_drvdata(dev);
enum max77857_id id = (uintptr_t)dev_get_drvdata(dev);
switch (id) {
case ID_MAX77831:
......@@ -91,7 +91,7 @@ static int max77857_get_status(struct regulator_dev *rdev)
static unsigned int max77857_get_mode(struct regulator_dev *rdev)
{
enum max77857_id id = (enum max77857_id)rdev_get_drvdata(rdev);
enum max77857_id id = (uintptr_t)rdev_get_drvdata(rdev);
unsigned int regval;
int ret;
......@@ -125,7 +125,7 @@ static unsigned int max77857_get_mode(struct regulator_dev *rdev)
static int max77857_set_mode(struct regulator_dev *rdev, unsigned int mode)
{
enum max77857_id id = (enum max77857_id)rdev_get_drvdata(rdev);
enum max77857_id id = (uintptr_t)rdev_get_drvdata(rdev);
unsigned int reg, val;
switch (id) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment