diff options
| author | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-02-23 14:37:20 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-03-12 16:18:49 +0100 |
| commit | db0622ef4e65601489522c7bfe87409f4e60835c (patch) | |
| tree | 58afc2346e59b4f1bb8891973c97298486cf155f | |
| parent | 030706e954c10749da8c75464c6b02cb30cb00aa (diff) | |
soc: fsl: guts: don't access of_root directly
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Acked-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20260223-soc-of-root-v2-5-b45da45903c8@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/soc/fsl/guts.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index 40afb27b582b..9bee7baec2b9 100644 --- a/drivers/soc/fsl/guts.c +++ b/drivers/soc/fsl/guts.c @@ -186,7 +186,6 @@ static int __init fsl_guts_init(void) const struct fsl_soc_data *soc_data; const struct of_device_id *match; struct ccsr_guts __iomem *regs; - const char *machine = NULL; struct device_node *np; bool little_endian; u64 soc_uid = 0; @@ -217,13 +216,9 @@ static int __init fsl_guts_init(void) if (!soc_dev_attr) return -ENOMEM; - if (of_property_read_string(of_root, "model", &machine)) - of_property_read_string_index(of_root, "compatible", 0, &machine); - if (machine) { - soc_dev_attr->machine = kstrdup(machine, GFP_KERNEL); - if (!soc_dev_attr->machine) - goto err_nomem; - } + ret = soc_attr_read_machine(soc_dev_attr); + if (ret) + of_machine_read_compatible(&soc_dev_attr->machine, 0); soc_die = fsl_soc_die_match(svr, fsl_soc_die); if (soc_die) { @@ -267,7 +262,6 @@ static int __init fsl_guts_init(void) err_nomem: ret = -ENOMEM; err: - kfree(soc_dev_attr->machine); kfree(soc_dev_attr->family); kfree(soc_dev_attr->soc_id); kfree(soc_dev_attr->revision); |
