On 09/02, Greg KH wrote:
> On Tue, Sep 02, 2014 at 07:55:49PM +0200, Konrad Zapalowicz wrote:
> > On 09/02, Greg KH wrote:
> > > On Sun, Aug 31, 2014 at 11:23:57PM +0200, Konrad Zapalowicz wrote:
> > > > This commit adds the struct list_head to the struct dgnc_board so that
> > > > it is now possible to use it with the Linux list facility.
> > > > 
> > > > Signed-off-by: Konrad Zapalowicz <bergo.torino+ker...@gmail.com>
> > > > ---
> > > >  drivers/staging/dgnc/dgnc_driver.h | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > > 
> > > > diff --git a/drivers/staging/dgnc/dgnc_driver.h 
> > > > b/drivers/staging/dgnc/dgnc_driver.h
> > > > index 1111020..251b082 100644
> > > > --- a/drivers/staging/dgnc/dgnc_driver.h
> > > > +++ b/drivers/staging/dgnc/dgnc_driver.h
> > > > @@ -209,6 +209,7 @@ struct board_ops {
> > > >   *     Per-board information
> > > >   */
> > > >  struct dgnc_board {
> > > > +       struct list_head list;
> > > >         int             magic;          /* Board Magic number.  */
> > > >         int             boardnum;       /* Board number: 0-32 */
> > > 
> > > Shouldn't the "struct dgnc_board" structure just live off of the pci
> > > device structure and not require a "list" at all?  That way it's dynamic
> > > depending on how many devices are in the system, like all other pci
> > > drivers.
> > 
> > First, you can ignore the v2 patch I have send in the same time (+-) as
> > you posted this comment.
> > 
> > Second, forgive the perhaps obvious questions however I want to make
> > sure that I understand what you have just said. So as far as I
> > understand you suggest that the contents of the dgnc_board structure can
> > be actually saved/obtained in/from the pci device structure, ie. having
> > the dgnc_board struct is just redundant.
> 
> No, you need the structure, just "hang" it off of the pci device
> structure you get in the probe function.
> 
> > Do you have in mind any particular driver that I can use as an example
> > or basically all of the pci drivers do it this way?
> 
> All of them should do it this way, I don't have an example at the
> moment, sorry.

No problem, the above hint was good enough for me. I found the 
pci_{get,set}_drvdata functions that I believe are what you have been
suggesting.
 
> greg k-h
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to