--- zzzz-none-000/linux-4.4.271/drivers/base/core.c 2021-06-03 06:22:09.000000000 +0000 +++ dakota-7530ac-750/linux-4.4.271/drivers/base/core.c 2023-01-11 09:25:41.000000000 +0000 @@ -925,12 +925,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; @@ -974,8 +976,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; @@ -2384,3 +2388,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);