Commit 6dfbb2ce authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Sebastian Reichel
Browse files

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: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent a837f35c
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -486,8 +486,7 @@ static int max17040_probe(struct i2c_client *client,
		ret = max17040_get_of_data(chip);
		ret = max17040_get_of_data(chip);
		if (ret)
		if (ret)
			return ret;
			return ret;
		chip_id = (enum chip_id) (uintptr_t)
		chip_id = (uintptr_t)of_device_get_match_data(&client->dev);
			of_device_get_match_data(&client->dev);
	}
	}
	chip->data = max17040_family[chip_id];
	chip->data = max17040_family[chip_id];