@@ -102,6 +102,18 @@ static const struct da8xx_ddrctl_setting *da8xx_ddrctl_get_board_settings(void)
return NULL;
}
+static const char* da8xx_ddrctl_get_machine_name(void)
+{
+ const char *str;
+ int ret;
+
+ ret = of_property_read_string(of_root, "model", &str);
+ if (ret)
+ ret = of_property_read_string(of_root, "compatible", &str);
+
+ return str;
+}
+
static int da8xx_ddrctl_probe(struct platform_device *pdev)
{
const struct da8xx_ddrctl_config_knob *knob;
@@ -118,7 +130,7 @@ static int da8xx_ddrctl_probe(struct platform_device *pdev)
setting = da8xx_ddrctl_get_board_settings();
if (!setting) {
dev_err(dev, "no settings for board '%s'\n",
- of_flat_dt_get_machine_name());
+ da8xx_ddrctl_get_machine_name());
return -EINVAL;
}
---8<---