mirror of https://github.com/torvalds/linux.git
soc: samsung: exynos-chipid: use a local dev variable
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>
This commit is contained in:
parent
af17f9f0bb
commit
bea18c67a0
|
|
@ -109,16 +109,17 @@ static int exynos_chipid_probe(struct platform_device *pdev)
|
||||||
const struct exynos_chipid_variant *drv_data;
|
const struct exynos_chipid_variant *drv_data;
|
||||||
struct exynos_chipid_info soc_info;
|
struct exynos_chipid_info soc_info;
|
||||||
struct soc_device_attribute *soc_dev_attr;
|
struct soc_device_attribute *soc_dev_attr;
|
||||||
|
struct device *dev = &pdev->dev;
|
||||||
struct soc_device *soc_dev;
|
struct soc_device *soc_dev;
|
||||||
struct device_node *root;
|
struct device_node *root;
|
||||||
struct regmap *regmap;
|
struct regmap *regmap;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
drv_data = of_device_get_match_data(&pdev->dev);
|
drv_data = of_device_get_match_data(dev);
|
||||||
if (!drv_data)
|
if (!drv_data)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
regmap = device_node_to_regmap(pdev->dev.of_node);
|
regmap = device_node_to_regmap(dev->of_node);
|
||||||
if (IS_ERR(regmap))
|
if (IS_ERR(regmap))
|
||||||
return PTR_ERR(regmap);
|
return PTR_ERR(regmap);
|
||||||
|
|
||||||
|
|
@ -126,8 +127,7 @@ static int exynos_chipid_probe(struct platform_device *pdev)
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
soc_dev_attr = devm_kzalloc(&pdev->dev, sizeof(*soc_dev_attr),
|
soc_dev_attr = devm_kzalloc(dev, sizeof(*soc_dev_attr), GFP_KERNEL);
|
||||||
GFP_KERNEL);
|
|
||||||
if (!soc_dev_attr)
|
if (!soc_dev_attr)
|
||||||
return -ENOMEM;
|
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_property_read_string(root, "model", &soc_dev_attr->machine);
|
||||||
of_node_put(root);
|
of_node_put(root);
|
||||||
|
|
||||||
soc_dev_attr->revision = devm_kasprintf(&pdev->dev, GFP_KERNEL,
|
soc_dev_attr->revision = devm_kasprintf(dev, GFP_KERNEL, "%x",
|
||||||
"%x", soc_info.revision);
|
soc_info.revision);
|
||||||
if (!soc_dev_attr->revision)
|
if (!soc_dev_attr->revision)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
soc_dev_attr->soc_id = product_id_to_soc_id(soc_info.product_id);
|
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))
|
if (IS_ERR(soc_dev))
|
||||||
return PTR_ERR(soc_dev);
|
return PTR_ERR(soc_dev);
|
||||||
|
|
||||||
ret = exynos_asv_init(&pdev->dev, regmap);
|
ret = exynos_asv_init(dev, regmap);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
platform_set_drvdata(pdev, soc_dev);
|
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);
|
soc_dev_attr->soc_id, soc_info.product_id, soc_info.revision);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue