]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
soc: samsung: exynos-chipid: use a local dev variable
authorTudor Ambarus <tudor.ambarus@linaro.org>
Fri, 31 Oct 2025 12:56:01 +0000 (12:56 +0000)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 3 Nov 2025 10:02:01 +0000 (11:02 +0100)
Use a local variable for struct device to avoid dereferencing.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Link: https://patch.msgid.link/20251031-gs101-chipid-v1-2-d78d1076b210@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/soc/samsung/exynos-chipid.c

index 0f9f83a006795df08dae556ef37c2b78bd599ef5..d3b4b5508e0c808ee9f7b0039073ef57915d60fc 100644 (file)
@@ -109,16 +109,17 @@ static int exynos_chipid_probe(struct platform_device *pdev)
        const struct exynos_chipid_variant *drv_data;
        struct exynos_chipid_info soc_info;
        struct soc_device_attribute *soc_dev_attr;
+       struct device *dev = &pdev->dev;
        struct soc_device *soc_dev;
        struct device_node *root;
        struct regmap *regmap;
        int ret;
 
-       drv_data = of_device_get_match_data(&pdev->dev);
+       drv_data = of_device_get_match_data(dev);
        if (!drv_data)
                return -EINVAL;
 
-       regmap = device_node_to_regmap(pdev->dev.of_node);
+       regmap = device_node_to_regmap(dev->of_node);
        if (IS_ERR(regmap))
                return PTR_ERR(regmap);
 
@@ -126,8 +127,7 @@ static int exynos_chipid_probe(struct platform_device *pdev)
        if (ret < 0)
                return ret;
 
-       soc_dev_attr = devm_kzalloc(&pdev->dev, sizeof(*soc_dev_attr),
-                                   GFP_KERNEL);
+       soc_dev_attr = devm_kzalloc(dev, sizeof(*soc_dev_attr), GFP_KERNEL);
        if (!soc_dev_attr)
                return -ENOMEM;
 
@@ -137,8 +137,8 @@ static int exynos_chipid_probe(struct platform_device *pdev)
        of_property_read_string(root, "model", &soc_dev_attr->machine);
        of_node_put(root);
 
-       soc_dev_attr->revision = devm_kasprintf(&pdev->dev, GFP_KERNEL,
-                                               "%x", soc_info.revision);
+       soc_dev_attr->revision = devm_kasprintf(dev, GFP_KERNEL, "%x",
+                                               soc_info.revision);
        if (!soc_dev_attr->revision)
                return -ENOMEM;
        soc_dev_attr->soc_id = product_id_to_soc_id(soc_info.product_id);
@@ -152,13 +152,13 @@ static int exynos_chipid_probe(struct platform_device *pdev)
        if (IS_ERR(soc_dev))
                return PTR_ERR(soc_dev);
 
-       ret = exynos_asv_init(&pdev->dev, regmap);
+       ret = exynos_asv_init(dev, regmap);
        if (ret)
                goto err;
 
        platform_set_drvdata(pdev, soc_dev);
 
-       dev_info(&pdev->dev, "Exynos: CPU[%s] PRO_ID[0x%x] REV[0x%x] Detected\n",
+       dev_info(dev, "Exynos: CPU[%s] PRO_ID[0x%x] REV[0x%x] Detected\n",
                 soc_dev_attr->soc_id, soc_info.product_id, soc_info.revision);
 
        return 0;