linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PATCH] More Driver Core patches for 2.6.15
@ 2006-01-13 19:46 Greg KH
  2006-01-13 19:50 ` [PATCH] Add bus_type probe, remove, shutdown methods Greg KH
  0 siblings, 1 reply; 48+ messages in thread
From: Greg KH @ 2006-01-13 19:46 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel

Here are some more driver core patches for 2.6.15.  They have all been
in the last -mm with no problems.  They contain the following
things:
	- input MODALIAS addition (it was accentially dropped from the
	  last patch series).
	- suspend bugfix
	- Russell's bus and driver callback rework (touches a lot of
	  different files.)
	- comment typo fixed.

Please pull from:
	rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
or if master.kernel.org hasn't synced up yet:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/

The full patch set will be sent to the linux-kernel mailing list, if
anyone wants to see them.

thanks,

greg k-h

 arch/arm/common/locomo.c            |    4 +-
 arch/arm/common/sa1111.c            |    4 +-
 arch/arm/kernel/ecard.c             |   14 +++++----
 arch/arm/mach-integrator/lm.c       |   36 +++++++++++------------
 arch/ia64/sn/kernel/tiocx.c         |   16 +++++-----
 arch/parisc/kernel/drivers.c        |    4 +-
 arch/powerpc/kernel/of_device.c     |    4 +-
 arch/powerpc/kernel/vio.c           |    8 ++---
 arch/ppc/syslib/ocp.c               |    4 +-
 arch/sh/kernel/cpu/bus.c            |   34 +++++++++++-----------
 drivers/base/dd.c                   |   12 ++++++-
 drivers/base/driver.c               |    5 +++
 drivers/base/platform.c             |    2 -
 drivers/base/power/shutdown.c       |    9 +++--
 drivers/dio/dio-driver.c            |    4 +-
 drivers/i2c/i2c-core.c              |   20 +++++--------
 drivers/ide/ide-cd.c                |   14 +++------
 drivers/ide/ide-disk.c              |   22 +++++---------
 drivers/ide/ide-floppy.c            |   14 +++------
 drivers/ide/ide-tape.c              |   18 ++++-------
 drivers/ide/ide.c                   |   31 ++++++++++++++++++++
 drivers/input/gameport/gameport.c   |   12 ++++---
 drivers/input/input.c               |   55 ++++++++++++++++++++++++------------
 drivers/input/serio/serio.c         |   12 ++++---
 drivers/macintosh/macio_asic.c      |    6 +--
 drivers/media/dvb/bt8xx/dvb-bt8xx.c |   23 +++++++--------
 drivers/media/video/bttv-gpio.c     |   24 ++++++++++++++-
 drivers/media/video/bttv.h          |    2 +
 drivers/mfd/mcp-core.c              |    4 +-
 drivers/mmc/mmc_sysfs.c             |   26 +++++++----------
 drivers/pci/pci-driver.c            |    4 +-
 drivers/pcmcia/ds.c                 |    4 +-
 drivers/pnp/driver.c                |    4 +-
 drivers/rapidio/rio-driver.c        |    6 +--
 drivers/s390/cio/ccwgroup.c         |   16 +++++-----
 drivers/s390/cio/css.c              |   36 ++++++++++++++++++++++-
 drivers/s390/cio/css.h              |    4 ++
 drivers/s390/cio/device.c           |   50 +++++++++++++++-----------------
 drivers/scsi/scsi_debug.c           |    4 +-
 drivers/sh/superhyway/superhyway.c  |    4 +-
 drivers/usb/gadget/ether.c          |    3 -
 drivers/usb/gadget/inode.c          |    3 -
 drivers/usb/gadget/serial.c         |    3 -
 drivers/usb/gadget/zero.c           |    3 -
 drivers/usb/serial/bus.c            |   15 ++++-----
 drivers/zorro/zorro-driver.c        |    4 +-
 include/linux/device.h              |    3 +
 include/linux/ide.h                 |    5 +++
 48 files changed, 358 insertions(+), 256 deletions(-)


Cornelia Huck:
      Add {css,ccw}_bus_type probe, remove, shutdown methods.

Jean Delvare:
      platform-device-del typo fix

Kay Sievers:
      INPUT: add MODALIAS to the event environment

Michael Richardson:
      device_shutdown can loop if the driver frees itself

Russell King:
      Add bus_type probe, remove, shutdown methods.
      Add pci_bus_type probe and remove methods
      Add SA1111 bus_type probe/remove methods
      Add locomo bus_type probe/remove methods
      Add logic module bus_type probe/remove methods
      Add tiocx bus_type probe/remove methods
      Add ecard_bus_type probe/remove/shutdown methods
      Add of_platform_bus_type probe and remove methods
      Add ocp_bus_type probe and remove methods
      Add parisc_bus_type probe and remove methods
      Add sh_bus_type probe and remove methods
      Add gameport bus_type probe and remove methods
      Add vio_bus_type probe and remove methods
      Add serio bus_type probe and remove methods
      Add dio_bus_type probe and remove methods
      Add i2c_bus_type probe and remove methods
      Add pcmcia_bus_type probe and remove methods
      Add MCP bus_type probe and remove methods
      Add macio_bus_type probe and remove methods
      Add mmc_bus_type probe and remove methods
      Add pnp_bus_type probe and remove methods
      Add usb_serial_bus_type probe and remove methods
      Add ccwgroup_bus_type probe and remove methods
      Add superhyway_bus_type probe and remove methods
      Add ide_bus_type probe and remove methods
      Add zorro_bus_type probe and remove methods
      Add Pseudo LLD bus_type probe and remove methods
      Add rio_bus_type probe and remove methods
      Add bttv sub bus_type probe and remove methods
      Remove usb gadget generic driver methods


^ permalink raw reply	[flat|nested] 48+ messages in thread
* [CFT 1/29] Add bus_type probe, remove, shutdown methods.
@ 2006-01-05 14:29 Russell King
  2006-01-06 11:48 ` Russell King
  0 siblings, 1 reply; 48+ messages in thread
From: Russell King @ 2006-01-05 14:29 UTC (permalink / raw)
  To: LKML; +Cc: Greg K-H

Add bus_type probe, remove and shutdown methods to replace the
corresponding methods in struct device_driver.  This matches
the way we handle the suspend/resume methods.

Since the bus methods override the device_driver methods, warn
if a device driver is registered whose methods will not be
called.

The long-term idea is to remove the device_driver methods entirely.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

---
 drivers/base/driver.c         |    5 +++++
 drivers/base/dd.c             |   12 ++++++++++--
 drivers/base/power/shutdown.c |    5 ++++-
 include/linux/device.h        |    3 +++
 4 files changed, 22 insertions(+), 3 deletions(-)

diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x '*.orig' -x '*.rej' -x .git -r linus/drivers/base/dd.c linux/drivers/base/dd.c
--- linus/drivers/base/dd.c	Fri Sep 23 07:03:13 2005
+++ linux/drivers/base/dd.c	Sun Nov 13 14:02:19 2005
@@ -77,7 +77,13 @@ int driver_probe_device(struct device_dr
 	pr_debug("%s: Matched Device %s with Driver %s\n",
 		 drv->bus->name, dev->bus_id, drv->name);
 	dev->driver = drv;
-	if (drv->probe) {
+	if (dev->bus->probe) {
+		ret = dev->bus->probe(dev);
+		if (ret) {
+			dev->driver = NULL;
+			goto ProbeFailed;
+		}
+	} else if (drv->probe) {
 		ret = drv->probe(dev);
 		if (ret) {
 			dev->driver = NULL;
@@ -194,7 +200,9 @@ static void __device_release_driver(stru
 		sysfs_remove_link(&dev->kobj, "driver");
 		klist_remove(&dev->knode_driver);
 
-		if (drv->remove)
+		if (dev->bus->remove)
+			dev->bus->remove(dev);
+		else if (drv->remove)
 			drv->remove(dev);
 		dev->driver = NULL;
 		put_driver(drv);
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -171,6 +171,11 @@ static void klist_devices_put(struct kli
  */
 int driver_register(struct device_driver * drv)
 {
+	if ((drv->bus->probe && drv->probe) ||
+	    (drv->bus->remove && drv->remove) ||
+	    (drv->bus->shutdown && drv->shutdown)) {
+		printk(KERN_WARNING "Driver '%s' needs updating - please use bus_type methods\n", drv->name);
+	}
 	klist_init(&drv->klist_devices, klist_devices_get, klist_devices_put);
 	init_completion(&drv->unloaded);
 	return bus_add_driver(drv);
diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x '*.orig' -x '*.rej' -x .git -r linus/drivers/base/power/shutdown.c linux/drivers/base/power/shutdown.c
--- linus/drivers/base/power/shutdown.c	Sun Nov  6 22:15:23 2005
+++ linux/drivers/base/power/shutdown.c	Sun Nov 13 14:03:05 2005
@@ -40,7 +40,10 @@ void device_shutdown(void)
 	down_write(&devices_subsys.rwsem);
 	list_for_each_entry_reverse(dev, &devices_subsys.kset.list,
 				kobj.entry) {
-		if (dev->driver && dev->driver->shutdown) {
+		if (dev->bus && dev->bus->shutdown) {
+			dev_dbg(dev, "shutdown\n");
+			dev->bus->shutdown(dev);
+		} else if (dev->driver && dev->driver->shutdown) {
 			dev_dbg(dev, "shutdown\n");
 			dev->driver->shutdown(dev);
 		}
diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x *.orig -x *.rej -x .git -r linus/include/linux/device.h linux/include/linux/device.h
--- linus/include/linux/device.h	Sun Nov  6 22:20:07 2005
+++ linux/include/linux/device.h	Sun Nov 13 13:58:17 2005
@@ -49,6 +49,9 @@ struct bus_type {
 	int		(*match)(struct device * dev, struct device_driver * drv);
 	int		(*hotplug) (struct device *dev, char **envp, 
 				    int num_envp, char *buffer, int buffer_size);
+	int		(*probe)(struct device * dev);
+	int		(*remove)(struct device * dev);
+	void		(*shutdown)(struct device * dev);
 	int		(*suspend)(struct device * dev, pm_message_t state);
 	int		(*resume)(struct device * dev);
 };

^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2006-01-23  8:39 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-13 19:46 [GIT PATCH] More Driver Core patches for 2.6.15 Greg KH
2006-01-13 19:50 ` [PATCH] Add bus_type probe, remove, shutdown methods Greg KH
2006-01-13 19:50   ` [PATCH] Add pci_bus_type probe and remove methods Greg KH
2006-01-13 19:50     ` [PATCH] INPUT: add MODALIAS to the event environment Greg KH
2006-01-13 19:50       ` [PATCH] Add SA1111 bus_type probe/remove methods Greg KH
2006-01-13 19:50         ` [PATCH] Add locomo " Greg KH
2006-01-13 19:50           ` [PATCH] Add logic module " Greg KH
2006-01-13 19:50             ` [PATCH] Add tiocx " Greg KH
2006-01-13 19:50               ` [PATCH] Add ecard_bus_type probe/remove/shutdown methods Greg KH
2006-01-13 19:50                 ` [PATCH] Add of_platform_bus_type probe and remove methods Greg KH
2006-01-13 19:50                   ` [PATCH] Add ocp_bus_type " Greg KH
2006-01-13 19:50                     ` [PATCH] Add parisc_bus_type " Greg KH
2006-01-13 19:50                       ` [PATCH] Add sh_bus_type " Greg KH
2006-01-13 19:50                         ` [PATCH] Add gameport bus_type " Greg KH
2006-01-13 19:50                           ` [PATCH] Add vio_bus_type " Greg KH
2006-01-13 19:50                             ` [PATCH] Add serio bus_type " Greg KH
2006-01-13 19:50                               ` [PATCH] Add dio_bus_type " Greg KH
2006-01-13 19:50                                 ` [PATCH] Add i2c_bus_type " Greg KH
2006-01-13 19:50                                   ` [PATCH] Add pcmcia_bus_type " Greg KH
2006-01-13 19:50                                     ` [PATCH] Add MCP bus_type " Greg KH
2006-01-13 19:50                                       ` [PATCH] Add macio_bus_type " Greg KH
2006-01-13 19:50                                         ` [PATCH] Add mmc_bus_type " Greg KH
2006-01-13 19:50                                           ` [PATCH] Add pnp_bus_type " Greg KH
2006-01-13 19:50                                             ` [PATCH] Add usb_serial_bus_type " Greg KH
2006-01-13 19:50                                               ` [PATCH] Add ccwgroup_bus_type " Greg KH
2006-01-13 19:50                                                 ` [PATCH] Add superhyway_bus_type " Greg KH
2006-01-13 19:50                                                   ` [PATCH] Add ide_bus_type " Greg KH
2006-01-13 19:50                                                     ` [PATCH] Add zorro_bus_type " Greg KH
2006-01-13 19:50                                                       ` [PATCH] Add Pseudo LLD bus_type " Greg KH
2006-01-13 19:50                                                         ` [PATCH] Add rio_bus_type " Greg KH
2006-01-13 19:50                                                           ` [PATCH] platform-device-del typo fix Greg KH
2006-01-13 19:50                                                             ` [PATCH] Add bttv sub bus_type probe and remove methods Greg KH
2006-01-13 19:50                                                               ` [PATCH] Add {css,ccw}_bus_type probe, remove, shutdown methods Greg KH
2006-01-13 19:50                                                                 ` [PATCH] Remove usb gadget generic driver methods Greg KH
2006-01-13 19:50                                                                   ` [PATCH] device_shutdown can loop if the driver frees itself Greg KH
2006-01-13 20:06                                                     ` [PATCH] Add ide_bus_type probe and remove methods Bartlomiej Zolnierkiewicz
2006-01-14 19:57                                                       ` Russell King
2006-01-14 20:32                                                         ` Bartlomiej Zolnierkiewicz
2006-01-23  8:39                                                         ` Bartlomiej Zolnierkiewicz
2006-01-14  5:14       ` [PATCH] INPUT: add MODALIAS to the event environment Alexander E. Patrakov
2006-01-14 11:04         ` Kay Sievers
2006-01-14 13:15           ` Alexander E. Patrakov
2006-01-14 13:21             ` Kay Sievers
2006-01-14 13:42               ` Alexander E. Patrakov
2006-01-14 14:11                 ` Kay Sievers
2006-01-14 14:50                   ` Alexander E. Patrakov
2006-01-23  6:00             ` Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2006-01-05 14:29 [CFT 1/29] Add bus_type probe, remove, shutdown methods Russell King
2006-01-06 11:48 ` Russell King
2006-01-06 13:38   ` Cornelia Huck
2006-01-11  9:56     ` [PATCH] Add {css,ccw}_bus_type " Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).