Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Mar 2001 13:48:42 +0900
From:      Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
To:        Willem van Engen <wvengen@stack.nl>
Cc:        hackers@freebsd.org
Subject:   Re: driver: probe not called when smbus child
Message-ID:  <200103210448.NAA57784@shidahara1.planet.sci.kobe-u.ac.jp>
In-Reply-To: Your message of "Tue, 20 Mar 2001 16:50:09 %2B0100." <3AB77C31.8213C158@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
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
<a href="http://www.planet.sci.kobe-u.ac.jp/~takawata/key.html">;
Public Key</a>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103210448.NAA57784>