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

Commit a7538a7f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6:
  Revert "Driver core: let request_module() send a /sys/modules/kmod/-uevent"
  Driver core: fix error by cleanup up symlinks properly
  make kernel/kmod.c:kmod_mk static
  power management: fix struct layout and docs
  power management: no valid states w/o pm_ops
  Driver core: more fallout from class_device changes for pcmcia
  sysfs: move struct sysfs_dirent to private header
  driver core: refcounting fix
  Driver core: remove class_device_rename
parents 92320cec dfff0a06
Loading
Loading
Loading
Loading
+0 −42
Original line number Diff line number Diff line
@@ -840,48 +840,6 @@ void class_device_destroy(struct class *cls, dev_t devt)
		class_device_unregister(class_dev);
}

int class_device_rename(struct class_device *class_dev, char *new_name)
{
	int error = 0;
	char *old_class_name = NULL, *new_class_name = NULL;

	class_dev = class_device_get(class_dev);
	if (!class_dev)
		return -EINVAL;

	pr_debug("CLASS: renaming '%s' to '%s'\n", class_dev->class_id,
		 new_name);

#ifdef CONFIG_SYSFS_DEPRECATED
	if (class_dev->dev)
		old_class_name = make_class_name(class_dev->class->name,
						 &class_dev->kobj);
#endif

	strlcpy(class_dev->class_id, new_name, KOBJ_NAME_LEN);

	error = kobject_rename(&class_dev->kobj, new_name);

#ifdef CONFIG_SYSFS_DEPRECATED
	if (class_dev->dev) {
		new_class_name = make_class_name(class_dev->class->name,
						 &class_dev->kobj);
		if (new_class_name)
			sysfs_create_link(&class_dev->dev->kobj,
					  &class_dev->kobj, new_class_name);
		if (old_class_name)
			sysfs_remove_link(&class_dev->dev->kobj,
						old_class_name);
	}
#endif
	class_device_put(class_dev);

	kfree(old_class_name);
	kfree(new_class_name);

	return error;
}

struct class_device * class_device_get(struct class_device *class_dev)
{
	if (class_dev)
+30 −1
Original line number Diff line number Diff line
@@ -643,6 +643,35 @@ int device_add(struct device *dev)
		device_remove_file(dev, dev->devt_attr);
		kfree(dev->devt_attr);
	}

	if (dev->class) {
		sysfs_remove_link(&dev->kobj, "subsystem");
		/* If this is not a "fake" compatible device, remove the
		 * symlink from the class to the device. */
		if (dev->kobj.parent != &dev->class->subsys.kset.kobj)
			sysfs_remove_link(&dev->class->subsys.kset.kobj,
					  dev->bus_id);
#ifdef CONFIG_SYSFS_DEPRECATED
		if (parent) {
			char *class_name = make_class_name(dev->class->name,
							   &dev->kobj);
			if (class_name)
				sysfs_remove_link(&dev->parent->kobj,
						  class_name);
			kfree(class_name);
			sysfs_remove_link(&dev->kobj, "device");
		}
#endif

		down(&dev->class->sem);
		/* notify any interfaces that the device is now gone */
		list_for_each_entry(class_intf, &dev->class->interfaces, node)
			if (class_intf->remove_dev)
				class_intf->remove_dev(dev, class_intf);
		/* remove the device from the class list */
		list_del_init(&dev->node);
		up(&dev->class->sem);
	}
 ueventattrError:
	device_remove_file(dev, &dev->uevent_attr);
 attrError:
+1 −1
Original line number Diff line number Diff line
@@ -907,7 +907,7 @@ static int __init init_hs(void)

	for (i=0; i<HS_MAX_SOCKETS; i++) {
		unsigned int ret;
		hs_sockets[i].socket.dev.dev = &hd64465_device.dev;		
		hs_sockets[i].socket.dev.parent = &hd64465_device.dev;
		hs_sockets[i].number = i;
		ret = pcmcia_register_socket(&hs_sockets[i].socket);
		if (ret && i)
+1 −1
Original line number Diff line number Diff line
@@ -760,7 +760,7 @@ static int __init init_m32r_pcc(void)
	/* Set up interrupt handler(s) */

	for (i = 0 ; i < pcc_sockets ; i++) {
		socket[i].socket.dev.dev = &pcc_device.dev;
		socket[i].socket.dev.parent = &pcc_device.dev;
		socket[i].socket.ops = &pcc_operations;
		socket[i].socket.resource_ops = &pccard_nonstatic_ops;
		socket[i].socket.owner = THIS_MODULE;
+1 −1
Original line number Diff line number Diff line
@@ -1321,7 +1321,7 @@ static int __init m8xx_init(void)
		socket[i].socket.ops = &m8xx_services;
		socket[i].socket.resource_ops = &pccard_iodyn_ops;
		socket[i].socket.cb_dev = NULL;
		socket[i].socket.dev.dev = &m8xx_device.dev;
		socket[i].socket.dev.parent = &m8xx_device.dev;
	}

	for (i = 0; i < PCMCIA_SOCKETS_NO; i++)
Loading