]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/msm/adreno: Pass device_node to find_chipid()
authorRob Clark <robin.clark@oss.qualcomm.com>
Mon, 9 Jun 2025 18:24:36 +0000 (11:24 -0700)
committerRob Clark <robin.clark@oss.qualcomm.com>
Mon, 9 Jun 2025 19:52:02 +0000 (12:52 -0700)
We are going to want to re-use this before the component is bound, when
we don't yet have the device pointer (but we do have the of node).

v2: use %pOF

Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/657705/

drivers/gpu/drm/msm/adreno/adreno_device.c

index f5e1490d07c1868fa21cddb38de44c28af5ca0d5..f176796e238d3c76a5be8f65e585749498ba59cf 100644 (file)
@@ -137,9 +137,8 @@ err_disable_rpm:
        return NULL;
 }
 
-static int find_chipid(struct device *dev, uint32_t *chipid)
+static int find_chipid(struct device_node *node, uint32_t *chipid)
 {
-       struct device_node *node = dev->of_node;
        const char *compat;
        int ret;
 
@@ -173,11 +172,12 @@ static int find_chipid(struct device *dev, uint32_t *chipid)
        /* and if that fails, fall back to legacy "qcom,chipid" property: */
        ret = of_property_read_u32(node, "qcom,chipid", chipid);
        if (ret) {
-               DRM_DEV_ERROR(dev, "could not parse qcom,chipid: %d\n", ret);
+               DRM_ERROR("%pOF: could not parse qcom,chipid: %d\n",
+                         node, ret);
                return ret;
        }
 
-       dev_warn(dev, "Using legacy qcom,chipid binding!\n");
+       pr_warn("%pOF: Using legacy qcom,chipid binding!\n", node);
 
        return 0;
 }
@@ -191,7 +191,7 @@ static int adreno_bind(struct device *dev, struct device *master, void *data)
        struct msm_gpu *gpu;
        int ret;
 
-       ret = find_chipid(dev, &config.chip_id);
+       ret = find_chipid(dev->of_node, &config.chip_id);
        if (ret)
                return ret;