All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Bordug <vbordug@ru.mvista.com>
To: Greg KH <gregkh@suse.de>
Cc: lkml <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@osdl.org>
Subject: drivers/base: device_bind_driver() fix
Date: Wed, 24 Jan 2007 17:14:41 +0300	[thread overview]
Message-ID: <20070124171441.6a07d06b@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 1405 bytes --]


Keeps sysfs from creating link if device is already bound to driver.
Similar behavior was before the rework; now without this patch fixed
PHY will complain about not been able to create file in sysfs.

Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
---

 drivers/base/dd.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 510e788..6da3d01 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -26,12 +26,12 @@
 #define to_drv(node) container_of(node, struct device_driver, kobj.entry)
 
 
-static void driver_bound(struct device *dev)
+static int driver_bound(struct device *dev)
 {
 	if (klist_node_attached(&dev->knode_driver)) {
 		printk(KERN_WARNING "%s: device %s already bound\n",
 			__FUNCTION__, kobject_name(&dev->kobj));
-		return;
+		return 0;
 	}
 
 	pr_debug("bound device '%s' to driver '%s'\n",
@@ -42,6 +42,7 @@ static void driver_bound(struct device *dev)
 					     BUS_NOTIFY_BOUND_DRIVER, dev);
 
 	klist_add_tail(&dev->knode_driver, &dev->driver->klist_devices);
+	return 1;
 }
 
 static int driver_sysfs_add(struct device *dev)
@@ -86,7 +87,8 @@ static void driver_sysfs_remove(struct device *dev)
  */
 int device_bind_driver(struct device *dev)
 {
-	driver_bound(dev);
+	if (!driver_bound(dev))
+		return 0;
 	return driver_sysfs_add(dev);
 }
 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2007-01-24 14:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-24 14:14 Vitaly Bordug [this message]
2007-01-24 23:42 ` drivers/base: device_bind_driver() fix 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=20070124171441.6a07d06b@localhost.localdomain \
    --to=vbordug@ru.mvista.com \
    --cc=akpm@osdl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.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.