OSDN Git Service

hwmon: (core) add thermal sensors only if dev->of_node is present
[tomoyo/tomoyo-test1.git] / drivers / hwmon / hwmon.c
index e694c46..429784e 100644 (file)
@@ -636,7 +636,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
        if (err)
                goto free_hwmon;
 
-       if (dev && chip && chip->ops->read &&
+       if (dev && dev->of_node && chip && chip->ops->read &&
            chip->info[0]->type == hwmon_chip &&
            (chip->info[0]->config[0] & HWMON_C_REGISTER_TZ)) {
                const struct hwmon_channel_info **info = chip->info;