Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'driver-core-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core and sysfs fixes from Greg KH:
"Here are three small changes for 6.10-rc4 that resolve reported
problems, and finally drop an unused api call. These are:

- removal of devm_device_add_groups(), all the callers of this are
finally gone after the 6.10-rc1 merge (changes came in through
different trees), so it's safe to remove.

- much reported sysfs build error fixed up for systems that did not
have sysfs enabled

- driver core sync issue fix for a many reported issue over the years
that no one really paid much attention to, until Dirk finally
tracked down the real issue and made the "obviously correct and
simple" fix for it.

All of these have been in linux-next for over a week with no reported
problems"

* tag 'driver-core-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
drivers: core: synchronize really_probe() and dev_uevent()
sysfs: Unbreak the build around sysfs_bin_attr_simple_read()
driver core: remove devm_device_add_groups()

+12 -47
+3 -45
drivers/base/core.c
··· 2739 2739 if (!env) 2740 2740 return -ENOMEM; 2741 2741 2742 + /* Synchronize with really_probe() */ 2743 + device_lock(dev); 2742 2744 /* let the kset specific function add its keys */ 2743 2745 retval = kset->uevent_ops->uevent(&dev->kobj, env); 2746 + device_unlock(dev); 2744 2747 if (retval) 2745 2748 goto out; 2746 2749 ··· 2848 2845 sysfs_remove_group(&dev->kobj, group); 2849 2846 } 2850 2847 2851 - static void devm_attr_groups_remove(struct device *dev, void *res) 2852 - { 2853 - union device_attr_group_devres *devres = res; 2854 - const struct attribute_group **groups = devres->groups; 2855 - 2856 - dev_dbg(dev, "%s: removing groups %p\n", __func__, groups); 2857 - sysfs_remove_groups(&dev->kobj, groups); 2858 - } 2859 - 2860 2848 /** 2861 2849 * devm_device_add_group - given a device, create a managed attribute group 2862 2850 * @dev: The device to create the group for ··· 2879 2885 return 0; 2880 2886 } 2881 2887 EXPORT_SYMBOL_GPL(devm_device_add_group); 2882 - 2883 - /** 2884 - * devm_device_add_groups - create a bunch of managed attribute groups 2885 - * @dev: The device to create the group for 2886 - * @groups: The attribute groups to create, NULL terminated 2887 - * 2888 - * This function creates a bunch of managed attribute groups. If an error 2889 - * occurs when creating a group, all previously created groups will be 2890 - * removed, unwinding everything back to the original state when this 2891 - * function was called. It will explicitly warn and error if any of the 2892 - * attribute files being created already exist. 2893 - * 2894 - * Returns 0 on success or error code from sysfs_create_group on failure. 2895 - */ 2896 - int devm_device_add_groups(struct device *dev, 2897 - const struct attribute_group **groups) 2898 - { 2899 - union device_attr_group_devres *devres; 2900 - int error; 2901 - 2902 - devres = devres_alloc(devm_attr_groups_remove, 2903 - sizeof(*devres), GFP_KERNEL); 2904 - if (!devres) 2905 - return -ENOMEM; 2906 - 2907 - error = sysfs_create_groups(&dev->kobj, groups); 2908 - if (error) { 2909 - devres_free(devres); 2910 - return error; 2911 - } 2912 - 2913 - devres->groups = groups; 2914 - devres_add(dev, devres); 2915 - return 0; 2916 - } 2917 - EXPORT_SYMBOL_GPL(devm_device_add_groups); 2918 2888 2919 2889 static int device_add_attrs(struct device *dev) 2920 2890 {
-2
include/linux/device.h
··· 1220 1220 return device_remove_groups(dev, groups); 1221 1221 } 1222 1222 1223 - int __must_check devm_device_add_groups(struct device *dev, 1224 - const struct attribute_group **groups); 1225 1223 int __must_check devm_device_add_group(struct device *dev, 1226 1224 const struct attribute_group *grp); 1227 1225
+9
include/linux/sysfs.h
··· 750 750 { 751 751 return 0; 752 752 } 753 + 754 + static inline ssize_t sysfs_bin_attr_simple_read(struct file *file, 755 + struct kobject *kobj, 756 + struct bin_attribute *attr, 757 + char *buf, loff_t off, 758 + size_t count) 759 + { 760 + return 0; 761 + } 753 762 #endif /* CONFIG_SYSFS */ 754 763 755 764 static inline int __must_check sysfs_create_file(struct kobject *kobj,