Mailing List archive

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

[linux-dvb] Re: Freeing frontend private data



Andrew de Quincey wrote:
Er, seems to be a bit of a problem.. or else I'm being stupid.

If I pass a kmalloced memory buffer to dvb_register_frontend() as follows:

dvb_register_frontend (tda10045h_ioctl, i2c, (void*) tda_state, &tda10045h_info);

(ie. tda_state is kmalloced)

How am I meant to free it up when it is detached? The signature of the detach method is:
void tda10045h_detach (struct dvb_i2c_bus *i2c);

Which doesn't give me any direct access to the frontend structure being freed.. I suppose I could get the adapter and mess about inside its private lists of frontends, but that seems horrible!
Until now it never required to store significand amounts of state information. Existing drivers either use the data field as bitfield (see the ves1820 for example) or point to static config data structs (e.g. the same driver works for 3 different frontends, then you pass a pointer to a static struct containing specialized register settings, function pointers, whatever to dvb_register_frontend(). After a quick review of your code this approach should work for your driver, too)

Holger



--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index