From owner-freebsd-hackers Tue Mar 20 20:45:40 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from shidahara1.planet.sci.kobe-u.ac.jp (shidahara1.planet.sci.kobe-u.ac.jp [133.30.50.200]) by hub.freebsd.org (Postfix) with ESMTP id 9517B37B71E for ; Tue, 20 Mar 2001 20:45:36 -0800 (PST) (envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp) Received: from shidahara1.planet.sci.kobe-u.ac.jp (localhost [127.0.0.1]) by shidahara1.planet.sci.kobe-u.ac.jp (8.9.3/8.9.3) with ESMTP id NAA57784; Wed, 21 Mar 2001 13:48:42 +0900 (JST) (envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp) Message-Id: <200103210448.NAA57784@shidahara1.planet.sci.kobe-u.ac.jp> To: Willem van Engen Cc: hackers@freebsd.org Subject: Re: driver: probe not called when smbus child In-reply-to: Your message of "Tue, 20 Mar 2001 16:50:09 +0100." <3AB77C31.8213C158@stack.nl> Date: Wed, 21 Mar 2001 13:48:42 +0900 From: Takanori Watanabe Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <3AB77C31.8213C158@stack.nl>, Willem van Engen さんいわく: >I'm trying to write a module which should be a child of the smbus. >When I make the driver a child of the isa bus, identify, probe, >and attach functions are properly called. I use the following >code to do that: > DRIVER_MODULE(my, isa, my_driver, my_devclass, 0, 0); >But when I put it on the smbus using > DRIVER_MODULE(my, smbus, my_driver, my_devclass, 0, 0); >only identify is called. The identify function is as follows: > > static void > my_identify(driver_t *driver, device_t parent) > { > devclass_t dc; > device_t child; > > printf("my: my_identify called\n"); > dc = devclass_find("my"); > if (devclass_get_device(dc, 0)==NULL) { > child = BUS_ADD_CHILD(parent, 0, "my", -1); > } > } 'smbus' code do not have 'bus_add_child' method.So the BUS_ADD_CHILD call do not take effect. Call device_add_child(parent,"my",-1); or define bus_add_child method. And you will need to know grandparent device name to bind the device collectly.(Or should we need a way to get device attribute such as Mother board, Video Capture BitBang,Video Capture Cooked,VGA Card and etc.) Takanori Watanabe Public Key Key fingerprint = 2C 51 E2 78 2C E1 C5 2D 0F F1 20 A3 11 3A 62 2A To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message