All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Greg KH <greg@kroah.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Patrick Mochel <mochel@digitalimplant.org>
Subject: [PATCH 1/4] Driver core: add driver symlink to device
Date: Sat, 30 Oct 2004 03:27:22 -0500	[thread overview]
Message-ID: <200410300327.24589.dtor_core@ameritech.net> (raw)
In-Reply-To: <200410300326.23345.dtor_core@ameritech.net>


===================================================================


ChangeSet@1.1955, 2004-10-30 01:08:14-05:00, dtor_core@ameritech.net
  Driver core: when binding device to a driver create "driver"
               symlink in device's directory. Rename serio's
               "driver" attribute to "drvctl" (write-only)
  
  Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


 base/bus.c          |    2 ++
 input/serio/serio.c |    7 +------
 2 files changed, 3 insertions(+), 6 deletions(-)


===================================================================



diff -Nru a/drivers/base/bus.c b/drivers/base/bus.c
--- a/drivers/base/bus.c	2004-10-30 03:14:25 -05:00
+++ b/drivers/base/bus.c	2004-10-30 03:14:25 -05:00
@@ -246,6 +246,7 @@
 	list_add_tail(&dev->driver_list, &dev->driver->devices);
 	sysfs_create_link(&dev->driver->kobj, &dev->kobj,
 			  kobject_name(&dev->kobj));
+	sysfs_create_link(&dev->kobj, &dev->driver->kobj, "driver");
 }
 
 
@@ -370,6 +371,7 @@
 	struct device_driver * drv = dev->driver;
 	if (drv) {
 		sysfs_remove_link(&drv->kobj, kobject_name(&dev->kobj));
+		sysfs_remove_link(&dev->kobj, "driver");
 		list_del_init(&dev->driver_list);
 		device_detach_shutdown(dev);
 		if (drv->remove)
diff -Nru a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
--- a/drivers/input/serio/serio.c	2004-10-30 03:14:25 -05:00
+++ b/drivers/input/serio/serio.c	2004-10-30 03:14:25 -05:00
@@ -246,11 +246,6 @@
 	return sprintf(buf, "%s\n", serio->name);
 }
 
-static ssize_t serio_show_driver(struct device *dev, char *buf)
-{
-	return sprintf(buf, "%s\n", dev->driver ? dev->driver->name : "(none)");
-}
-
 static ssize_t serio_rebind_driver(struct device *dev, const char *buf, size_t count)
 {
 	struct serio *serio = to_serio_port(dev);
@@ -307,7 +302,7 @@
 
 static struct device_attribute serio_device_attrs[] = {
 	__ATTR(description, S_IRUGO, serio_show_description, NULL),
-	__ATTR(driver, S_IWUSR | S_IRUGO, serio_show_driver, serio_rebind_driver),
+	__ATTR(drvctl, S_IWUSR, NULL, serio_rebind_driver),
 	__ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode),
 	__ATTR_NULL
 };

  reply	other threads:[~2004-10-30  8:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-29 18:57 [PATCH 2/4] Driver core: add driver_probe_device Dmitry Torokhov
2004-10-29 20:22 ` Greg KH
2004-10-30  8:26   ` Dmitry Torokhov
2004-10-30  8:27     ` Dmitry Torokhov [this message]
2004-10-30  8:28       ` [PATCH 2/4] Driver core: add drvctl device attribute Dmitry Torokhov
2004-10-30  8:28         ` [PATCH 3/4] Driver core: add bind_mode device/driver attributes Dmitry Torokhov
2004-10-30  8:29           ` [PATCH 4/4] Driver core: bus_rescan_devices improper locking Dmitry Torokhov
2004-11-01 22:43       ` [PATCH 1/4] Driver core: add driver symlink to device Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200410300327.24589.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@digitalimplant.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.