qcom: qpnp-pq: Fix -Wpointer-to-int-cast

drivers/power/supply/qcom/qpnp-qg.c:5110:21: error: cast to smaller integer type 'u8' (aka 'unsigned char') from 'const void *' [-Werror,-Wvoid-pointer-to-int-cast]
        chip->qg_version = (u8)of_device_get_match_data(&pdev->dev);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix `chip->qg_version = (u8)of_device_get_match_data(&pdev->dev)`
by casting pointer value to enum qg_version instead of truncated
int type.

Bug: 171827315
Signed-off-by: lucaswei <lucaswei@google.com>
Change-Id: I1dd1eb91bda9b44ca640a2c89c94d158abff5e7f
This commit is contained in:
lucaswei authored and Michael Bestas committed 2025-12-31 12:15:34 +02:00
1 parent 200782755a
commit 076aca3e24
1 file changed
+1 -1
+1 -1
View File
@@ -4738,7 +4738,7 @@ static int qpnp_qg_probe(struct platform_device *pdev)
chip->batt_age_level = -EINVAL;
chip->qg_charge_counter = -EINVAL;
chip->qg_version = (u8)of_device_get_match_data(&pdev->dev);
chip->qg_version = (enum qg_version)of_device_get_match_data(&pdev->dev);
switch (chip->qg_version) {
case QG_LITE: