mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
soc: fsl: guts: make fsl_soc_data available after fsl_guts_init()
In a future change, struct fsl_soc_data will be extended with methods for performing RCW override. Since this will be performed from a calling context outside fsl_guts_init(), we need to keep track of the soc_data that we determine at fsl_guts_init() time, so we can reference it later. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com> Link: https://lore.kernel.org/r/20260721231603.67865-7-vladimir.oltean@nxp.com Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
This commit is contained in:
parent
5f331a987f
commit
01a6586601
|
|
@ -138,6 +138,7 @@ static const struct fsl_soc_die_attr fsl_soc_die[] = {
|
|||
|
||||
static struct fsl_soc_guts {
|
||||
struct ccsr_guts __iomem *dcfg_ccsr;
|
||||
const struct fsl_soc_data *data;
|
||||
bool little_endian;
|
||||
u32 svr;
|
||||
} soc;
|
||||
|
|
@ -231,10 +232,9 @@ static const struct of_device_id fsl_guts_of_match[] = {
|
|||
|
||||
static int __init fsl_guts_init(void)
|
||||
{
|
||||
struct soc_device_attribute *soc_dev_attr;
|
||||
struct soc_device_attribute *soc_dev_attr = NULL;
|
||||
static struct soc_device *soc_dev;
|
||||
const struct fsl_soc_die_attr *soc_die;
|
||||
const struct fsl_soc_data *soc_data;
|
||||
const struct of_device_id *match;
|
||||
struct device_node *np;
|
||||
u64 soc_uid = 0;
|
||||
|
|
@ -243,12 +243,13 @@ static int __init fsl_guts_init(void)
|
|||
np = of_find_matching_node_and_match(NULL, fsl_guts_of_match, &match);
|
||||
if (!np)
|
||||
return 0;
|
||||
soc_data = match->data;
|
||||
soc.data = match->data;
|
||||
|
||||
soc.dcfg_ccsr = of_iomap(np, DCFG_CCSR);
|
||||
if (!soc.dcfg_ccsr) {
|
||||
of_node_put(np);
|
||||
return -ENOMEM;
|
||||
ret = -ENOMEM;
|
||||
goto err_clear_soc_data;
|
||||
}
|
||||
|
||||
soc.little_endian = of_property_read_bool(np, "little-endian");
|
||||
|
|
@ -291,9 +292,9 @@ static int __init fsl_guts_init(void)
|
|||
goto err_free_soc_id;
|
||||
}
|
||||
|
||||
if (soc_data)
|
||||
soc_uid = fsl_guts_get_soc_uid(soc_data->sfp_compat,
|
||||
soc_data->uid_offset);
|
||||
if (soc.data)
|
||||
soc_uid = fsl_guts_get_soc_uid(soc.data->sfp_compat,
|
||||
soc.data->uid_offset);
|
||||
if (soc_uid)
|
||||
soc_dev_attr->serial_number = kasprintf(GFP_KERNEL, "%016llX",
|
||||
soc_uid);
|
||||
|
|
@ -323,6 +324,8 @@ static int __init fsl_guts_init(void)
|
|||
err_unmap_dcfg_ccsr:
|
||||
iounmap(soc.dcfg_ccsr);
|
||||
soc.dcfg_ccsr = NULL;
|
||||
err_clear_soc_data:
|
||||
soc.data = NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user