@@ -431,13 +431,17 @@ static int rcar_thermal_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct resource *res, *irq;
const struct of_device_id *of_id = of_match_device(rcar_thermal_dt_ids, dev);
- unsigned long of_data = (unsigned long)of_id->data;
+ unsigned long of_data;
int mres = 0;
int i;
int ret = -ENODEV;
int idle = IDLE_INTERVAL;
u32 enr_bits = 0;
+ if (!of_id)
+ return ret;
+ of_data = (unsigned long)of_id->data;
+
common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL);
if (!common)
return -ENOMEM;