diff options
| author | Ruslan Ermilov <ru@FreeBSD.org> | 2005-12-20 21:06:57 +0000 |
|---|---|---|
| committer | Ruslan Ermilov <ru@FreeBSD.org> | 2005-12-20 21:06:57 +0000 |
| commit | 9a77af905efa71b75b2a5bbb7ff178c4ebdb5b9b (patch) | |
| tree | 63c40024864f0330e96733e1aa960dffd1194aa5 /sys/dev/smbus | |
| parent | c8d81a41f4b3b70b94025bfda26871f0dbdf0919 (diff) | |
Notes
Diffstat (limited to 'sys/dev/smbus')
| -rw-r--r-- | sys/dev/smbus/smb.c | 10 | ||||
| -rw-r--r-- | sys/dev/smbus/smbus.c | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/sys/dev/smbus/smb.c b/sys/dev/smbus/smb.c index 8073cc5945b0..ca4fbe60062f 100644 --- a/sys/dev/smbus/smb.c +++ b/sys/dev/smbus/smb.c @@ -58,13 +58,11 @@ struct smb_softc { static int smb_probe(device_t); static int smb_attach(device_t); static int smb_detach(device_t); -static void smb_identify(driver_t *driver, device_t parent); static devclass_t smb_devclass; static device_method_t smb_methods[] = { /* device interface */ - DEVMETHOD(device_identify, smb_identify), DEVMETHOD(device_probe, smb_probe), DEVMETHOD(device_attach, smb_attach), DEVMETHOD(device_detach, smb_detach), @@ -94,14 +92,6 @@ static struct cdevsw smb_cdevsw = { .d_name = "smb", }; -static void -smb_identify(driver_t *driver, device_t parent) -{ - - if (!device_find_child(parent, "smb", -1)) - device_add_child(parent, "smb", -1); -} - static int smb_probe(device_t dev) { diff --git a/sys/dev/smbus/smbus.c b/sys/dev/smbus/smbus.c index d8c0a76203d2..6429a7a46818 100644 --- a/sys/dev/smbus/smbus.c +++ b/sys/dev/smbus/smbus.c @@ -49,11 +49,12 @@ static devclass_t smbus_devclass; * Device methods */ static int smbus_probe(device_t); +static int smbus_attach(device_t); static device_method_t smbus_methods[] = { /* device interface */ DEVMETHOD(device_probe, smbus_probe), - DEVMETHOD(device_attach, bus_generic_attach), + DEVMETHOD(device_attach, smbus_attach), DEVMETHOD(device_detach, bus_generic_detach), /* bus interface */ @@ -81,6 +82,15 @@ smbus_probe(device_t dev) return (0); } +static int +smbus_attach(device_t dev) +{ + device_add_child(dev, NULL, -1); + bus_generic_attach(dev); + + return (0); +} + void smbus_generic_intr(device_t dev, u_char devaddr, char low, char high) { |
