summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/soc/fsl/guts.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c
index 302e0c8d69d9..4f9655087bd7 100644
--- a/drivers/soc/fsl/guts.c
+++ b/drivers/soc/fsl/guts.c
@@ -32,6 +32,7 @@ struct fsl_soc_die_attr {
32static struct guts *guts; 32static struct guts *guts;
33static struct soc_device_attribute soc_dev_attr; 33static struct soc_device_attribute soc_dev_attr;
34static struct soc_device *soc_dev; 34static struct soc_device *soc_dev;
35static struct device_node *root;
35 36
36 37
37/* SoC die attribute definition for QorIQ platform */ 38/* SoC die attribute definition for QorIQ platform */
@@ -132,7 +133,7 @@ EXPORT_SYMBOL(fsl_guts_get_svr);
132 133
133static int fsl_guts_probe(struct platform_device *pdev) 134static int fsl_guts_probe(struct platform_device *pdev)
134{ 135{
135 struct device_node *root, *np = pdev->dev.of_node; 136 struct device_node *np = pdev->dev.of_node;
136 struct device *dev = &pdev->dev; 137 struct device *dev = &pdev->dev;
137 struct resource *res; 138 struct resource *res;
138 const struct fsl_soc_die_attr *soc_die; 139 const struct fsl_soc_die_attr *soc_die;
@@ -155,9 +156,8 @@ static int fsl_guts_probe(struct platform_device *pdev)
155 root = of_find_node_by_path("/"); 156 root = of_find_node_by_path("/");
156 if (of_property_read_string(root, "model", &machine)) 157 if (of_property_read_string(root, "model", &machine))
157 of_property_read_string_index(root, "compatible", 0, &machine); 158 of_property_read_string_index(root, "compatible", 0, &machine);
158 of_node_put(root);
159 if (machine) 159 if (machine)
160 soc_dev_attr.machine = devm_kstrdup(dev, machine, GFP_KERNEL); 160 soc_dev_attr.machine = machine;
161 161
162 svr = fsl_guts_get_svr(); 162 svr = fsl_guts_get_svr();
163 soc_die = fsl_soc_die_match(svr, fsl_soc_die); 163 soc_die = fsl_soc_die_match(svr, fsl_soc_die);
@@ -192,6 +192,7 @@ static int fsl_guts_probe(struct platform_device *pdev)
192static int fsl_guts_remove(struct platform_device *dev) 192static int fsl_guts_remove(struct platform_device *dev)
193{ 193{
194 soc_device_unregister(soc_dev); 194 soc_device_unregister(soc_dev);
195 of_node_put(root);
195 return 0; 196 return 0;
196} 197}
197 198