summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-04-19 18:33:34 +0200
committerSebastian Reichel <sebastian.reichel@collabora.com>2021-04-20 16:18:08 +0200
commit6dfbb2cece78fc54a3f8bd116dbe20cf3bc63df1 (patch)
tree05304006340f199232e316fd56cdbfaae2f1af5a /drivers/power
parenta837f35c5ae0b0fb2b2b6bc1765b7be5a44b0a19 (diff)
power: supply: max17040: remove unneeded double cast
There is no need for double explicit cast from of_device_get_match_data() (uintptr_t and then to target enum) because implicit conversion from uintptr_t to enum is straightforward (uintptr_t is a integer type). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/max17040_battery.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c
index d2053cd0bd13..1aab868adabf 100644
--- a/drivers/power/supply/max17040_battery.c
+++ b/drivers/power/supply/max17040_battery.c
@@ -486,8 +486,7 @@ static int max17040_probe(struct i2c_client *client,
ret = max17040_get_of_data(chip);
if (ret)
return ret;
- chip_id = (enum chip_id) (uintptr_t)
- of_device_get_match_data(&client->dev);
+ chip_id = (uintptr_t)of_device_get_match_data(&client->dev);
}
chip->data = max17040_family[chip_id];