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
[PATCH] Remove usb gadget generic driver methods
USB gadget drivers make no use of these, remove the pointless
comments.
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit d78967fb035aeb839a047ae69ce5f1ff39288a8d
tree e76337604583e4052b8a685223af1d342f40ad19
parent 4031bbe4bbec6c0fe50412ef7fb43a270b0f29f1
author Russell King <[email protected]> Fri, 06 Jan 2006 11:41:32 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:11 -0800
drivers/usb/gadget/ether.c | 3 ---
drivers/usb/gadget/inode.c | 3 ---
drivers/usb/gadget/serial.c | 3 ---
drivers/usb/gadget/zero.c | 3 ---
4 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 8f402f8..afc84cf 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -2534,9 +2534,6 @@ static struct usb_gadget_driver eth_driv
.driver = {
.name = (char *) shortname,
.owner = THIS_MODULE,
- // .shutdown = ...
- // .suspend = ...
- // .resume = ...
},
};
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index c6c279d..9a4edc5 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1738,9 +1738,6 @@ static struct usb_gadget_driver gadgetfs
.driver = {
.name = (char *) shortname,
- // .shutdown = ...
- // .suspend = ...
- // .resume = ...
},
};
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index 2e6926b..ba9acd5 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -374,9 +374,6 @@ static struct usb_gadget_driver gs_gadge
.disconnect = gs_disconnect,
.driver = {
.name = GS_SHORT_NAME,
- /* .shutdown = ... */
- /* .suspend = ... */
- /* .resume = ... */
},
};
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
index 6c58636..2fc110d 100644
--- a/drivers/usb/gadget/zero.c
+++ b/drivers/usb/gadget/zero.c
@@ -1303,9 +1303,6 @@ static struct usb_gadget_driver zero_dri
.driver = {
.name = (char *) shortname,
.owner = THIS_MODULE,
- // .shutdown = ...
- // .suspend = ...
- // .resume = ...
},
};
[PATCH] platform-device-del typo fix
Please fold this typo fix into platform-device-del.patch, as was
discussed earlier on LKML:
http://lkml.org/lkml/2005/12/10/76
Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 2d7b5a70e01ff8b1b054d8313362e454e3057c5a
tree db0c60aac7ed0d07de1c1b53957bf11fac4ffc17
parent 8bbace7e686f1536905c703038a7eddfb1520264
author Jean Delvare <[email protected]> Tue, 27 Dec 2005 19:45:58 +0100
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:11 -0800
drivers/base/platform.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 0f81731..461554a 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -327,7 +327,7 @@ EXPORT_SYMBOL_GPL(platform_device_regist
* @pdev: platform device we're unregistering
*
* Unregistration is done in 2 steps. Fisrt we release all resources
- * and remove it from the sybsystem, then we drop reference count by
+ * and remove it from the subsystem, then we drop reference count by
* calling platform_device_put().
*/
void platform_device_unregister(struct platform_device * pdev)
[PATCH] Add {css,ccw}_bus_type probe, remove, shutdown methods.
The following patch converts css_bus_type and ccw_bus_type to use
the new bus_type methods.
Signed-off-by: Cornelia Huck <[email protected]>
CC: Martin Schwidefsky <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 8bbace7e686f1536905c703038a7eddfb1520264
tree 99253fd56bebd7903ac8dd05ee7c236c765e2798
parent 348290a4ae143a692124330942b464ccdb0d0365
author Cornelia Huck <[email protected]> Wed, 11 Jan 2006 10:56:22 +0100
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:11 -0800
drivers/s390/cio/css.c | 36 +++++++++++++++++++++++++++++++-
drivers/s390/cio/css.h | 4 ++++
drivers/s390/cio/device.c | 50 ++++++++++++++++++++++-----------------------
3 files changed, 62 insertions(+), 28 deletions(-)
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index e565193..2d319fb 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -542,9 +542,41 @@ css_bus_match (struct device *dev, struc
return 0;
}
+static int
+css_probe (struct device *dev)
+{
+ struct subchannel *sch;
+
+ sch = to_subchannel(dev);
+ sch->driver = container_of (dev->driver, struct css_driver, drv);
+ return (sch->driver->probe ? sch->driver->probe(sch) : 0);
+}
+
+static int
+css_remove (struct device *dev)
+{
+ struct subchannel *sch;
+
+ sch = to_subchannel(dev);
+ return (sch->driver->remove ? sch->driver->remove(sch) : 0);
+}
+
+static void
+css_shutdown (struct device *dev)
+{
+ struct subchannel *sch;
+
+ sch = to_subchannel(dev);
+ if (sch->driver->shutdown)
+ sch->driver->shutdown(sch);
+}
+
struct bus_type css_bus_type = {
- .name = "css",
- .match = &css_bus_match,
+ .name = "css",
+ .match = css_bus_match,
+ .probe = css_probe,
+ .remove = css_remove,
+ .shutdown = css_shutdown,
};
subsys_initcall(init_channel_subsystem);
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h
index 251ebd7..aa5ab5d 100644
--- a/drivers/s390/cio/css.h
+++ b/drivers/s390/cio/css.h
@@ -115,6 +115,7 @@ struct ccw_device_private {
* Currently, we only care about I/O subchannels (type 0), these
* have a ccw_device connected to them.
*/
+struct subchannel;
struct css_driver {
unsigned int subchannel_type;
struct device_driver drv;
@@ -122,6 +123,9 @@ struct css_driver {
int (*notify)(struct device *, int);
void (*verify)(struct device *);
void (*termination)(struct device *);
+ int (*probe)(struct subchannel *);
+ int (*remove)(struct subchannel *);
+ void (*shutdown)(struct subchannel *);
};
/*
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index fa3e4c0..eb73605 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -107,33 +107,29 @@ ccw_uevent (struct device *dev, char **e
return 0;
}
-struct bus_type ccw_bus_type = {
- .name = "ccw",
- .match = &ccw_bus_match,
- .uevent = &ccw_uevent,
-};
+struct bus_type ccw_bus_type;
-static int io_subchannel_probe (struct device *);
-static int io_subchannel_remove (struct device *);
+static int io_subchannel_probe (struct subchannel *);
+static int io_subchannel_remove (struct subchannel *);
void io_subchannel_irq (struct device *);
static int io_subchannel_notify(struct device *, int);
static void io_subchannel_verify(struct device *);
static void io_subchannel_ioterm(struct device *);
-static void io_subchannel_shutdown(struct device *);
+static void io_subchannel_shutdown(struct subchannel *);
struct css_driver io_subchannel_driver = {
.subchannel_type = SUBCHANNEL_TYPE_IO,
.drv = {
.name = "io_subchannel",
.bus = &css_bus_type,
- .probe = &io_subchannel_probe,
- .remove = &io_subchannel_remove,
- .shutdown = &io_subchannel_shutdown,
},
.irq = io_subchannel_irq,
.notify = io_subchannel_notify,
.verify = io_subchannel_verify,
.termination = io_subchannel_ioterm,
+ .probe = io_subchannel_probe,
+ .remove = io_subchannel_remove,
+ .shutdown = io_subchannel_shutdown,
};
struct workqueue_struct *ccw_device_work;
@@ -803,14 +799,12 @@ io_subchannel_recog(struct ccw_device *c
}
static int
-io_subchannel_probe (struct device *pdev)
+io_subchannel_probe (struct subchannel *sch)
{
- struct subchannel *sch;
struct ccw_device *cdev;
int rc;
unsigned long flags;
- sch = to_subchannel(pdev);
if (sch->dev.driver_data) {
/*
* This subchannel already has an associated ccw_device.
@@ -846,7 +840,7 @@ io_subchannel_probe (struct device *pdev
memset(cdev->private, 0, sizeof(struct ccw_device_private));
atomic_set(&cdev->private->onoff, 0);
cdev->dev = (struct device) {
- .parent = pdev,
+ .parent = &sch->dev,
.release = ccw_device_release,
};
INIT_LIST_HEAD(&cdev->private->kick_work.entry);
@@ -859,7 +853,7 @@ io_subchannel_probe (struct device *pdev
return -ENODEV;
}
- rc = io_subchannel_recog(cdev, to_subchannel(pdev));
+ rc = io_subchannel_recog(cdev, sch);
if (rc) {
spin_lock_irqsave(&sch->lock, flags);
sch->dev.driver_data = NULL;
@@ -883,17 +877,17 @@ ccw_device_unregister(void *data)
}
static int
-io_subchannel_remove (struct device *dev)
+io_subchannel_remove (struct subchannel *sch)
{
struct ccw_device *cdev;
unsigned long flags;
- if (!dev->driver_data)
+ if (!sch->dev.driver_data)
return 0;
- cdev = dev->driver_data;
+ cdev = sch->dev.driver_data;
/* Set ccw device to not operational and drop reference. */
spin_lock_irqsave(cdev->ccwlock, flags);
- dev->driver_data = NULL;
+ sch->dev.driver_data = NULL;
cdev->private->state = DEV_STATE_NOT_OPER;
spin_unlock_irqrestore(cdev->ccwlock, flags);
/*
@@ -948,14 +942,12 @@ io_subchannel_ioterm(struct device *dev)
}
static void
-io_subchannel_shutdown(struct device *dev)
+io_subchannel_shutdown(struct subchannel *sch)
{
- struct subchannel *sch;
struct ccw_device *cdev;
int ret;
- sch = to_subchannel(dev);
- cdev = dev->driver_data;
+ cdev = sch->dev.driver_data;
if (cio_is_console(sch->schid))
return;
@@ -1129,6 +1121,14 @@ ccw_device_remove (struct device *dev)
return 0;
}
+struct bus_type ccw_bus_type = {
+ .name = "ccw",
+ .match = ccw_bus_match,
+ .uevent = ccw_uevent,
+ .probe = ccw_device_probe,
+ .remove = ccw_device_remove,
+};
+
int
ccw_driver_register (struct ccw_driver *cdriver)
{
@@ -1136,8 +1136,6 @@ ccw_driver_register (struct ccw_driver *
drv->bus = &ccw_bus_type;
drv->name = cdriver->name;
- drv->probe = ccw_device_probe;
- drv->remove = ccw_device_remove;
return driver_register(drv);
}
[PATCH] device_shutdown can loop if the driver frees itself
This patch changes device_shutdown() to use the newly introduced safe
reverse list traversal. We experienced loops on system reboot if we had
removed and re-inserted our device from the device list.
We noticed this problem on PPC405. Our PCI IDE device comes and goes a lot.
Our hypothesis was that there was a loop caused by the driver->shutdown
freeing memory. It is possible that we do something wrong as well, but
being unable to reboot is kind of nasty.
Signed-off-by: Michael Richardson <[email protected]>
Cc: Patrick Mochel <[email protected]>
Cc: David Howells <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 9c08a938ce5a3e1c9d5f764dc6ae844cb1af76ff
tree 9bd0a984b2e5466454e2633783786a516fe14484
parent 2d7b5a70e01ff8b1b054d8313362e454e3057c5a
author Michael Richardson <[email protected]> Mon, 09 Jan 2006 01:04:51 -0800
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:12 -0800
drivers/base/power/shutdown.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c
index a47bb74..c2475f3 100644
--- a/drivers/base/power/shutdown.c
+++ b/drivers/base/power/shutdown.c
@@ -35,10 +35,10 @@ extern int sysdev_shutdown(void);
*/
void device_shutdown(void)
{
- struct device * dev;
+ struct device * dev, *devn;
down_write(&devices_subsys.rwsem);
- list_for_each_entry_reverse(dev, &devices_subsys.kset.list,
+ list_for_each_entry_safe_reverse(dev, devn, &devices_subsys.kset.list,
kobj.entry) {
if (dev->bus && dev->bus->shutdown) {
dev_dbg(dev, "shutdown\n");
[PATCH] Add tiocx bus_type probe/remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 83dfb8b67522f6cf1fc5771a8be0a9095eea65d4
tree b146d1eaa04b9ff40e0ce755bd041dcae23cccc6
parent 5c0784c350516856ed15deb6adf6b053bf427792
author Russell King <[email protected]> Thu, 05 Jan 2006 14:34:06 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:05 -0800
arch/ia64/sn/kernel/tiocx.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index 493fb3f..6a7939b 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -77,12 +77,6 @@ static void tiocx_bus_release(struct dev
kfree(to_cx_dev(dev));
}
-struct bus_type tiocx_bus_type = {
- .name = "tiocx",
- .match = tiocx_match,
- .uevent = tiocx_uevent,
-};
-
/**
* cx_device_match - Find cx_device in the id table.
* @ids: id table from driver
@@ -149,6 +143,14 @@ static int cx_driver_remove(struct devic
return 0;
}
+struct bus_type tiocx_bus_type = {
+ .name = "tiocx",
+ .match = tiocx_match,
+ .uevent = tiocx_uevent,
+ .probe = cx_device_probe,
+ .remove = cx_driver_remove,
+};
+
/**
* cx_driver_register - Register the driver.
* @cx_driver: driver table (cx_drv struct) from driver
@@ -162,8 +164,6 @@ int cx_driver_register(struct cx_drv *cx
{
cx_driver->driver.name = cx_driver->name;
cx_driver->driver.bus = &tiocx_bus_type;
- cx_driver->driver.probe = cx_device_probe;
- cx_driver->driver.remove = cx_driver_remove;
return driver_register(&cx_driver->driver);
}
[PATCH] Add of_platform_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 79f9fb8886d901fd549793a4ad632ece51c68405
tree f51fb4fd185efde0cf2c82245ee1f9a67848d062
parent c6a09196bab3bc9e515b713193d61e3e87c720f7
author Russell King <[email protected]> Thu, 05 Jan 2006 14:36:16 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:06 -0800
arch/powerpc/kernel/of_device.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
index 7065e40..22d83d4 100644
--- a/arch/powerpc/kernel/of_device.c
+++ b/arch/powerpc/kernel/of_device.c
@@ -132,6 +132,8 @@ static int of_device_resume(struct devic
struct bus_type of_platform_bus_type = {
.name = "of_platform",
.match = of_platform_bus_match,
+ .probe = of_device_probe,
+ .remove = of_device_remove,
.suspend = of_device_suspend,
.resume = of_device_resume,
};
@@ -150,8 +152,6 @@ int of_register_driver(struct of_platfor
/* initialize common driver fields */
drv->driver.name = drv->name;
drv->driver.bus = &of_platform_bus_type;
- drv->driver.probe = of_device_probe;
- drv->driver.remove = of_device_remove;
/* register with core */
count = driver_register(&drv->driver);
[PATCH] Add bus_type probe, remove, shutdown methods.
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 594c8281f90560faf9632d91bb9d402cbe560e63
tree abeb32df086cfd204accad33b11040381c31689d
parent bd37e5a951ad2123d3f51f59c407b5242946b6ba
author Russell King <[email protected]> Thu, 05 Jan 2006 14:29:51 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:04 -0800
drivers/base/dd.c | 12 ++++++++++--
drivers/base/driver.c | 5 +++++
drivers/base/power/shutdown.c | 5 ++++-
include/linux/device.h | 3 +++
4 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 2b90501..730a9ce 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -78,7 +78,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;
@@ -203,7 +209,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
index 161f3a3..b400314 100644
--- 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 --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c
index f50a08b..a47bb74 100644
--- a/drivers/base/power/shutdown.c
+++ b/drivers/base/power/shutdown.c
@@ -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 --git a/include/linux/device.h b/include/linux/device.h
index 0cdee78..58df18d 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -49,6 +49,9 @@ struct bus_type {
int (*match)(struct device * dev, struct device_driver * drv);
int (*uevent)(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);
};
[PATCH] Add logic module bus_type probe/remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 5c0784c350516856ed15deb6adf6b053bf427792
tree 283a9078a98288b2f8352d8d6999ac32ffb05f5d
parent 306955be37dd1b1f232f19766227ccccb83f7873
author Russell King <[email protected]> Thu, 05 Jan 2006 14:33:35 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:05 -0800
arch/arm/mach-integrator/lm.c | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/arch/arm/mach-integrator/lm.c b/arch/arm/mach-integrator/lm.c
index 5b41e3a..622cdc4 100644
--- a/arch/arm/mach-integrator/lm.c
+++ b/arch/arm/mach-integrator/lm.c
@@ -22,20 +22,6 @@ static int lm_match(struct device *dev,
return 1;
}
-static struct bus_type lm_bustype = {
- .name = "logicmodule",
- .match = lm_match,
-// .suspend = lm_suspend,
-// .resume = lm_resume,
-};
-
-static int __init lm_init(void)
-{
- return bus_register(&lm_bustype);
-}
-
-postcore_initcall(lm_init);
-
static int lm_bus_probe(struct device *dev)
{
struct lm_device *lmdev = to_lm_device(dev);
@@ -49,16 +35,30 @@ static int lm_bus_remove(struct device *
struct lm_device *lmdev = to_lm_device(dev);
struct lm_driver *lmdrv = to_lm_driver(dev->driver);
- lmdrv->remove(lmdev);
+ if (lmdrv->remove)
+ lmdrv->remove(lmdev);
return 0;
}
+static struct bus_type lm_bustype = {
+ .name = "logicmodule",
+ .match = lm_match,
+ .probe = lm_bus_probe,
+ .remove = lm_bus_remove,
+// .suspend = lm_bus_suspend,
+// .resume = lm_bus_resume,
+};
+
+static int __init lm_init(void)
+{
+ return bus_register(&lm_bustype);
+}
+
+postcore_initcall(lm_init);
+
int lm_driver_register(struct lm_driver *drv)
{
drv->drv.bus = &lm_bustype;
- drv->drv.probe = lm_bus_probe;
- drv->drv.remove = lm_bus_remove;
-
return driver_register(&drv->drv);
}
[PATCH] Add ocp_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 91fb53866d00b4eaeaf1cbfd2237799cb152f742
tree 5c9181d21c4f1e74cbc6592659d608b4855b6287
parent ad3ed31c682d956d2187e562635c55c8c74c1021
author Russell King <[email protected]> Thu, 05 Jan 2006 14:35:09 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:06 -0800
arch/ppc/syslib/ocp.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/ppc/syslib/ocp.c b/arch/ppc/syslib/ocp.c
index 9ccce43..ab34b1d 100644
--- a/arch/ppc/syslib/ocp.c
+++ b/arch/ppc/syslib/ocp.c
@@ -189,6 +189,8 @@ ocp_device_resume(struct device *dev)
struct bus_type ocp_bus_type = {
.name = "ocp",
.match = ocp_device_match,
+ .probe = ocp_driver_probe,
+ .remove = ocp_driver_remove,
.suspend = ocp_device_suspend,
.resume = ocp_device_resume,
};
@@ -210,8 +212,6 @@ ocp_register_driver(struct ocp_driver *d
/* initialize common driver fields */
drv->driver.name = drv->name;
drv->driver.bus = &ocp_bus_type;
- drv->driver.probe = ocp_device_probe;
- drv->driver.remove = ocp_device_remove;
/* register with core */
return driver_register(&drv->driver);
[PATCH] INPUT: add MODALIAS to the event environment
input: add MODALIAS to the event environment
Signed-off-by: Kay Sievers <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit bd37e5a951ad2123d3f51f59c407b5242946b6ba
tree 3a9b4875ee602d9495d4b3e1f202b20d644ae793
parent 67daf5f11f06b9b15f8320de1d237ccc2e74fe43
author Kay Sievers <[email protected]> Thu, 05 Jan 2006 13:19:55 +0100
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:04 -0800
drivers/input/input.c | 55 +++++++++++++++++++++++++++++++++----------------
1 files changed, 37 insertions(+), 18 deletions(-)
diff --git a/drivers/input/input.c b/drivers/input/input.c
index fe33ff3..4fe3da3 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -528,40 +528,56 @@ INPUT_DEV_STRING_ATTR_SHOW(name);
INPUT_DEV_STRING_ATTR_SHOW(phys);
INPUT_DEV_STRING_ATTR_SHOW(uniq);
-static int print_modalias_bits(char *buf, char prefix, unsigned long *arr,
+static int print_modalias_bits(char *buf, int size, char prefix, unsigned long *arr,
unsigned int min, unsigned int max)
{
int len, i;
- len = sprintf(buf, "%c", prefix);
+ len = snprintf(buf, size, "%c", prefix);
for (i = min; i < max; i++)
if (arr[LONG(i)] & BIT(i))
- len += sprintf(buf+len, "%X,", i);
+ len += snprintf(buf + len, size - len, "%X,", i);
return len;
}
-static ssize_t input_dev_show_modalias(struct class_device *dev, char *buf)
+static int print_modalias(char *buf, int size, struct input_dev *id)
{
- struct input_dev *id = to_input_dev(dev);
- ssize_t len = 0;
+ int len;
- len += sprintf(buf+len, "input:b%04Xv%04Xp%04Xe%04X-",
+ len = snprintf(buf, size, "input:b%04Xv%04Xp%04Xe%04X-",
id->id.bustype,
id->id.vendor,
id->id.product,
id->id.version);
- len += print_modalias_bits(buf+len, 'e', id->evbit, 0, EV_MAX);
- len += print_modalias_bits(buf+len, 'k', id->keybit,
+ len += print_modalias_bits(buf + len, size - len, 'e', id->evbit,
+ 0, EV_MAX);
+ len += print_modalias_bits(buf + len, size - len, 'k', id->keybit,
KEY_MIN_INTERESTING, KEY_MAX);
- len += print_modalias_bits(buf+len, 'r', id->relbit, 0, REL_MAX);
- len += print_modalias_bits(buf+len, 'a', id->absbit, 0, ABS_MAX);
- len += print_modalias_bits(buf+len, 'm', id->mscbit, 0, MSC_MAX);
- len += print_modalias_bits(buf+len, 'l', id->ledbit, 0, LED_MAX);
- len += print_modalias_bits(buf+len, 's', id->sndbit, 0, SND_MAX);
- len += print_modalias_bits(buf+len, 'f', id->ffbit, 0, FF_MAX);
- len += print_modalias_bits(buf+len, 'w', id->swbit, 0, SW_MAX);
- len += sprintf(buf+len, "\n");
+ len += print_modalias_bits(buf + len, size - len, 'r', id->relbit,
+ 0, REL_MAX);
+ len += print_modalias_bits(buf + len, size - len, 'a', id->absbit,
+ 0, ABS_MAX);
+ len += print_modalias_bits(buf + len, size - len, 'm', id->mscbit,
+ 0, MSC_MAX);
+ len += print_modalias_bits(buf + len, size - len, 'l', id->ledbit,
+ 0, LED_MAX);
+ len += print_modalias_bits(buf + len, size - len, 's', id->sndbit,
+ 0, SND_MAX);
+ len += print_modalias_bits(buf + len, size - len, 'f', id->ffbit,
+ 0, FF_MAX);
+ len += print_modalias_bits(buf + len, size - len, 'w', id->swbit,
+ 0, SW_MAX);
+ return len;
+}
+
+static ssize_t input_dev_show_modalias(struct class_device *dev, char *buf)
+{
+ struct input_dev *id = to_input_dev(dev);
+ ssize_t len;
+
+ len = print_modalias(buf, PAGE_SIZE, id);
+ len += snprintf(buf + len, PAGE_SIZE-len, "\n");
return len;
}
static CLASS_DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL);
@@ -728,8 +744,11 @@ static int input_dev_uevent(struct class
if (test_bit(EV_SW, dev->evbit))
INPUT_ADD_HOTPLUG_BM_VAR("SW=", dev->swbit, SW_MAX);
- envp[i] = NULL;
+ envp[i++] = buffer + len;
+ len += snprintf(buffer + len, buffer_size - len, "MODALIAS=");
+ len += print_modalias(buffer + len, buffer_size - len, dev) + 1;
+ envp[i] = NULL;
return 0;
}
[PATCH] Add MCP bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 413b486e18587fd53c9954252e6648f9450c734e
tree de5bb0cea40571fb97d93b54746cf21f214df971
parent 4866b124a1ded3b94b0cea0bd543f46ffa9a3943
author Russell King <[email protected]> Thu, 05 Jan 2006 14:39:56 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:08 -0800
drivers/mfd/mcp-core.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/mcp-core.c b/drivers/mfd/mcp-core.c
index 55ba230..75f401d 100644
--- a/drivers/mfd/mcp-core.c
+++ b/drivers/mfd/mcp-core.c
@@ -77,6 +77,8 @@ static int mcp_bus_resume(struct device
static struct bus_type mcp_bus_type = {
.name = "mcp",
.match = mcp_bus_match,
+ .probe = mcp_bus_probe,
+ .remove = mcp_bus_remove,
.suspend = mcp_bus_suspend,
.resume = mcp_bus_resume,
};
@@ -227,8 +229,6 @@ EXPORT_SYMBOL(mcp_host_unregister);
int mcp_driver_register(struct mcp_driver *mcpdrv)
{
mcpdrv->drv.bus = &mcp_bus_type;
- mcpdrv->drv.probe = mcp_bus_probe;
- mcpdrv->drv.remove = mcp_bus_remove;
return driver_register(&mcpdrv->drv);
}
EXPORT_SYMBOL(mcp_driver_register);
[PATCH] Add rio_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit fc3d3ddd3e628d9f22d4aa56a640d0b31c977a8f
tree 78d353c96c168963c12a666bcfabaf87df6cec99
parent b6a01e9bda69aaf22f3a23bafc91c0fb51420a7a
author Russell King <[email protected]> Thu, 05 Jan 2006 14:44:14 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:10 -0800
drivers/rapidio/rio-driver.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/rapidio/rio-driver.c b/drivers/rapidio/rio-driver.c
index dc74960..5480119 100644
--- a/drivers/rapidio/rio-driver.c
+++ b/drivers/rapidio/rio-driver.c
@@ -147,8 +147,6 @@ int rio_register_driver(struct rio_drive
/* initialize common driver fields */
rdrv->driver.name = rdrv->name;
rdrv->driver.bus = &rio_bus_type;
- rdrv->driver.probe = rio_device_probe;
- rdrv->driver.remove = rio_device_remove;
/* register with core */
return driver_register(&rdrv->driver);
@@ -204,7 +202,9 @@ static struct device rio_bus = {
struct bus_type rio_bus_type = {
.name = "rapidio",
.match = rio_match_bus,
- .dev_attrs = rio_dev_attrs
+ .dev_attrs = rio_dev_attrs,
+ .probe = rio_device_probe,
+ .remove = rio_device_remove,
};
/**
[PATCH] Add gameport bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 29a4a20e9fe7459f9d464b8be070ce8b7335be7e
tree fab8064c3d917482ee8c885ed10f75860f240d70
parent b864c7d5d17c171c4ead0791b44ab05d7a21dc0c
author Russell King <[email protected]> Thu, 05 Jan 2006 14:38:22 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:07 -0800
drivers/input/gameport/gameport.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index caac6d6..b765a15 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -50,9 +50,7 @@ static DECLARE_MUTEX(gameport_sem);
static LIST_HEAD(gameport_list);
-static struct bus_type gameport_bus = {
- .name = "gameport",
-};
+static struct bus_type gameport_bus;
static void gameport_add_port(struct gameport *gameport);
static void gameport_destroy_port(struct gameport *gameport);
@@ -703,11 +701,15 @@ static int gameport_driver_remove(struct
return 0;
}
+static struct bus_type gameport_bus = {
+ .name = "gameport",
+ .probe = gameport_driver_probe,
+ .remove = gameport_driver_remove,
+};
+
void __gameport_register_driver(struct gameport_driver *drv, struct module *owner)
{
drv->driver.bus = &gameport_bus;
- drv->driver.probe = gameport_driver_probe;
- drv->driver.remove = gameport_driver_remove;
gameport_queue_event(drv, owner, GAMEPORT_REGISTER_DRIVER);
}
[PATCH] Add ecard_bus_type probe/remove/shutdown methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit e08b754161d6de4f91e2d3c805f350b35a95d8b8
tree 5a0dad12bed3064416e78f753982d9c7137a36be
parent b15d686a2b589c9e4f1ea116553e9c3c3d030dae
author Russell King <[email protected]> Thu, 05 Jan 2006 14:30:57 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:05 -0800
arch/arm/kernel/ecard.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 96fd919..74ea29c 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -1147,9 +1147,11 @@ static void ecard_drv_shutdown(struct de
struct ecard_driver *drv = ECARD_DRV(dev->driver);
struct ecard_request req;
- if (drv->shutdown)
- drv->shutdown(ec);
- ecard_release(ec);
+ if (dev->driver) {
+ if (drv->shutdown)
+ drv->shutdown(ec);
+ ecard_release(ec);
+ }
/*
* If this card has a loader, call the reset handler.
@@ -1164,9 +1166,6 @@ static void ecard_drv_shutdown(struct de
int ecard_register_driver(struct ecard_driver *drv)
{
drv->drv.bus = &ecard_bus_type;
- drv->drv.probe = ecard_drv_probe;
- drv->drv.remove = ecard_drv_remove;
- drv->drv.shutdown = ecard_drv_shutdown;
return driver_register(&drv->drv);
}
@@ -1195,6 +1194,9 @@ struct bus_type ecard_bus_type = {
.name = "ecard",
.dev_attrs = ecard_dev_attrs,
.match = ecard_match,
+ .probe = ecard_drv_probe,
+ .remove = ecard_drv_remove,
+ .shutdown = ecard_drv_shutdown,
};
static int ecard_bus_init(void)
[PATCH] Add pci_bus_type probe and remove methods
Move the PCI bus device probe/remove methods to the bus_type
structure. We leave the shutdown method alone since there
are compatibility issues with that.
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit b15d686a2b589c9e4f1ea116553e9c3c3d030dae
tree a4412435d021a65c38a4e91b2ec6e94aaba76ce2
parent 594c8281f90560faf9632d91bb9d402cbe560e63
author Russell King <[email protected]> Thu, 05 Jan 2006 14:30:22 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:04 -0800
drivers/pci/pci-driver.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 7146b69..0aa14c9 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -380,8 +380,6 @@ int __pci_register_driver(struct pci_dri
/* initialize common driver fields */
drv->driver.name = drv->name;
drv->driver.bus = &pci_bus_type;
- drv->driver.probe = pci_device_probe;
- drv->driver.remove = pci_device_remove;
/* FIXME, once all of the existing PCI drivers have been fixed to set
* the pci shutdown function, this test can go away. */
if (!drv->driver.shutdown)
@@ -513,6 +511,8 @@ struct bus_type pci_bus_type = {
.name = "pci",
.match = pci_bus_match,
.uevent = pci_uevent,
+ .probe = pci_device_probe,
+ .remove = pci_device_remove,
.suspend = pci_device_suspend,
.resume = pci_device_resume,
.dev_attrs = pci_dev_attrs,
[PATCH] Add vio_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 2f53a80fc0f6287d4bd6cc2422cd095c90f30410
tree 2247f49c965012d22f6d67442b7be64122958f55
parent 79f9fb8886d901fd549793a4ad632ece51c68405
author Russell King <[email protected]> Thu, 05 Jan 2006 14:36:47 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:07 -0800
arch/powerpc/kernel/vio.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 13c4149..13c655b 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -76,7 +76,7 @@ static void vio_bus_shutdown(struct devi
struct vio_dev *viodev = to_vio_dev(dev);
struct vio_driver *viodrv = to_vio_driver(dev->driver);
- if (viodrv->shutdown)
+ if (dev->driver && viodrv->shutdown)
viodrv->shutdown(viodev);
}
@@ -91,9 +91,6 @@ int vio_register_driver(struct vio_drive
/* fill in 'struct driver' fields */
viodrv->driver.bus = &vio_bus_type;
- viodrv->driver.probe = vio_bus_probe;
- viodrv->driver.remove = vio_bus_remove;
- viodrv->driver.shutdown = vio_bus_shutdown;
return driver_register(&viodrv->driver);
}
@@ -295,4 +292,7 @@ struct bus_type vio_bus_type = {
.name = "vio",
.uevent = vio_hotplug,
.match = vio_bus_match,
+ .probe = vio_bus_probe,
+ .remove = vio_bus_remove,
+ .shutdown = vio_bus_shutdown,
};
[PATCH] Add ide_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 4031bbe4bbec6c0fe50412ef7fb43a270b0f29f1
tree 1e1449ba492ab04d8c5fbc75f9761be237bcae72
parent bbbe3a41f7ee529f7f4fdcc1bc1157234bac0766
author Russell King <[email protected]> Fri, 06 Jan 2006 11:41:00 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:10 -0800
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 +++++++++++++++++++++++++++++++
include/linux/ide.h | 5 +++++
6 files changed, 61 insertions(+), 43 deletions(-)
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 9b2ebd2..ef09a7e 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -3256,9 +3256,8 @@ sector_t ide_cdrom_capacity (ide_drive_t
}
#endif
-static int ide_cd_remove(struct device *dev)
+static void ide_cd_remove(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
struct cdrom_info *info = drive->driver_data;
ide_unregister_subdriver(drive, info->driver);
@@ -3266,8 +3265,6 @@ static int ide_cd_remove(struct device *
del_gendisk(info->disk);
ide_cd_put(info);
-
- return 0;
}
static void ide_cd_release(struct kref *kref)
@@ -3291,7 +3288,7 @@ static void ide_cd_release(struct kref *
kfree(info);
}
-static int ide_cd_probe(struct device *);
+static int ide_cd_probe(ide_drive_t *);
#ifdef CONFIG_PROC_FS
static int proc_idecd_read_capacity
@@ -3317,9 +3314,9 @@ static ide_driver_t ide_cdrom_driver = {
.owner = THIS_MODULE,
.name = "ide-cdrom",
.bus = &ide_bus_type,
- .probe = ide_cd_probe,
- .remove = ide_cd_remove,
},
+ .probe = ide_cd_probe,
+ .remove = ide_cd_remove,
.version = IDECD_VERSION,
.media = ide_cdrom,
.supports_dsc_overlap = 1,
@@ -3413,9 +3410,8 @@ static char *ignore = NULL;
module_param(ignore, charp, 0400);
MODULE_DESCRIPTION("ATAPI CD-ROM Driver");
-static int ide_cd_probe(struct device *dev)
+static int ide_cd_probe(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
struct cdrom_info *info;
struct gendisk *g;
struct request_sense sense;
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index cab362e..245b508 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -997,9 +997,8 @@ static void ide_cacheflush_p(ide_drive_t
printk(KERN_INFO "%s: wcache flush failed!\n", drive->name);
}
-static int ide_disk_remove(struct device *dev)
+static void ide_disk_remove(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
struct ide_disk_obj *idkp = drive->driver_data;
struct gendisk *g = idkp->disk;
@@ -1010,8 +1009,6 @@ static int ide_disk_remove(struct device
ide_cacheflush_p(drive);
ide_disk_put(idkp);
-
- return 0;
}
static void ide_disk_release(struct kref *kref)
@@ -1027,12 +1024,10 @@ static void ide_disk_release(struct kref
kfree(idkp);
}
-static int ide_disk_probe(struct device *dev);
+static int ide_disk_probe(ide_drive_t *drive);
-static void ide_device_shutdown(struct device *dev)
+static void ide_device_shutdown(ide_drive_t *drive)
{
- ide_drive_t *drive = container_of(dev, ide_drive_t, gendev);
-
#ifdef CONFIG_ALPHA
/* On Alpha, halt(8) doesn't actually turn the machine off,
it puts you into the sort of firmware monitor. Typically,
@@ -1054,7 +1049,7 @@ static void ide_device_shutdown(struct d
}
printk("Shutdown: %s\n", drive->name);
- dev->bus->suspend(dev, PMSG_SUSPEND);
+ drive->gendev.bus->suspend(&drive->gendev, PMSG_SUSPEND);
}
static ide_driver_t idedisk_driver = {
@@ -1062,10 +1057,10 @@ static ide_driver_t idedisk_driver = {
.owner = THIS_MODULE,
.name = "ide-disk",
.bus = &ide_bus_type,
- .probe = ide_disk_probe,
- .remove = ide_disk_remove,
- .shutdown = ide_device_shutdown,
},
+ .probe = ide_disk_probe,
+ .remove = ide_disk_remove,
+ .shutdown = ide_device_shutdown,
.version = IDEDISK_VERSION,
.media = ide_disk,
.supports_dsc_overlap = 0,
@@ -1182,9 +1177,8 @@ static struct block_device_operations id
MODULE_DESCRIPTION("ATA DISK Driver");
-static int ide_disk_probe(struct device *dev)
+static int ide_disk_probe(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
struct ide_disk_obj *idkp;
struct gendisk *g;
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 5945f55..1f8db9a 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -1871,9 +1871,8 @@ static void idefloppy_setup (ide_drive_t
idefloppy_add_settings(drive);
}
-static int ide_floppy_remove(struct device *dev)
+static void ide_floppy_remove(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
idefloppy_floppy_t *floppy = drive->driver_data;
struct gendisk *g = floppy->disk;
@@ -1882,8 +1881,6 @@ static int ide_floppy_remove(struct devi
del_gendisk(g);
ide_floppy_put(floppy);
-
- return 0;
}
static void ide_floppy_release(struct kref *kref)
@@ -1922,16 +1919,16 @@ static ide_proc_entry_t idefloppy_proc[]
#endif /* CONFIG_PROC_FS */
-static int ide_floppy_probe(struct device *);
+static int ide_floppy_probe(ide_drive_t *);
static ide_driver_t idefloppy_driver = {
.gen_driver = {
.owner = THIS_MODULE,
.name = "ide-floppy",
.bus = &ide_bus_type,
- .probe = ide_floppy_probe,
- .remove = ide_floppy_remove,
},
+ .probe = ide_floppy_probe,
+ .remove = ide_floppy_remove,
.version = IDEFLOPPY_VERSION,
.media = ide_floppy,
.supports_dsc_overlap = 0,
@@ -2136,9 +2133,8 @@ static struct block_device_operations id
.revalidate_disk= idefloppy_revalidate_disk
};
-static int ide_floppy_probe(struct device *dev)
+static int ide_floppy_probe(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
idefloppy_floppy_t *floppy;
struct gendisk *g;
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index fab9b2b..0101d0d 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -4682,9 +4682,8 @@ static void idetape_setup (ide_drive_t *
idetape_add_settings(drive);
}
-static int ide_tape_remove(struct device *dev)
+static void ide_tape_remove(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
idetape_tape_t *tape = drive->driver_data;
ide_unregister_subdriver(drive, tape->driver);
@@ -4692,8 +4691,6 @@ static int ide_tape_remove(struct device
ide_unregister_region(tape->disk);
ide_tape_put(tape);
-
- return 0;
}
static void ide_tape_release(struct kref *kref)
@@ -4745,16 +4742,16 @@ static ide_proc_entry_t idetape_proc[] =
#endif
-static int ide_tape_probe(struct device *);
+static int ide_tape_probe(ide_drive_t *);
static ide_driver_t idetape_driver = {
.gen_driver = {
.owner = THIS_MODULE,
.name = "ide-tape",
.bus = &ide_bus_type,
- .probe = ide_tape_probe,
- .remove = ide_tape_remove,
},
+ .probe = ide_tape_probe,
+ .remove = ide_tape_remove,
.version = IDETAPE_VERSION,
.media = ide_tape,
.supports_dsc_overlap = 1,
@@ -4825,9 +4822,8 @@ static struct block_device_operations id
.ioctl = idetape_ioctl,
};
-static int ide_tape_probe(struct device *dev)
+static int ide_tape_probe(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
idetape_tape_t *tape;
struct gendisk *g;
int minor;
@@ -4883,9 +4879,9 @@ static int ide_tape_probe(struct device
idetape_setup(drive, tape, minor);
class_device_create(idetape_sysfs_class, NULL,
- MKDEV(IDETAPE_MAJOR, minor), dev, "%s", tape->name);
+ MKDEV(IDETAPE_MAJOR, minor), &drive->gendev, "%s", tape->name);
class_device_create(idetape_sysfs_class, NULL,
- MKDEV(IDETAPE_MAJOR, minor + 128), dev, "n%s", tape->name);
+ MKDEV(IDETAPE_MAJOR, minor + 128), &drive->gendev, "n%s", tape->name);
devfs_mk_cdev(MKDEV(HWIF(drive)->major, minor),
S_IFCHR | S_IRUGO | S_IWUGO,
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index ec5a4cb..afeb02b 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1949,10 +1949,41 @@ static int ide_uevent(struct device *dev
return 0;
}
+static int generic_ide_probe(struct device *dev)
+{
+ ide_drive_t *drive = to_ide_device(dev);
+ ide_driver_t *drv = to_ide_driver(dev->driver);
+
+ return drv->probe ? drv->probe(drive) : -ENODEV;
+}
+
+static int generic_ide_remove(struct device *dev)
+{
+ ide_drive_t *drive = to_ide_device(dev);
+ ide_driver_t *drv = to_ide_driver(dev->driver);
+
+ if (drv->remove)
+ drv->remove(drive);
+
+ return 0;
+}
+
+static void generic_ide_shutdown(struct device *dev)
+{
+ ide_drive_t *drive = to_ide_device(dev);
+ ide_driver_t *drv = to_ide_driver(dev->driver);
+
+ if (dev->driver && drv->shutdown)
+ drv->shutdown(drive);
+}
+
struct bus_type ide_bus_type = {
.name = "ide",
.match = ide_bus_match,
.uevent = ide_uevent,
+ .probe = generic_ide_probe,
+ .remove = generic_ide_remove,
+ .shutdown = generic_ide_shutdown,
.dev_attrs = ide_dev_attrs,
.suspend = generic_ide_suspend,
.resume = generic_ide_resume,
diff --git a/include/linux/ide.h b/include/linux/ide.h
index f2e1b5b..110b3cf 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -983,8 +983,13 @@ typedef struct ide_driver_s {
ide_startstop_t (*abort)(ide_drive_t *, struct request *rq);
ide_proc_entry_t *proc;
struct device_driver gen_driver;
+ int (*probe)(ide_drive_t *);
+ void (*remove)(ide_drive_t *);
+ void (*shutdown)(ide_drive_t *);
} ide_driver_t;
+#define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver)
+
int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long);
/*
[PATCH] Add mmc_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 4d0b653cdfde193944784c01fa3359b0a444dcf1
tree d3f359a72bd4df788277c2bf518809ff184be058
parent 413b486e18587fd53c9954252e6648f9450c734e
author Russell King <[email protected]> Thu, 05 Jan 2006 14:40:27 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:08 -0800
drivers/mmc/mmc_sysfs.c | 26 ++++++++++++--------------
1 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/drivers/mmc/mmc_sysfs.c b/drivers/mmc/mmc_sysfs.c
index ec70166..a2a35fd 100644
--- a/drivers/mmc/mmc_sysfs.c
+++ b/drivers/mmc/mmc_sysfs.c
@@ -136,17 +136,7 @@ static int mmc_bus_resume(struct device
return ret;
}
-static struct bus_type mmc_bus_type = {
- .name = "mmc",
- .dev_attrs = mmc_dev_attrs,
- .match = mmc_bus_match,
- .uevent = mmc_bus_uevent,
- .suspend = mmc_bus_suspend,
- .resume = mmc_bus_resume,
-};
-
-
-static int mmc_drv_probe(struct device *dev)
+static int mmc_bus_probe(struct device *dev)
{
struct mmc_driver *drv = to_mmc_driver(dev->driver);
struct mmc_card *card = dev_to_mmc_card(dev);
@@ -154,7 +144,7 @@ static int mmc_drv_probe(struct device *
return drv->probe(card);
}
-static int mmc_drv_remove(struct device *dev)
+static int mmc_bus_remove(struct device *dev)
{
struct mmc_driver *drv = to_mmc_driver(dev->driver);
struct mmc_card *card = dev_to_mmc_card(dev);
@@ -164,6 +154,16 @@ static int mmc_drv_remove(struct device
return 0;
}
+static struct bus_type mmc_bus_type = {
+ .name = "mmc",
+ .dev_attrs = mmc_dev_attrs,
+ .match = mmc_bus_match,
+ .uevent = mmc_bus_uevent,
+ .probe = mmc_bus_probe,
+ .remove = mmc_bus_remove,
+ .suspend = mmc_bus_suspend,
+ .resume = mmc_bus_resume,
+};
/**
* mmc_register_driver - register a media driver
@@ -172,8 +172,6 @@ static int mmc_drv_remove(struct device
int mmc_register_driver(struct mmc_driver *drv)
{
drv->drv.bus = &mmc_bus_type;
- drv->drv.probe = mmc_drv_probe;
- drv->drv.remove = mmc_drv_remove;
return driver_register(&drv->drv);
}
[PATCH] Add macio_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Acked-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 4866b124a1ded3b94b0cea0bd543f46ffa9a3943
tree 5b9bcc0a631e34db71dbb2e3856a8bc3e5a07e07
parent 30226f8199cb7f5ace767f65bcebb85941612dfc
author Russell King <[email protected]> Thu, 05 Jan 2006 14:39:24 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:08 -0800
drivers/macintosh/macio_asic.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index 2a545ce..ed6d317 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -211,6 +211,9 @@ struct bus_type macio_bus_type = {
.name = "macio",
.match = macio_bus_match,
.uevent = macio_uevent,
+ .probe = macio_device_probe,
+ .remove = macio_device_remove,
+ .shutdown = macio_device_shutdown,
.suspend = macio_device_suspend,
.resume = macio_device_resume,
.dev_attrs = macio_dev_attrs,
@@ -528,9 +531,6 @@ int macio_register_driver(struct macio_d
/* initialize common driver fields */
drv->driver.name = drv->name;
drv->driver.bus = &macio_bus_type;
- drv->driver.probe = macio_device_probe;
- drv->driver.remove = macio_device_remove;
- drv->driver.shutdown = macio_device_shutdown;
/* register with core */
count = driver_register(&drv->driver);
[PATCH] Add usb_serial_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit ac33bc3d54936d364c1f979e50f43dfa3f9a13c1
tree 22ea930b8b2a642d0e6efeaa069a111a0b16d0a6
parent ff2dae79773658eaaab731663ddca9f7975430eb
author Russell King <[email protected]> Thu, 05 Jan 2006 14:43:11 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:09 -0800
drivers/usb/serial/bus.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
index 664139a..e9f9f4b 100644
--- a/drivers/usb/serial/bus.c
+++ b/drivers/usb/serial/bus.c
@@ -37,11 +37,6 @@ static int usb_serial_device_match (stru
return 0;
}
-struct bus_type usb_serial_bus_type = {
- .name = "usb-serial",
- .match = usb_serial_device_match,
-};
-
static int usb_serial_device_probe (struct device *dev)
{
struct usb_serial_driver *driver;
@@ -109,14 +104,18 @@ exit:
return retval;
}
+struct bus_type usb_serial_bus_type = {
+ .name = "usb-serial",
+ .match = usb_serial_device_match,
+ .probe = usb_serial_device_probe,
+ .remove = usb_serial_device_remove,
+};
+
int usb_serial_bus_register(struct usb_serial_driver *driver)
{
int retval;
driver->driver.bus = &usb_serial_bus_type;
- driver->driver.probe = usb_serial_device_probe;
- driver->driver.remove = usb_serial_device_remove;
-
retval = driver_register(&driver->driver);
return retval;
[PATCH] Add parisc_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Acked-by: Matthew Wilcox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit ad3ed31c682d956d2187e562635c55c8c74c1021
tree b050cef6a5f686f9cf2b9b16cbf63c7387053da3
parent 83dfb8b67522f6cf1fc5771a8be0a9095eea65d4
author Russell King <[email protected]> Thu, 05 Jan 2006 14:34:38 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:06 -0800
arch/parisc/kernel/drivers.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index 1eaa0d3..2d804e2 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -173,8 +173,6 @@ int register_parisc_driver(struct parisc
WARN_ON(driver->drv.probe != NULL);
WARN_ON(driver->drv.remove != NULL);
- driver->drv.probe = parisc_driver_probe;
- driver->drv.remove = parisc_driver_remove;
driver->drv.name = driver->name;
return driver_register(&driver->drv);
@@ -575,6 +573,8 @@ struct bus_type parisc_bus_type = {
.name = "parisc",
.match = parisc_generic_match,
.dev_attrs = parisc_device_attrs,
+ .probe = parisc_driver_probe,
+ .remove = parisc_driver_remove,
};
/**
[PATCH] Add pnp_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 4681fc320889de4591f945c4fdf08546eb9ab266
tree 84da79632be2925c68eed99636c184f8342d270e
parent 1d0baa3a1c836f0403b318d549fd49ebc73ee631
author Russell King <[email protected]> Thu, 05 Jan 2006 14:41:37 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:09 -0800
drivers/pnp/driver.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index 15fb758..7cafacd 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -195,6 +195,8 @@ static int pnp_bus_resume(struct device
struct bus_type pnp_bus_type = {
.name = "pnp",
.match = pnp_bus_match,
+ .probe = pnp_device_probe,
+ .remove = pnp_device_remove,
.suspend = pnp_bus_suspend,
.resume = pnp_bus_resume,
};
@@ -215,8 +217,6 @@ int pnp_register_driver(struct pnp_drive
drv->driver.name = drv->name;
drv->driver.bus = &pnp_bus_type;
- drv->driver.probe = pnp_device_probe;
- drv->driver.remove = pnp_device_remove;
count = driver_register(&drv->driver);
[PATCH] Add dio_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 5b34bf88779fa965a134b92ab61688e0d1ddfe1d
tree bf3387d7cc4d8880894d8884baf9f3e318e1e26e
parent 2f53a80fc0f6287d4bd6cc2422cd095c90f30410
author Russell King <[email protected]> Thu, 05 Jan 2006 14:37:18 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:07 -0800
drivers/dio/dio-driver.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dio/dio-driver.c b/drivers/dio/dio-driver.c
index ffe6f44..ca8e69d 100644
--- a/drivers/dio/dio-driver.c
+++ b/drivers/dio/dio-driver.c
@@ -83,7 +83,6 @@ int dio_register_driver(struct dio_drive
/* initialize common driver fields */
drv->driver.name = drv->name;
drv->driver.bus = &dio_bus_type;
- drv->driver.probe = dio_device_probe;
/* register with core */
count = driver_register(&drv->driver);
@@ -145,7 +144,8 @@ static int dio_bus_match(struct device *
struct bus_type dio_bus_type = {
.name = "dio",
- .match = dio_bus_match
+ .match = dio_bus_match,
+ .probe = dio_device_probe,
};
[PATCH] Add Pseudo LLD bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit bbbe3a41f7ee529f7f4fdcc1bc1157234bac0766
tree a1915bb813d98f68d231d19e762c57d6ddd52e5e
parent fc3d3ddd3e628d9f22d4aa56a640d0b31c977a8f
author Russell King <[email protected]> Thu, 05 Jan 2006 14:44:46 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:10 -0800
drivers/scsi/scsi_debug.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 3ded9da..0e529f8 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -221,8 +221,6 @@ static struct bus_type pseudo_lld_bus;
static struct device_driver sdebug_driverfs_driver = {
.name = sdebug_proc_name,
.bus = &pseudo_lld_bus,
- .probe = sdebug_driver_probe,
- .remove = sdebug_driver_remove,
};
static const int check_condition_result =
@@ -1796,6 +1794,8 @@ static int pseudo_lld_bus_match(struct d
static struct bus_type pseudo_lld_bus = {
.name = "pseudo",
.match = pseudo_lld_bus_match,
+ .probe = sdebug_driver_probe,
+ .remove = sdebug_driver_remove,
};
static void sdebug_release_adapter(struct device * dev)
[PATCH] Add SA1111 bus_type probe/remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 2876ba4321f0f85c40726b736eeaadf317803f16
tree bff3510763543ff92b613810347c34fcf7b4bdb7
parent e08b754161d6de4f91e2d3c805f350b35a95d8b8
author Russell King <[email protected]> Thu, 05 Jan 2006 14:32:32 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:05 -0800
arch/arm/common/sa1111.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index d0d6e6d..1475089 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -1247,14 +1247,14 @@ static int sa1111_bus_remove(struct devi
struct bus_type sa1111_bus_type = {
.name = "sa1111-rab",
.match = sa1111_match,
+ .probe = sa1111_bus_probe,
+ .remove = sa1111_bus_remove,
.suspend = sa1111_bus_suspend,
.resume = sa1111_bus_resume,
};
int sa1111_driver_register(struct sa1111_driver *driver)
{
- driver->drv.probe = sa1111_bus_probe;
- driver->drv.remove = sa1111_bus_remove;
driver->drv.bus = &sa1111_bus_type;
return driver_register(&driver->drv);
}
[PATCH] Add pcmcia_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 1d0baa3a1c836f0403b318d549fd49ebc73ee631
tree 22a59c7e5840c035f79703419bdb25fde180ce2a
parent 4d0b653cdfde193944784c01fa3359b0a444dcf1
author Russell King <[email protected]> Thu, 05 Jan 2006 14:40:58 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:08 -0800
drivers/pcmcia/ds.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 621ec45..0a424a4 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -311,8 +311,6 @@ int pcmcia_register_driver(struct pcmcia
/* initialize common fields */
driver->drv.bus = &pcmcia_bus_type;
driver->drv.owner = driver->owner;
- driver->drv.probe = pcmcia_device_probe;
- driver->drv.remove = pcmcia_device_remove;
return driver_register(&driver->drv);
}
@@ -1200,6 +1198,8 @@ struct bus_type pcmcia_bus_type = {
.uevent = pcmcia_bus_uevent,
.match = pcmcia_bus_match,
.dev_attrs = pcmcia_dev_attrs,
+ .probe = pcmcia_device_probe,
+ .remove = pcmcia_device_remove,
.suspend = pcmcia_dev_suspend,
.resume = pcmcia_dev_resume,
};
[PATCH] Add sh_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit c6a09196bab3bc9e515b713193d61e3e87c720f7
tree 17636bb7c0c0d9cb01868a2d9bdbd56df25c0855
parent 91fb53866d00b4eaeaf1cbfd2237799cb152f742
author Russell King <[email protected]> Thu, 05 Jan 2006 14:35:42 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:06 -0800
arch/sh/kernel/cpu/bus.c | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/arch/sh/kernel/cpu/bus.c b/arch/sh/kernel/cpu/bus.c
index d4fee2a..3278d23 100644
--- a/arch/sh/kernel/cpu/bus.c
+++ b/arch/sh/kernel/cpu/bus.c
@@ -53,21 +53,6 @@ static int sh_bus_resume(struct device *
return 0;
}
-static struct device sh_bus_devices[SH_NR_BUSES] = {
- {
- .bus_id = SH_BUS_NAME_VIRT,
- },
-};
-
-struct bus_type sh_bus_types[SH_NR_BUSES] = {
- {
- .name = SH_BUS_NAME_VIRT,
- .match = sh_bus_match,
- .suspend = sh_bus_suspend,
- .resume = sh_bus_resume,
- },
-};
-
static int sh_device_probe(struct device *dev)
{
struct sh_dev *shdev = to_sh_dev(dev);
@@ -90,6 +75,23 @@ static int sh_device_remove(struct devic
return 0;
}
+static struct device sh_bus_devices[SH_NR_BUSES] = {
+ {
+ .bus_id = SH_BUS_NAME_VIRT,
+ },
+};
+
+struct bus_type sh_bus_types[SH_NR_BUSES] = {
+ {
+ .name = SH_BUS_NAME_VIRT,
+ .match = sh_bus_match,
+ .probe = sh_bus_probe,
+ .remove = sh_bus_remove,
+ .suspend = sh_bus_suspend,
+ .resume = sh_bus_resume,
+ },
+};
+
int sh_device_register(struct sh_dev *dev)
{
if (!dev)
@@ -133,8 +135,6 @@ int sh_driver_register(struct sh_driver
return -EINVAL;
}
- drv->drv.probe = sh_device_probe;
- drv->drv.remove = sh_device_remove;
drv->drv.bus = &sh_bus_types[drv->bus_id];
return driver_register(&drv->drv);
[PATCH] Add locomo bus_type probe/remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Richard Purdie <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 306955be37dd1b1f232f19766227ccccb83f7873
tree 580a152ea67887e0754419afd7868fb22403d6ad
parent 2876ba4321f0f85c40726b736eeaadf317803f16
author Russell King <[email protected]> Thu, 05 Jan 2006 14:33:04 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:05 -0800
arch/arm/common/locomo.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index 1b7eaab..159ad7e 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -1103,14 +1103,14 @@ static int locomo_bus_remove(struct devi
struct bus_type locomo_bus_type = {
.name = "locomo-bus",
.match = locomo_match,
+ .probe = locomo_bus_probe,
+ .remove = locomo_bus_remove,
.suspend = locomo_bus_suspend,
.resume = locomo_bus_resume,
};
int locomo_driver_register(struct locomo_driver *driver)
{
- driver->drv.probe = locomo_bus_probe;
- driver->drv.remove = locomo_bus_remove;
driver->drv.bus = &locomo_bus_type;
return driver_register(&driver->drv);
}
[PATCH] Add bttv sub bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 348290a4ae143a692124330942b464ccdb0d0365
tree 1fae9909d4d4519c9548b5940be2dca7e31935c2
parent d78967fb035aeb839a047ae69ce5f1ff39288a8d
author Russell King <[email protected]> Fri, 06 Jan 2006 11:42:03 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:11 -0800
drivers/media/dvb/bt8xx/dvb-bt8xx.c | 23 +++++++++++------------
drivers/media/video/bttv-gpio.c | 24 ++++++++++++++++++++++--
drivers/media/video/bttv.h | 2 ++
3 files changed, 35 insertions(+), 14 deletions(-)
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index f65f64b..44fcbe7 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -779,9 +779,8 @@ static int __init dvb_bt8xx_load_card(st
return 0;
}
-static int dvb_bt8xx_probe(struct device *dev)
+static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
{
- struct bttv_sub_device *sub = to_bttv_sub_dev(dev);
struct dvb_bt8xx_card *card;
struct pci_dev* bttv_pci_dev;
int ret;
@@ -890,13 +889,13 @@ static int dvb_bt8xx_probe(struct device
return ret;
}
- dev_set_drvdata(dev, card);
+ dev_set_drvdata(&sub->dev, card);
return 0;
}
-static int dvb_bt8xx_remove(struct device *dev)
+static int dvb_bt8xx_remove(struct bttv_sub_device *sub)
{
- struct dvb_bt8xx_card *card = dev_get_drvdata(dev);
+ struct dvb_bt8xx_card *card = dev_get_drvdata(&sub->dev);
dprintk("dvb_bt8xx: unloading card%d\n", card->bttv_nr);
@@ -919,14 +918,14 @@ static int dvb_bt8xx_remove(struct devic
static struct bttv_sub_driver driver = {
.drv = {
.name = "dvb-bt8xx",
- .probe = dvb_bt8xx_probe,
- .remove = dvb_bt8xx_remove,
- /* FIXME:
- * .shutdown = dvb_bt8xx_shutdown,
- * .suspend = dvb_bt8xx_suspend,
- * .resume = dvb_bt8xx_resume,
- */
},
+ .probe = dvb_bt8xx_probe,
+ .remove = dvb_bt8xx_remove,
+ /* FIXME:
+ * .shutdown = dvb_bt8xx_shutdown,
+ * .suspend = dvb_bt8xx_suspend,
+ * .resume = dvb_bt8xx_resume,
+ */
};
static int __init dvb_bt8xx_init(void)
diff --git a/drivers/media/video/bttv-gpio.c b/drivers/media/video/bttv-gpio.c
index d64accc..c4d5e2b 100644
--- a/drivers/media/video/bttv-gpio.c
+++ b/drivers/media/video/bttv-gpio.c
@@ -47,9 +47,29 @@ static int bttv_sub_bus_match(struct dev
return 0;
}
+static int bttv_sub_probe(struct device *dev)
+{
+ struct bttv_sub_device *sdev = to_bttv_sub_dev(dev);
+ struct bttv_sub_driver *sub = to_bttv_sub_drv(dev->driver);
+
+ return sub->probe ? sub->probe(sdev) : -ENODEV;
+}
+
+static int bttv_sub_remove(struct device *dev)
+{
+ struct bttv_sub_device *sdev = to_bttv_sub_dev(dev);
+ struct bttv_sub_driver *sub = to_bttv_sub_drv(dev->driver);
+
+ if (sub->remove)
+ sub->remove(sdev);
+ return 0;
+}
+
struct bus_type bttv_sub_bus_type = {
- .name = "bttv-sub",
- .match = &bttv_sub_bus_match,
+ .name = "bttv-sub",
+ .match = &bttv_sub_bus_match,
+ .probe = bttv_sub_probe,
+ .remove = bttv_sub_remove,
};
EXPORT_SYMBOL(bttv_sub_bus_type);
diff --git a/drivers/media/video/bttv.h b/drivers/media/video/bttv.h
index e370d74..9908c8e 100644
--- a/drivers/media/video/bttv.h
+++ b/drivers/media/video/bttv.h
@@ -365,6 +365,8 @@ struct bttv_sub_device {
struct bttv_sub_driver {
struct device_driver drv;
char wanted[BUS_ID_SIZE];
+ int (*probe)(struct bttv_sub_device *sub);
+ void (*remove)(struct bttv_sub_device *sub);
void (*gpio_irq)(struct bttv_sub_device *sub);
};
#define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv)
[PATCH] Add superhyway_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit ff2dae79773658eaaab731663ddca9f7975430eb
tree c27859a56e87dbddd041a787dfad0e6d4507680e
parent f9ccf4569ac4597e9e09d301ca362d90b4a1046d
author Russell King <[email protected]> Thu, 05 Jan 2006 14:42:40 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:09 -0800
drivers/sh/superhyway/superhyway.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/sh/superhyway/superhyway.c b/drivers/sh/superhyway/superhyway.c
index 7bdab2a..94b2290 100644
--- a/drivers/sh/superhyway/superhyway.c
+++ b/drivers/sh/superhyway/superhyway.c
@@ -175,8 +175,6 @@ int superhyway_register_driver(struct su
{
drv->drv.name = drv->name;
drv->drv.bus = &superhyway_bus_type;
- drv->drv.probe = superhyway_device_probe;
- drv->drv.remove = superhyway_device_remove;
return driver_register(&drv->drv);
}
@@ -213,6 +211,8 @@ struct bus_type superhyway_bus_type = {
#ifdef CONFIG_SYSFS
.dev_attrs = superhyway_dev_attrs,
#endif
+ .probe = superhyway_device_probe,
+ .remove = superhyway_device_remove,
};
static int __init superhyway_bus_init(void)
[PATCH] Add zorro_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit b6a01e9bda69aaf22f3a23bafc91c0fb51420a7a
tree f98effb1d882d8d2648a989e3a6bd72d853bdb16
parent ac33bc3d54936d364c1f979e50f43dfa3f9a13c1
author Russell King <[email protected]> Thu, 05 Jan 2006 14:43:43 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:10 -0800
drivers/zorro/zorro-driver.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/zorro/zorro-driver.c b/drivers/zorro/zorro-driver.c
index ccba227..fcbee74 100644
--- a/drivers/zorro/zorro-driver.c
+++ b/drivers/zorro/zorro-driver.c
@@ -77,7 +77,6 @@ int zorro_register_driver(struct zorro_d
/* initialize common driver fields */
drv->driver.name = drv->name;
drv->driver.bus = &zorro_bus_type;
- drv->driver.probe = zorro_device_probe;
/* register with core */
count = driver_register(&drv->driver);
@@ -132,7 +131,8 @@ static int zorro_bus_match(struct device
struct bus_type zorro_bus_type = {
.name = "zorro",
- .match = zorro_bus_match
+ .match = zorro_bus_match,
+ .probe = zorro_device_probe,
};
[PATCH] Add serio bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit 30226f8199cb7f5ace767f65bcebb85941612dfc
tree 8155e420d407bf831aa6aa838328a5a2fbfe3ee0
parent 29a4a20e9fe7459f9d464b8be070ce8b7335be7e
author Russell King <[email protected]> Thu, 05 Jan 2006 14:38:53 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:07 -0800
drivers/input/serio/serio.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 8e530cc..2f76813 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -59,9 +59,7 @@ static DECLARE_MUTEX(serio_sem);
static LIST_HEAD(serio_list);
-static struct bus_type serio_bus = {
- .name = "serio",
-};
+static struct bus_type serio_bus;
static void serio_add_port(struct serio *serio);
static void serio_destroy_port(struct serio *serio);
@@ -750,11 +748,15 @@ static int serio_driver_remove(struct de
return 0;
}
+static struct bus_type serio_bus = {
+ .name = "serio",
+ .probe = serio_driver_probe,
+ .remove = serio_driver_remove,
+};
+
void __serio_register_driver(struct serio_driver *drv, struct module *owner)
{
drv->driver.bus = &serio_bus;
- drv->driver.probe = serio_driver_probe;
- drv->driver.remove = serio_driver_remove;
serio_queue_event(drv, owner, SERIO_REGISTER_DRIVER);
}
[PATCH] Add ccwgroup_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit f9ccf4569ac4597e9e09d301ca362d90b4a1046d
tree 67a3eaf663e26e9b6b6625fbc1114237db28f43c
parent 4681fc320889de4591f945c4fdf08546eb9ab266
author Russell King <[email protected]> Thu, 05 Jan 2006 14:42:09 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:09 -0800
drivers/s390/cio/ccwgroup.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index e849289..503a568 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -52,11 +52,7 @@ ccwgroup_uevent (struct device *dev, cha
return 0;
}
-static struct bus_type ccwgroup_bus_type = {
- .name = "ccwgroup",
- .match = ccwgroup_bus_match,
- .uevent = ccwgroup_uevent,
-};
+static struct bus_type ccwgroup_bus_type;
static inline void
__ccwgroup_remove_symlinks(struct ccwgroup_device *gdev)
@@ -389,6 +385,14 @@ ccwgroup_remove (struct device *dev)
return 0;
}
+static struct bus_type ccwgroup_bus_type = {
+ .name = "ccwgroup",
+ .match = ccwgroup_bus_match,
+ .uevent = ccwgroup_uevent,
+ .probe = ccwgroup_probe,
+ .remove = ccwgroup_remove,
+};
+
int
ccwgroup_driver_register (struct ccwgroup_driver *cdriver)
{
@@ -396,8 +400,6 @@ ccwgroup_driver_register (struct ccwgrou
cdriver->driver = (struct device_driver) {
.bus = &ccwgroup_bus_type,
.name = cdriver->name,
- .probe = ccwgroup_probe,
- .remove = ccwgroup_remove,
};
return driver_register(&cdriver->driver);
[PATCH] Add i2c_bus_type probe and remove methods
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
commit b864c7d5d17c171c4ead0791b44ab05d7a21dc0c
tree f9822f71b07920f819c3282084fa2831fc6d7458
parent 5b34bf88779fa965a134b92ab61688e0d1ddfe1d
author Russell King <[email protected]> Thu, 05 Jan 2006 14:37:50 +0000
committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:07 -0800
drivers/i2c/i2c-core.c | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 52b7747..0ce58b5 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -63,13 +63,6 @@ static int i2c_bus_resume(struct device
return rc;
}
-struct bus_type i2c_bus_type = {
- .name = "i2c",
- .match = i2c_device_match,
- .suspend = i2c_bus_suspend,
- .resume = i2c_bus_resume,
-};
-
static int i2c_device_probe(struct device *dev)
{
return -ENODEV;
@@ -80,6 +73,15 @@ static int i2c_device_remove(struct devi
return 0;
}
+struct bus_type i2c_bus_type = {
+ .name = "i2c",
+ .match = i2c_device_match,
+ .probe = i2c_device_probe,
+ .remove = i2c_device_remove,
+ .suspend = i2c_bus_suspend,
+ .resume = i2c_bus_resume,
+};
+
void i2c_adapter_dev_release(struct device *dev)
{
struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
@@ -90,8 +92,6 @@ struct device_driver i2c_adapter_driver
.owner = THIS_MODULE,
.name = "i2c_adapter",
.bus = &i2c_bus_type,
- .probe = i2c_device_probe,
- .remove = i2c_device_remove,
};
static void i2c_adapter_class_dev_release(struct class_device *dev)
@@ -294,8 +294,6 @@ int i2c_register_driver(struct module *o
/* add the driver to the list of i2c drivers in the driver core */
driver->driver.owner = owner;
driver->driver.bus = &i2c_bus_type;
- driver->driver.probe = i2c_device_probe;
- driver->driver.remove = i2c_device_remove;
res = driver_register(&driver->driver);
if (res)
please fix ide-scsi.c (should be trivial)
On 1/13/06, Greg KH <[email protected]> wrote:
> [PATCH] Add ide_bus_type probe and remove methods
>
> Signed-off-by: Russell King <[email protected]>
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
>
> ---
> commit 4031bbe4bbec6c0fe50412ef7fb43a270b0f29f1
> tree 1e1449ba492ab04d8c5fbc75f9761be237bcae72
> parent bbbe3a41f7ee529f7f4fdcc1bc1157234bac0766
> author Russell King <[email protected]> Fri, 06 Jan 2006 11:41:00 +0000
> committer Greg Kroah-Hartman <[email protected]> Fri, 13 Jan 2006 11:26:10 -0800
>
> 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 +++++++++++++++++++++++++++++++
> include/linux/ide.h | 5 +++++
> 6 files changed, 61 insertions(+), 43 deletions(-)
Greg KH wrote:
> [PATCH] INPUT: add MODALIAS to the event environment
>
> input: add MODALIAS to the event environment
Could you please tell me sample modaliases for a number of "common"
devices (like a PS/2 mouse)?
I ask because earlier (namely, in
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/old/gregkh-all-2.6.15.patch)
such modaliases contained commas (",") and comma is not a "trusted"
character in Udev (see replace_untrusted_chars() in
udev_utils_string.c). Thus, such modaliases were mangled and didn't work.
--
Alexander E. Patrakov
On Sat, Jan 14, 2006 at 10:14:00AM +0500, Alexander E. Patrakov wrote:
> Greg KH wrote:
> >[PATCH] INPUT: add MODALIAS to the event environment
> >
> >input: add MODALIAS to the event environment
>
> Could you please tell me sample modaliases for a number of "common"
> devices (like a PS/2 mouse)?
>
> I ask because earlier (namely, in
> http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/old/gregkh-all-2.6.15.patch)
> such modaliases contained commas (",") and comma is not a "trusted"
> character in Udev (see replace_untrusted_chars() in udev_utils_string.c).
> Thus, such modaliases were mangled and didn't work.
Only if you read it with $sysfs{modalias}, it's available in $env{MODALIAS}
and does not get mangled there, right? If you have problems with that,
let us know and we will fix it.
(We can't trust the values of some sysfs files to be passed to external
programs or directly used to create a device node name, cause some of
them are directly copied from a device property.)
Thanks,
Kay
Kay Sievers wrote:
>On Sat, Jan 14, 2006 at 10:14:00AM +0500, Alexander E. Patrakov wrote:
>
>
>>Greg KH wrote:
>>
>>
>>>[PATCH] INPUT: add MODALIAS to the event environment
>>>
>>>input: add MODALIAS to the event environment
>>>
>>>
>>Could you please tell me sample modaliases for a number of "common"
>>devices (like a PS/2 mouse)?
>>
>>I ask because earlier (namely, in
>>http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/old/gregkh-all-2.6.15.patch)
>>such modaliases contained commas (",") and comma is not a "trusted"
>>character in Udev (see replace_untrusted_chars() in udev_utils_string.c).
>>Thus, such modaliases were mangled and didn't work.
>>
>>
>
>Only if you read it with $sysfs{modalias}, it's available in $env{MODALIAS}
>and does not get mangled there, right? If you have problems with that,
>let us know and we will fix it.
>
>
With the old gregkh-all-2.6.15.patch, I have:
sh-3.1# cat /sys/class/input/input1/modalias
input:b0011v0002p0004e0000-e0,1,2,k110,111,112,113,114,r0,1,8,amlsfw
sh-3.1# echo "add" >/sys/class/input/input1/uevent
sh-3.1# cat /events/1663
PHYSDEVPATH=/devices/platform/i8042/serio0
EV=7
SUBSYSTEM=input
DEVPATH=/class/input/input1
NAME="GenPS/2 Genius <NULL>"
ACTION=add
PWD=/
UDEV_LOG=7
REL=103
KEY=1f0000 0 0 0 0 0 0 0 0
UDEVD_EVENT=1
SHLVL=1
PHYSDEVDRIVER=psmouse
PHYS="isa0060/serio1/input0"
PRODUCT=11/2/4/0
PHYSDEVBUS=serio
SEQNUM=1663
_=/usr/bin/env
i.e., there is the "modalias" file in sysfs but no $MODALIAS in the
environment. Is this the problem that your patch solves (note: I haven't
tried it yet)?
--
Alexander E. Patrakov
On Sat, Jan 14, 2006 at 06:15:14PM +0500, Alexander E. Patrakov wrote:
> Kay Sievers wrote:
> >On Sat, Jan 14, 2006 at 10:14:00AM +0500, Alexander E. Patrakov wrote:
> >>Greg KH wrote:
> >>
> >>>[PATCH] INPUT: add MODALIAS to the event environment
> >>>
> >>>input: add MODALIAS to the event environment
> >>>
> >>Could you please tell me sample modaliases for a number of "common"
> >>devices (like a PS/2 mouse)?
> >>
> >>I ask because earlier (namely, in
> >>http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/old/gregkh-all-2.6.15.patch)
> >>such modaliases contained commas (",") and comma is not a "trusted"
> >>character in Udev (see replace_untrusted_chars() in udev_utils_string.c).
> >>Thus, such modaliases were mangled and didn't work.
> >
> >Only if you read it with $sysfs{modalias}, it's available in $env{MODALIAS}
> >and does not get mangled there, right? If you have problems with that,
> >let us know and we will fix it.
> >
> >
> With the old gregkh-all-2.6.15.patch, I have:
>
> sh-3.1# cat /sys/class/input/input1/modalias
> input:b0011v0002p0004e0000-e0,1,2,k110,111,112,113,114,r0,1,8,amlsfw
> i.e., there is the "modalias" file in sysfs but no $MODALIAS in the
> environment. Is this the problem that your patch solves (note: I haven't
> tried it yet)?
Well, you could have read the mail's subject, before posting.
Kay
Kay Sievers wrote:
>On Sat, Jan 14, 2006 at 06:15:14PM +0500, Alexander E. Patrakov wrote:
>
>
>>i.e., there is the "modalias" file in sysfs but no $MODALIAS in the
>>environment. Is this the problem that your patch solves (note: I haven't
>>tried it yet)?
>>
>>
>
>Well, you could have read the mail's subject, before posting.
>
>
Indeed, sorry.
I have applied your patch on top of gregkh-all-2.6.15.patch and changed
my module-loading udev rule to:
ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"
Now this works and loads modules for my PS/2 mouse. Thanks for the patch.
--
Alexander E. Patrakov
On Sat, Jan 14, 2006 at 06:42:47PM +0500, Alexander E. Patrakov wrote:
> Kay Sievers wrote:
> >On Sat, Jan 14, 2006 at 06:15:14PM +0500, Alexander E. Patrakov wrote:
> >
> >>i.e., there is the "modalias" file in sysfs but no $MODALIAS in the
> >>environment. Is this the problem that your patch solves (note: I haven't
> >>tried it yet)?
> >
> >Well, you could have read the mail's subject, before posting.
> >
> Indeed, sorry.
>
> I have applied your patch on top of gregkh-all-2.6.15.patch and changed
> my module-loading udev rule to:
>
> ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"
>
> Now this works and loads modules for my PS/2 mouse. Thanks for the patch.
Great, thanks for testing it. Do you have any subsystem left, that could
support modalias, but doesn't?
Thanks,
Kay
Kay Sievers wrote:
>Do you have any subsystem left, that could
>support modalias, but doesn't?
>
>
Probably not. On my system, udev loads every module it should.
--
Alexander E. Patrakov
On Fri, Jan 13, 2006 at 09:06:24PM +0100, Bartlomiej Zolnierkiewicz wrote:
> please fix ide-scsi.c (should be trivial)
Updated patch attached. However, unable to even build-test since ide-scsi
is already broken:
drivers/scsi/ide-scsi.c: In function `idescsi_eh_reset':
drivers/scsi/ide-scsi.c:1046: error: too few arguments to function `end_that_request_last'
drivers/scsi/ide-scsi.c:1056: error: too few arguments to function `end_that_request_last'
Signed-off-by: Russell King <[email protected]>
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -3256,9 +3256,8 @@ sector_t ide_cdrom_capacity (ide_drive_t
}
#endif
-static int ide_cd_remove(struct device *dev)
+static void ide_cd_remove(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
struct cdrom_info *info = drive->driver_data;
ide_unregister_subdriver(drive, info->driver);
@@ -3266,8 +3265,6 @@ static int ide_cd_remove(struct device *
del_gendisk(info->disk);
ide_cd_put(info);
-
- return 0;
}
static void ide_cd_release(struct kref *kref)
@@ -3291,7 +3288,7 @@ static void ide_cd_release(struct kref *
kfree(info);
}
-static int ide_cd_probe(struct device *);
+static int ide_cd_probe(ide_drive_t *);
#ifdef CONFIG_PROC_FS
static int proc_idecd_read_capacity
@@ -3317,9 +3314,9 @@ static ide_driver_t ide_cdrom_driver = {
.owner = THIS_MODULE,
.name = "ide-cdrom",
.bus = &ide_bus_type,
- .probe = ide_cd_probe,
- .remove = ide_cd_remove,
},
+ .probe = ide_cd_probe,
+ .remove = ide_cd_remove,
.version = IDECD_VERSION,
.media = ide_cdrom,
.supports_dsc_overlap = 1,
@@ -3413,9 +3410,8 @@ static char *ignore = NULL;
module_param(ignore, charp, 0400);
MODULE_DESCRIPTION("ATAPI CD-ROM Driver");
-static int ide_cd_probe(struct device *dev)
+static int ide_cd_probe(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
struct cdrom_info *info;
struct gendisk *g;
struct request_sense sense;
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -997,9 +997,8 @@ static void ide_cacheflush_p(ide_drive_t
printk(KERN_INFO "%s: wcache flush failed!\n", drive->name);
}
-static int ide_disk_remove(struct device *dev)
+static void ide_disk_remove(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
struct ide_disk_obj *idkp = drive->driver_data;
struct gendisk *g = idkp->disk;
@@ -1010,8 +1009,6 @@ static int ide_disk_remove(struct device
ide_cacheflush_p(drive);
ide_disk_put(idkp);
-
- return 0;
}
static void ide_disk_release(struct kref *kref)
@@ -1027,12 +1024,10 @@ static void ide_disk_release(struct kref
kfree(idkp);
}
-static int ide_disk_probe(struct device *dev);
+static int ide_disk_probe(ide_drive_t *drive);
-static void ide_device_shutdown(struct device *dev)
+static void ide_device_shutdown(ide_drive_t *drive)
{
- ide_drive_t *drive = container_of(dev, ide_drive_t, gendev);
-
#ifdef CONFIG_ALPHA
/* On Alpha, halt(8) doesn't actually turn the machine off,
it puts you into the sort of firmware monitor. Typically,
@@ -1054,7 +1049,7 @@ static void ide_device_shutdown(struct d
}
printk("Shutdown: %s\n", drive->name);
- dev->bus->suspend(dev, PMSG_SUSPEND);
+ drive->gendev.bus->suspend(&drive->gendev, PMSG_SUSPEND);
}
static ide_driver_t idedisk_driver = {
@@ -1062,10 +1057,10 @@ static ide_driver_t idedisk_driver = {
.owner = THIS_MODULE,
.name = "ide-disk",
.bus = &ide_bus_type,
- .probe = ide_disk_probe,
- .remove = ide_disk_remove,
- .shutdown = ide_device_shutdown,
},
+ .probe = ide_disk_probe,
+ .remove = ide_disk_remove,
+ .shutdown = ide_device_shutdown,
.version = IDEDISK_VERSION,
.media = ide_disk,
.supports_dsc_overlap = 0,
@@ -1182,9 +1177,8 @@ static struct block_device_operations id
MODULE_DESCRIPTION("ATA DISK Driver");
-static int ide_disk_probe(struct device *dev)
+static int ide_disk_probe(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
struct ide_disk_obj *idkp;
struct gendisk *g;
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -1871,9 +1871,8 @@ static void idefloppy_setup (ide_drive_t
idefloppy_add_settings(drive);
}
-static int ide_floppy_remove(struct device *dev)
+static void ide_floppy_remove(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
idefloppy_floppy_t *floppy = drive->driver_data;
struct gendisk *g = floppy->disk;
@@ -1882,8 +1881,6 @@ static int ide_floppy_remove(struct devi
del_gendisk(g);
ide_floppy_put(floppy);
-
- return 0;
}
static void ide_floppy_release(struct kref *kref)
@@ -1922,16 +1919,16 @@ static ide_proc_entry_t idefloppy_proc[]
#endif /* CONFIG_PROC_FS */
-static int ide_floppy_probe(struct device *);
+static int ide_floppy_probe(ide_drive_t *);
static ide_driver_t idefloppy_driver = {
.gen_driver = {
.owner = THIS_MODULE,
.name = "ide-floppy",
.bus = &ide_bus_type,
- .probe = ide_floppy_probe,
- .remove = ide_floppy_remove,
},
+ .probe = ide_floppy_probe,
+ .remove = ide_floppy_remove,
.version = IDEFLOPPY_VERSION,
.media = ide_floppy,
.supports_dsc_overlap = 0,
@@ -2136,9 +2133,8 @@ static struct block_device_operations id
.revalidate_disk= idefloppy_revalidate_disk
};
-static int ide_floppy_probe(struct device *dev)
+static int ide_floppy_probe(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
idefloppy_floppy_t *floppy;
struct gendisk *g;
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -4682,9 +4682,8 @@ static void idetape_setup (ide_drive_t *
idetape_add_settings(drive);
}
-static int ide_tape_remove(struct device *dev)
+static void ide_tape_remove(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
idetape_tape_t *tape = drive->driver_data;
ide_unregister_subdriver(drive, tape->driver);
@@ -4692,8 +4691,6 @@ static int ide_tape_remove(struct device
ide_unregister_region(tape->disk);
ide_tape_put(tape);
-
- return 0;
}
static void ide_tape_release(struct kref *kref)
@@ -4745,16 +4742,16 @@ static ide_proc_entry_t idetape_proc[] =
#endif
-static int ide_tape_probe(struct device *);
+static int ide_tape_probe(ide_drive_t *);
static ide_driver_t idetape_driver = {
.gen_driver = {
.owner = THIS_MODULE,
.name = "ide-tape",
.bus = &ide_bus_type,
- .probe = ide_tape_probe,
- .remove = ide_tape_remove,
},
+ .probe = ide_tape_probe,
+ .remove = ide_tape_remove,
.version = IDETAPE_VERSION,
.media = ide_tape,
.supports_dsc_overlap = 1,
@@ -4825,9 +4822,8 @@ static struct block_device_operations id
.ioctl = idetape_ioctl,
};
-static int ide_tape_probe(struct device *dev)
+static int ide_tape_probe(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
idetape_tape_t *tape;
struct gendisk *g;
int minor;
@@ -4883,9 +4879,9 @@ static int ide_tape_probe(struct device
idetape_setup(drive, tape, minor);
class_device_create(idetape_sysfs_class, NULL,
- MKDEV(IDETAPE_MAJOR, minor), dev, "%s", tape->name);
+ MKDEV(IDETAPE_MAJOR, minor), &drive->gendev, "%s", tape->name);
class_device_create(idetape_sysfs_class, NULL,
- MKDEV(IDETAPE_MAJOR, minor + 128), dev, "n%s", tape->name);
+ MKDEV(IDETAPE_MAJOR, minor + 128), &drive->gendev, "n%s", tape->name);
devfs_mk_cdev(MKDEV(HWIF(drive)->major, minor),
S_IFCHR | S_IRUGO | S_IWUGO,
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1949,10 +1949,41 @@ static int ide_bus_match(struct device *
return 0;
}
+static int generic_ide_probe(struct device *dev)
+{
+ ide_drive_t *drive = to_ide_device(dev);
+ ide_driver_t *drv = to_ide_driver(dev->driver);
+
+ return drv->probe ? drv->probe(drive) : -ENODEV;
+}
+
+static int generic_ide_remove(struct device *dev)
+{
+ ide_drive_t *drive = to_ide_device(dev);
+ ide_driver_t *drv = to_ide_driver(dev->driver);
+
+ if (drv->remove)
+ drv->remove(drive);
+
+ return 0;
+}
+
+static void generic_ide_shutdown(struct device *dev)
+{
+ ide_drive_t *drive = to_ide_device(dev);
+ ide_driver_t *drv = to_ide_driver(dev->driver);
+
+ if (dev->driver && drv->shutdown)
+ drv->shutdown(drive);
+}
+
struct bus_type ide_bus_type = {
.name = "ide",
.match = ide_bus_match,
.uevent = ide_uevent,
+ .probe = generic_ide_probe,
+ .remove = generic_ide_remove,
+ .shutdown = generic_ide_shutdown,
.dev_attrs = ide_dev_attrs,
.suspend = generic_ide_suspend,
.resume = generic_ide_resume,
diff --git a/include/linux/ide.h b/include/linux/ide.h
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -983,8 +983,13 @@ typedef struct ide_driver_s {
ide_startstop_t (*abort)(ide_drive_t *, struct request *rq);
ide_proc_entry_t *proc;
struct device_driver gen_driver;
+ int (*probe)(ide_drive_t *);
+ void (*remove)(ide_drive_t *);
+ void (*shutdown)(ide_drive_t *);
} ide_driver_t;
+#define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver)
+
int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long);
/*
diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x *.orig -x *.rej -x .git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
--- a/drivers/scsi/ide-scsi.c Fri Jan 6 22:26:06 2006
+++ b/drivers/scsi/ide-scsi.c Sat Jan 14 19:35:12 2006
@@ -751,9 +751,8 @@ static void idescsi_setup (ide_drive_t *
idescsi_add_settings(drive);
}
-static int ide_scsi_remove(struct device *dev)
+static void ide_scsi_remove(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
struct Scsi_Host *scsihost = drive->driver_data;
struct ide_scsi_obj *scsi = scsihost_to_idescsi(scsihost);
struct gendisk *g = scsi->disk;
@@ -768,11 +767,9 @@ static int ide_scsi_remove(struct device
scsi_remove_host(scsihost);
ide_scsi_put(scsi);
-
- return 0;
}
-static int ide_scsi_probe(struct device *);
+static int ide_scsi_probe(ide_drive_t *);
#ifdef CONFIG_PROC_FS
static ide_proc_entry_t idescsi_proc[] = {
@@ -788,9 +785,9 @@ static ide_driver_t idescsi_driver = {
.owner = THIS_MODULE,
.name = "ide-scsi",
.bus = &ide_bus_type,
- .probe = ide_scsi_probe,
- .remove = ide_scsi_remove,
},
+ .probe = ide_scsi_probe,
+ .remove = ide_scsi_remove,
.version = IDESCSI_VERSION,
.media = ide_scsi,
.supports_dsc_overlap = 0,
@@ -1046,7 +1043,7 @@ static int idescsi_eh_reset (struct scsi
/* kill current request */
blkdev_dequeue_request(req);
- end_that_request_last(req, 0);
+ end_that_request_last(req);
if (req->flags & REQ_SENSE)
kfree(scsi->pc->buffer);
kfree(scsi->pc);
@@ -1056,7 +1053,7 @@ static int idescsi_eh_reset (struct scsi
/* now nuke the drive queue */
while ((req = elv_next_request(drive->queue))) {
blkdev_dequeue_request(req);
- end_that_request_last(req, 0);
+ end_that_request_last(req);
}
HWGROUP(drive)->rq = NULL;
@@ -1119,9 +1116,8 @@ static struct scsi_host_template idescsi
.proc_name = "ide-scsi",
};
-static int ide_scsi_probe(struct device *dev)
+static int ide_scsi_probe(ide_drive_t *drive)
{
- ide_drive_t *drive = to_ide_device(dev);
idescsi_scsi_t *idescsi;
struct Scsi_Host *host;
struct gendisk *g;
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
On 1/14/06, Russell King <[email protected]> wrote:
> On Fri, Jan 13, 2006 at 09:06:24PM +0100, Bartlomiej Zolnierkiewicz wrote:
> > please fix ide-scsi.c (should be trivial)
>
> Updated patch attached. However, unable to even build-test since ide-scsi
> is already broken:
>
> drivers/scsi/ide-scsi.c: In function `idescsi_eh_reset':
> drivers/scsi/ide-scsi.c:1046: error: too few arguments to function `end_that_request_last'
> drivers/scsi/ide-scsi.c:1056: error: too few arguments to function `end_that_request_last'
Thanks, I will look into this.
On Saturday 14 January 2006 08:15, Alexander E. Patrakov wrote:
> NAME="GenPS/2 Genius <NULL>"
^^^^^ This is bad. It should say "GenPS/2
Genius Mouse". Please try the patch below. Thanks!
--
Dmitry
Signed-off-by: Dmitry Torokhov <[email protected]>
---
drivers/input/mouse/psmouse-base.c | 1 +
1 files changed, 1 insertion(+)
Index: work/drivers/input/mouse/psmouse-base.c
===================================================================
--- work.orig/drivers/input/mouse/psmouse-base.c
+++ work/drivers/input/mouse/psmouse-base.c
@@ -403,6 +403,7 @@ static int genius_detect(struct psmouse
set_bit(REL_WHEEL, psmouse->dev->relbit);
psmouse->vendor = "Genius";
+ psmouse->name = "Mouse";
psmouse->pktsize = 4;
}
On 1/14/06, Russell King <[email protected]> wrote:
> On Fri, Jan 13, 2006 at 09:06:24PM +0100, Bartlomiej Zolnierkiewicz wrote:
> > please fix ide-scsi.c (should be trivial)
>
> Updated patch attached. However, unable to even build-test since ide-scsi
> is already broken:
>
> drivers/scsi/ide-scsi.c: In function `idescsi_eh_reset':
> drivers/scsi/ide-scsi.c:1046: error: too few arguments to function `end_that_request_last'
> drivers/scsi/ide-scsi.c:1056: error: too few arguments to function `end_that_request_last'
It seems that ide-scsi was fine after all...
> @@ -1046,7 +1043,7 @@ static int idescsi_eh_reset (struct scsi
>
> /* kill current request */
> blkdev_dequeue_request(req);
> - end_that_request_last(req, 0);
> + end_that_request_last(req);
> if (req->flags & REQ_SENSE)
> kfree(scsi->pc->buffer);
> kfree(scsi->pc);
> @@ -1056,7 +1053,7 @@ static int idescsi_eh_reset (struct scsi
> /* now nuke the drive queue */
> while ((req = elv_next_request(drive->queue))) {
> blkdev_dequeue_request(req);
> - end_that_request_last(req, 0);
> + end_that_request_last(req);
> }
>
> HWGROUP(drive)->rq = NULL;