Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: refactoring



On Monday 11 Oct 2004 12:43, Gerd Knorr wrote:
> On Mon, Oct 11, 2004 at 12:20:11PM +0100, Andrew de Quincey wrote:
> > On Monday 11 Oct 2004 12:06, Johannes Stezenbach wrote:
> > > On Mon, Oct 11, 2004 at 10:59:42AM +0200, Gerd Knorr wrote:
> >
> > Actually, it would have to be:
> >
> > struct dvb_frontend* at76c651_attach(struct i2c_adapter *adap,
> >         const struct at76c651_config* config,
> >         struct dvb_adapter* dvb,
>
> Any reason why you pass down that one?  I'd let dvb_register_frontend
> fill that, i.e. initialize the fe like this:
>
>     struct dvb_frontend *fe;
>
>     fe = at76c651_attach(adap, &my_card_config.at76c651, *adap_priv);
>     if (NULL == fe)
>  /* cry for help */
>     dvb_frontend_register(dvb_adapter, fe);
>
> Maybe also this way:
>
>     fe->dvb = dvb_adapter;
>     dvb_frontend_register(fe);

It was so the frontend could call dvb_register_frontend internally. Why do you 
prefer to have two calls BTW?

> >                              struct dvb_frontend_ops* ops,
>
> And that one?  This should be provided by the fe driver anyway, so why
> pass it in?

So the card driver can override selected operations. 

Perhaps a better way is to have "struct dvb_frontend_ops ops" (i.e. not a 
pointer) in dvb_frontend - the frontend driver fills this out, and the card 
driver can then override stuff if the XXX_attach() succeeds.

> >                              void* adapter_data)
>
> Hmm, do we really need this?  Should't the adapter be able to reach it's
> private data via fe->dvb->priv?

There isn't a private field in dvb_adapter. Perhaps I should add one.




Home | Main Index | Thread Index