Re: driver(9)
Patrick Welche <[email protected]> Sat, 28 Mar 2026 11:54:50 +0000
| Newsgroups | gmane.os.netbsd.current |
|---|---|
| Message-ID | <[email protected]> |
On Sat, Mar 28, 2026 at 02:50:35PM +0300, Valery Ushakov wrote:
> On Sat, Mar 28, 2026 at 11:09:47 +0000, Patrick Welche wrote:
>
> > yet the next paragraph still mentions CFATTACH_DECL and declares sc_dev.
> >
> > Apply the following (which leaves an odd struct foo_softc declaration)?
> >
> > --- a/share/man/man9/driver.9
> > +++ b/share/man/man9/driver.9
> [...]
> > @@ -96,7 +96,6 @@ structure for driver
> > is defined with:
> > .Bd -literal
> > struct foo_softc {
> > - device_t sc_dev; /* generic device info */
> > /* device-specific state */
> > };
> > .Ed
>
> You are a bit confused here. device_t is a _pointer_ to the struct
> device, not inline struct device (as it used to be). You can check
> cvs history for commits that (among other things) do:
>
> - struct device foo_dev;
> + device_t foo_dev;
>
> usually with something like "split softc and device_t" in the log
> message.
oh - an entire struct device was contained in each struct softc(!)
Thanks for the explanation!
Patrick