All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: gregkh@suse.de
Subject: [PATCH] driver core: change bus_rescan_devices to return void
Date: Wed, 29 Jun 2005 23:04:22 -0700	[thread overview]
Message-ID: <1120111462947@kroah.com> (raw)
In-Reply-To: <11201114613610@kroah.com>

[PATCH] driver core: change bus_rescan_devices to return void

No one was looking at the return value of bus_rescan_devices, and it
really wasn't anything that anyone in the kernel would ever care about.
So change it which enabled some counting code to be removed also.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 23d3d602cb96addd3c1158424fb01a49ea5e81b1
tree 2daa85579c964bfe3d1a91fe365d202b8f38422b
parent afdce75f1eaebcf358b7594ba7969aade105c3b0
author Greg Kroah-Hartman <gregkh@suse.de> Wed, 22 Jun 2005 16:09:05 -0700
committer Greg Kroah-Hartman <gregkh@suse.de> Wed, 29 Jun 2005 22:48:04 -0700

 drivers/base/bus.c     |   27 +++++++++------------------
 include/linux/device.h |    2 +-
 2 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -483,31 +483,22 @@ void bus_remove_driver(struct device_dri
 /* Helper for bus_rescan_devices's iter */
 static int bus_rescan_devices_helper(struct device *dev, void *data)
 {
-	int *count = data;
-
-	if (!dev->driver && (device_attach(dev) > 0))
-		(*count)++;
-
+	if (!dev->driver)
+		device_attach(dev);
 	return 0;
 }
 
-
 /**
- *	bus_rescan_devices - rescan devices on the bus for possible drivers
- *	@bus:	the bus to scan.
+ * bus_rescan_devices - rescan devices on the bus for possible drivers
+ * @bus: the bus to scan.
  *
- *	This function will look for devices on the bus with no driver
- *	attached and rescan it against existing drivers to see if it
- *	matches any. Calls device_attach(). Returns the number of devices
- *	that were sucessfully bound to a driver.
+ * This function will look for devices on the bus with no driver
+ * attached and rescan it against existing drivers to see if it matches
+ * any by calling device_attach() for the unbound devices.
  */
-int bus_rescan_devices(struct bus_type * bus)
+void bus_rescan_devices(struct bus_type * bus)
 {
-	int count = 0;
-
-	bus_for_each_dev(bus, NULL, &count, bus_rescan_devices_helper);
-
-	return count;
+	bus_for_each_dev(bus, NULL, NULL, bus_rescan_devices_helper);
 }
 
 
diff --git a/include/linux/device.h b/include/linux/device.h
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -69,7 +69,7 @@ struct bus_type {
 extern int bus_register(struct bus_type * bus);
 extern void bus_unregister(struct bus_type * bus);
 
-extern int bus_rescan_devices(struct bus_type * bus);
+extern void bus_rescan_devices(struct bus_type * bus);
 
 extern struct bus_type * get_bus(struct bus_type * bus);
 extern void put_bus(struct bus_type * bus);


  reply	other threads:[~2005-06-30  6:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-30  6:02 [GIT PATCH] Driver core patches for 2.6.13-rc1 Greg KH
2005-06-30  6:04 ` [PATCH] driver core: add bus_find_device & driver_find_device functions Greg KH
2005-06-30  6:04   ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
2005-06-30  6:04     ` Greg KH [this message]
2005-06-30  6:04       ` [PATCH] driver core: Add the ability to bind " Greg KH
2005-06-30  6:04         ` [PATCH] Driver core: Use klist_del() instead of klist_remove() Greg KH
2005-06-30  6:25     ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Dmitry Torokhov
2005-06-30  6:29       ` Greg KH
2005-06-30  6:19 ` [GIT PATCH] Driver core patches for 2.6.13-rc1 Dmitry Torokhov
2005-06-30  6:27   ` Greg KH
2005-06-30 17:22 ` John Lenz
2005-06-30 19:45   ` Greg KH
2005-06-30 21:18     ` [PATCH] add class_interface pointer to add and remove functions John Lenz
2005-07-03 20:59       ` Greg KH
2005-07-06  2:35         ` John Lenz
2005-07-06  7:17           ` 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=1120111462947@kroah.com \
    --to=gregkh@suse.de \
    --cc=greg@kroah.com \
    --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.