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 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
devtmpfs: unlock mutex in case of string allocation error
Driver core: export platform_device_register_data as a GPL symbol
driver core: Prevent reference to freed memory on error path
Driver-core: Fix bogus 0 error return in device_add()
Driver core: driver_attribute parameters can often be const*
Driver core: bin_attribute parameters can often be const*
Driver core: device_attribute parameters can often be const*
Doc/stable rules: add new cherry-pick logic
vfs: get_sb_single() - do not pass options twice
devtmpfs: Convert dirlock to a mutex

+72 -40
+2 -2
Documentation/driver-model/driver.txt
··· 226 226 This can then be used to add and remove the attribute from the 227 227 driver's directory using: 228 228 229 - int driver_create_file(struct device_driver *, struct driver_attribute *); 230 - void driver_remove_file(struct device_driver *, struct driver_attribute *); 229 + int driver_create_file(struct device_driver *, const struct driver_attribute *); 230 + void driver_remove_file(struct device_driver *, const struct driver_attribute *);
+6 -6
Documentation/filesystems/sysfs.txt
··· 91 91 const char *buf, size_t count); 92 92 }; 93 93 94 - int device_create_file(struct device *, struct device_attribute *); 95 - void device_remove_file(struct device *, struct device_attribute *); 94 + int device_create_file(struct device *, const struct device_attribute *); 95 + void device_remove_file(struct device *, const struct device_attribute *); 96 96 97 97 It also defines this helper for defining device attributes: 98 98 ··· 316 316 317 317 Creation/Removal: 318 318 319 - int device_create_file(struct device *device, struct device_attribute * attr); 320 - void device_remove_file(struct device * dev, struct device_attribute * attr); 319 + int device_create_file(struct device *dev, const struct device_attribute * attr); 320 + void device_remove_file(struct device *dev, const struct device_attribute * attr); 321 321 322 322 323 323 - bus drivers (include/linux/device.h) ··· 358 358 359 359 Creation/Removal: 360 360 361 - int driver_create_file(struct device_driver *, struct driver_attribute *); 362 - void driver_remove_file(struct device_driver *, struct driver_attribute *); 361 + int driver_create_file(struct device_driver *, const struct driver_attribute *); 362 + void driver_remove_file(struct device_driver *, const struct driver_attribute *); 363 363 364 364
+22 -2
Documentation/stable_kernel_rules.txt
··· 26 26 27 27 - Send the patch, after verifying that it follows the above rules, to 28 28 stable@kernel.org. 29 + - To have the patch automatically included in the stable tree, add the 30 + the tag 31 + Cc: stable@kernel.org 32 + in the sign-off area. Once the patch is merged it will be applied to 33 + the stable tree without anything else needing to be done by the author 34 + or subsystem maintainer. 35 + - If the patch requires other patches as prerequisites which can be 36 + cherry-picked than this can be specified in the following format in 37 + the sign-off area: 38 + 39 + Cc: <stable@kernel.org> # .32.x: a1f84a3: sched: Check for idle 40 + Cc: <stable@kernel.org> # .32.x: 1b9508f: sched: Rate-limit newidle 41 + Cc: <stable@kernel.org> # .32.x: fd21073: sched: Fix affinity logic 42 + Cc: <stable@kernel.org> # .32.x 43 + Signed-off-by: Ingo Molnar <mingo@elte.hu> 44 + 45 + The tag sequence has the meaning of: 46 + git cherry-pick a1f84a3 47 + git cherry-pick 1b9508f 48 + git cherry-pick fd21073 49 + git cherry-pick <this commit> 50 + 29 51 - The sender will receive an ACK when the patch has been accepted into the 30 52 queue, or a NAK if the patch is rejected. This response might take a few 31 53 days, according to the developer's schedules. 32 54 - If accepted, the patch will be added to the -stable queue, for review by 33 55 other developers and by the relevant subsystem maintainer. 34 - - If the stable@kernel.org address is added to a patch, when it goes into 35 - Linus's tree it will automatically be emailed to the stable team. 36 56 - Security patches should not be sent to this alias, but instead to the 37 57 documented security@kernel.org address. 38 58
+1 -1
drivers/base/bus.c
··· 703 703 return 0; 704 704 705 705 out_unregister: 706 + kobject_put(&priv->kobj); 706 707 kfree(drv->p); 707 708 drv->p = NULL; 708 - kobject_put(&priv->kobj); 709 709 out_put_bus: 710 710 bus_put(bus); 711 711 return error;
+11 -5
drivers/base/core.c
··· 446 446 * @dev: device. 447 447 * @attr: device attribute descriptor. 448 448 */ 449 - int device_create_file(struct device *dev, struct device_attribute *attr) 449 + int device_create_file(struct device *dev, 450 + const struct device_attribute *attr) 450 451 { 451 452 int error = 0; 452 453 if (dev) ··· 460 459 * @dev: device. 461 460 * @attr: device attribute descriptor. 462 461 */ 463 - void device_remove_file(struct device *dev, struct device_attribute *attr) 462 + void device_remove_file(struct device *dev, 463 + const struct device_attribute *attr) 464 464 { 465 465 if (dev) 466 466 sysfs_remove_file(&dev->kobj, &attr->attr); ··· 472 470 * @dev: device. 473 471 * @attr: device binary attribute descriptor. 474 472 */ 475 - int device_create_bin_file(struct device *dev, struct bin_attribute *attr) 473 + int device_create_bin_file(struct device *dev, 474 + const struct bin_attribute *attr) 476 475 { 477 476 int error = -EINVAL; 478 477 if (dev) ··· 487 484 * @dev: device. 488 485 * @attr: device binary attribute descriptor. 489 486 */ 490 - void device_remove_bin_file(struct device *dev, struct bin_attribute *attr) 487 + void device_remove_bin_file(struct device *dev, 488 + const struct bin_attribute *attr) 491 489 { 492 490 if (dev) 493 491 sysfs_remove_bin_file(&dev->kobj, attr); ··· 909 905 dev->init_name = NULL; 910 906 } 911 907 912 - if (!dev_name(dev)) 908 + if (!dev_name(dev)) { 909 + error = -EINVAL; 913 910 goto name_error; 911 + } 914 912 915 913 pr_debug("device: '%s': %s\n", dev_name(dev), __func__); 916 914
+10 -9
drivers/base/devtmpfs.c
··· 32 32 static int dev_mount; 33 33 #endif 34 34 35 - static rwlock_t dirlock; 35 + static DEFINE_MUTEX(dirlock); 36 36 37 37 static int __init mount_param(char *str) 38 38 { ··· 93 93 { 94 94 int err; 95 95 96 - read_lock(&dirlock); 96 + mutex_lock(&dirlock); 97 97 err = dev_mkdir(nodepath, 0755); 98 98 if (err == -ENOENT) { 99 99 char *path; ··· 101 101 102 102 /* parent directories do not exist, create them */ 103 103 path = kstrdup(nodepath, GFP_KERNEL); 104 - if (!path) 105 - return -ENOMEM; 104 + if (!path) { 105 + err = -ENOMEM; 106 + goto out; 107 + } 106 108 s = path; 107 109 for (;;) { 108 110 s = strchr(s, '/'); ··· 119 117 } 120 118 kfree(path); 121 119 } 122 - read_unlock(&dirlock); 120 + out: 121 + mutex_unlock(&dirlock); 123 122 return err; 124 123 } 125 124 ··· 232 229 if (!path) 233 230 return -ENOMEM; 234 231 235 - write_lock(&dirlock); 232 + mutex_lock(&dirlock); 236 233 for (;;) { 237 234 char *base; 238 235 ··· 244 241 if (err) 245 242 break; 246 243 } 247 - write_unlock(&dirlock); 244 + mutex_unlock(&dirlock); 248 245 249 246 kfree(path); 250 247 return err; ··· 354 351 { 355 352 int err; 356 353 struct vfsmount *mnt; 357 - 358 - rwlock_init(&dirlock); 359 354 360 355 err = register_filesystem(&dev_fs_type); 361 356 if (err) {
+2 -2
drivers/base/driver.c
··· 98 98 * @attr: driver attribute descriptor. 99 99 */ 100 100 int driver_create_file(struct device_driver *drv, 101 - struct driver_attribute *attr) 101 + const struct driver_attribute *attr) 102 102 { 103 103 int error; 104 104 if (drv) ··· 115 115 * @attr: driver attribute descriptor. 116 116 */ 117 117 void driver_remove_file(struct device_driver *drv, 118 - struct driver_attribute *attr) 118 + const struct driver_attribute *attr) 119 119 { 120 120 if (drv) 121 121 sysfs_remove_file(&drv->p->kobj, &attr->attr);
+1
drivers/base/platform.c
··· 441 441 platform_device_put(pdev); 442 442 return ERR_PTR(retval); 443 443 } 444 + EXPORT_SYMBOL_GPL(platform_device_register_data); 444 445 445 446 static int platform_drv_probe(struct device *_dev) 446 447 {
+2 -1
fs/super.c
··· 901 901 return error; 902 902 } 903 903 s->s_flags |= MS_ACTIVE; 904 + } else { 905 + do_remount_sb(s, flags, data, 0); 904 906 } 905 - do_remount_sb(s, flags, data, 0); 906 907 simple_set_mnt(mnt, s); 907 908 return 0; 908 909 }
+4 -2
fs/sysfs/bin.c
··· 483 483 * @attr: attribute descriptor. 484 484 */ 485 485 486 - int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr) 486 + int sysfs_create_bin_file(struct kobject *kobj, 487 + const struct bin_attribute *attr) 487 488 { 488 489 BUG_ON(!kobj || !kobj->sd || !attr); 489 490 ··· 498 497 * @attr: attribute descriptor. 499 498 */ 500 499 501 - void sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr) 500 + void sysfs_remove_bin_file(struct kobject *kobj, 501 + const struct bin_attribute *attr) 502 502 { 503 503 sysfs_hash_and_remove(kobj->sd, attr->attr.name); 504 504 }
+6 -6
include/linux/device.h
··· 166 166 __ATTR(_name, _mode, _show, _store) 167 167 168 168 extern int __must_check driver_create_file(struct device_driver *driver, 169 - struct driver_attribute *attr); 169 + const struct driver_attribute *attr); 170 170 extern void driver_remove_file(struct device_driver *driver, 171 - struct driver_attribute *attr); 171 + const struct driver_attribute *attr); 172 172 173 173 extern int __must_check driver_add_kobj(struct device_driver *drv, 174 174 struct kobject *kobj, ··· 319 319 struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) 320 320 321 321 extern int __must_check device_create_file(struct device *device, 322 - struct device_attribute *entry); 322 + const struct device_attribute *entry); 323 323 extern void device_remove_file(struct device *dev, 324 - struct device_attribute *attr); 324 + const struct device_attribute *attr); 325 325 extern int __must_check device_create_bin_file(struct device *dev, 326 - struct bin_attribute *attr); 326 + const struct bin_attribute *attr); 327 327 extern void device_remove_bin_file(struct device *dev, 328 - struct bin_attribute *attr); 328 + const struct bin_attribute *attr); 329 329 extern int device_schedule_callback_owner(struct device *dev, 330 330 void (*func)(struct device *dev), struct module *owner); 331 331
+5 -4
include/linux/sysfs.h
··· 99 99 void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); 100 100 101 101 int __must_check sysfs_create_bin_file(struct kobject *kobj, 102 - struct bin_attribute *attr); 103 - void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); 102 + const struct bin_attribute *attr); 103 + void sysfs_remove_bin_file(struct kobject *kobj, 104 + const struct bin_attribute *attr); 104 105 105 106 int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target, 106 107 const char *name); ··· 176 175 } 177 176 178 177 static inline int sysfs_create_bin_file(struct kobject *kobj, 179 - struct bin_attribute *attr) 178 + const struct bin_attribute *attr) 180 179 { 181 180 return 0; 182 181 } 183 182 184 183 static inline void sysfs_remove_bin_file(struct kobject *kobj, 185 - struct bin_attribute *attr) 184 + const struct bin_attribute *attr) 186 185 { 187 186 } 188 187