--- zzzz-none-000/linux-4.4.60/drivers/base/core.c 2017-04-08 07:53:53.000000000 +0000 +++ hawkeye-5590-729/linux-4.4.60/drivers/base/core.c 2022-03-30 14:21:52.000000000 +0000 @@ -871,12 +871,14 @@ struct device_node *of_node = dev_of_node(dev); int error; +#if !IS_ENABLED(CONFIG_AVM_THIN_SYSFS) if (of_node) { error = sysfs_create_link(&dev->kobj, &of_node->kobj,"of_node"); if (error) dev_warn(dev, "Error %d creating of_node link\n",error); /* An error here doesn't warrant bringing down the device */ } +#endif if (!dev->class) return 0; @@ -920,8 +922,10 @@ static void device_remove_class_symlinks(struct device *dev) { +#if !IS_ENABLED(AVM_THIN_SYSFS) if (dev_of_node(dev)) sysfs_remove_link(&dev->kobj, "of_node"); +#endif if (!dev->class) return; @@ -2308,3 +2312,9 @@ else dev->fwnode = fwnode; } + +int device_match_of_node(struct device *dev, const void *np) +{ + return dev->of_node == np; +} +EXPORT_SYMBOL_GPL(device_match_of_node);