Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f793067e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 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
parents f988dac7 80422738
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -226,5 +226,5 @@ struct driver_attribute driver_attr_debug;
This can then be used to add and remove the attribute from the
This can then be used to add and remove the attribute from the
driver's directory using:
driver's directory using:


int driver_create_file(struct device_driver *, struct driver_attribute *);
int driver_create_file(struct device_driver *, const struct driver_attribute *);
void driver_remove_file(struct device_driver *, struct driver_attribute *);
void driver_remove_file(struct device_driver *, const struct driver_attribute *);
+6 −6
Original line number Original line Diff line number Diff line
@@ -91,8 +91,8 @@ struct device_attribute {
			 const char *buf, size_t count);
			 const char *buf, size_t count);
};
};


int device_create_file(struct device *, struct device_attribute *);
int device_create_file(struct device *, const struct device_attribute *);
void device_remove_file(struct device *, struct device_attribute *);
void device_remove_file(struct device *, const struct device_attribute *);


It also defines this helper for defining device attributes: 
It also defines this helper for defining device attributes: 


@@ -316,8 +316,8 @@ DEVICE_ATTR(_name, _mode, _show, _store);


Creation/Removal:
Creation/Removal:


int device_create_file(struct device *device, struct device_attribute * attr);
int device_create_file(struct device *dev, const struct device_attribute * attr);
void device_remove_file(struct device * dev, struct device_attribute * attr);
void device_remove_file(struct device *dev, const struct device_attribute * attr);




- bus drivers (include/linux/device.h)
- bus drivers (include/linux/device.h)
@@ -358,7 +358,7 @@ DRIVER_ATTR(_name, _mode, _show, _store)


Creation/Removal:
Creation/Removal:


int driver_create_file(struct device_driver *, struct driver_attribute *);
int driver_create_file(struct device_driver *, const struct driver_attribute *);
void driver_remove_file(struct device_driver *, struct driver_attribute *);
void driver_remove_file(struct device_driver *, const struct driver_attribute *);


+22 −2
Original line number Original line Diff line number Diff line
@@ -26,13 +26,33 @@ Procedure for submitting patches to the -stable tree:


 - Send the patch, after verifying that it follows the above rules, to
 - Send the patch, after verifying that it follows the above rules, to
   stable@kernel.org.
   stable@kernel.org.
 - To have the patch automatically included in the stable tree, add the
   the tag
     Cc: stable@kernel.org
   in the sign-off area. Once the patch is merged it will be applied to
   the stable tree without anything else needing to be done by the author
   or subsystem maintainer.
 - If the patch requires other patches as prerequisites which can be
   cherry-picked than this can be specified in the following format in
   the sign-off area:

     Cc: <stable@kernel.org> # .32.x: a1f84a3: sched: Check for idle
     Cc: <stable@kernel.org> # .32.x: 1b9508f: sched: Rate-limit newidle
     Cc: <stable@kernel.org> # .32.x: fd21073: sched: Fix affinity logic
     Cc: <stable@kernel.org> # .32.x
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

   The tag sequence has the meaning of:
     git cherry-pick a1f84a3
     git cherry-pick 1b9508f
     git cherry-pick fd21073
     git cherry-pick <this commit>

 - The sender will receive an ACK when the patch has been accepted into the
 - The sender will receive an ACK when the patch has been accepted into the
   queue, or a NAK if the patch is rejected.  This response might take a few
   queue, or a NAK if the patch is rejected.  This response might take a few
   days, according to the developer's schedules.
   days, according to the developer's schedules.
 - If accepted, the patch will be added to the -stable queue, for review by
 - If accepted, the patch will be added to the -stable queue, for review by
   other developers and by the relevant subsystem maintainer.
   other developers and by the relevant subsystem maintainer.
 - If the stable@kernel.org address is added to a patch, when it goes into
   Linus's tree it will automatically be emailed to the stable team.
 - Security patches should not be sent to this alias, but instead to the
 - Security patches should not be sent to this alias, but instead to the
   documented security@kernel.org address.
   documented security@kernel.org address.


+1 −1
Original line number Original line Diff line number Diff line
@@ -703,9 +703,9 @@ int bus_add_driver(struct device_driver *drv)
	return 0;
	return 0;


out_unregister:
out_unregister:
	kobject_put(&priv->kobj);
	kfree(drv->p);
	kfree(drv->p);
	drv->p = NULL;
	drv->p = NULL;
	kobject_put(&priv->kobj);
out_put_bus:
out_put_bus:
	bus_put(bus);
	bus_put(bus);
	return error;
	return error;
+11 −5
Original line number Original line Diff line number Diff line
@@ -446,7 +446,8 @@ struct kset *devices_kset;
 * @dev: device.
 * @dev: device.
 * @attr: device attribute descriptor.
 * @attr: device attribute descriptor.
 */
 */
int device_create_file(struct device *dev, struct device_attribute *attr)
int device_create_file(struct device *dev,
		       const struct device_attribute *attr)
{
{
	int error = 0;
	int error = 0;
	if (dev)
	if (dev)
@@ -459,7 +460,8 @@ int device_create_file(struct device *dev, struct device_attribute *attr)
 * @dev: device.
 * @dev: device.
 * @attr: device attribute descriptor.
 * @attr: device attribute descriptor.
 */
 */
void device_remove_file(struct device *dev, struct device_attribute *attr)
void device_remove_file(struct device *dev,
			const struct device_attribute *attr)
{
{
	if (dev)
	if (dev)
		sysfs_remove_file(&dev->kobj, &attr->attr);
		sysfs_remove_file(&dev->kobj, &attr->attr);
@@ -470,7 +472,8 @@ void device_remove_file(struct device *dev, struct device_attribute *attr)
 * @dev: device.
 * @dev: device.
 * @attr: device binary attribute descriptor.
 * @attr: device binary attribute descriptor.
 */
 */
int device_create_bin_file(struct device *dev, struct bin_attribute *attr)
int device_create_bin_file(struct device *dev,
			   const struct bin_attribute *attr)
{
{
	int error = -EINVAL;
	int error = -EINVAL;
	if (dev)
	if (dev)
@@ -484,7 +487,8 @@ EXPORT_SYMBOL_GPL(device_create_bin_file);
 * @dev: device.
 * @dev: device.
 * @attr: device binary attribute descriptor.
 * @attr: device binary attribute descriptor.
 */
 */
void device_remove_bin_file(struct device *dev, struct bin_attribute *attr)
void device_remove_bin_file(struct device *dev,
			    const struct bin_attribute *attr)
{
{
	if (dev)
	if (dev)
		sysfs_remove_bin_file(&dev->kobj, attr);
		sysfs_remove_bin_file(&dev->kobj, attr);
@@ -905,8 +909,10 @@ int device_add(struct device *dev)
		dev->init_name = NULL;
		dev->init_name = NULL;
	}
	}


	if (!dev_name(dev))
	if (!dev_name(dev)) {
		error = -EINVAL;
		goto name_error;
		goto name_error;
	}


	pr_debug("device: '%s': %s\n", dev_name(dev), __func__);
	pr_debug("device: '%s': %s\n", dev_name(dev), __func__);


Loading