const struct imx8_soc_data *data;
struct imx8_soc_drvdata *drvdata;
struct device *dev = &pdev->dev;
- const struct of_device_id *id;
struct soc_device *soc_dev;
u32 soc_rev = 0;
u64 soc_uid[2] = {0, 0};
soc_dev_attr->family = "Freescale i.MX";
- ret = of_property_read_string(of_root, "model", &soc_dev_attr->machine);
+ ret = soc_attr_read_machine(soc_dev_attr);
if (ret)
return ret;
- id = of_match_node(imx8_soc_match, of_root);
- if (!id)
- return -ENODEV;
-
- data = id->data;
+ data = device_get_match_data(dev);
if (data) {
soc_dev_attr->soc_id = data->name;
ret = imx8m_soc_prepare(pdev, data->ocotp_compatible);
int ret;
/* No match means this is non-i.MX8M hardware, do nothing. */
- if (!of_match_node(imx8_soc_match, of_root))
+ if (!of_machine_device_match(imx8_soc_match))
return 0;
ret = platform_driver_register(&imx8m_soc_driver);