Lines Matching refs:to
6 It is likely that subsystem maintainers will ask driver developers to
7 conform to these design patterns.
17 only be probed() once on a certain system (singletons), it is custom to assume
18 that the device the driver binds to will appear in several instances. This
19 means that the probe() function and all callbacks need to be reentrant.
21 The most common way to achieve this is to use the state container design
42 Of course it is then necessary to always pass this instance of the
43 state around to all functions that need access to the state and its members.
46 pass around a pointer to struct foo like this:
62 This way you always get a pointer back to the correct instance of foo in
103 return a single argument which is a pointer to a struct member in the
108 What container_of() does is to obtain a pointer to the containing struct from
109 a pointer to a member by a simple subtraction using the offsetof() macro from
110 standard C, which allows something similar to object oriented behaviours.
112 for this to work.
114 We can see here that we avoid having global pointers to our struct foo *
115 instance this way, while still keeping the number of parameters passed to the
116 work function to a single pointer.