diff options
author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-05-29 09:20:14 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-06-17 12:04:48 -0300 |
commit | 7f67d96ab181aff4af2074ba0a56b3f81333e896 (patch) | |
tree | 376662efe8440d6d4a282dbed9c37d6d1021a022 /drivers/media/dvb-frontends/dib7000p.c | |
parent | 4647f487083ded0d42a61bf2e066ce5328624ed3 (diff) | |
download | lwn-7f67d96ab181aff4af2074ba0a56b3f81333e896.tar.gz lwn-7f67d96ab181aff4af2074ba0a56b3f81333e896.zip |
[media] dib7000p: rename dib7000p_attach to dib7000p_init
Well, what we call as "foo_attach" is the method that should
be called by the dvb_attach() macro.
It should be noticed that the name "dvb_attach" is really a
bad name and don't express what it does.
dvb_attach() basically does three things, if the frontend is
compiled as a module:
- It lookups for the module that it is known to have the
given symbol name and requests such module;
- It increments the module usage (anonymously - so lsmod
doesn't print who loaded the module);
- after loading the module, it runs the function associated
with the dynamic symbol.
When compiled as builtin, it just calls the function given to it.
As dvb_attach() increments refcount, it can't be (easily)
called more than once for the same module, or the kernel
will deny to remove the module, because refcount will never
be zeroed.
In other words, the function name given to dvb_attach()
should be one single symbol that will always be called
before any other function on that module to be used.
For almost all DVB frontends, there's just one function.
However, the dib7000p initialization can require up to 3
functions to be called:
- dib7000p_get_i2c_master;
- dib7000p_i2c_enumeration;
- dib7000p_init (before this patch dib7000_attach).
(plus a bunch of other functions that the bridge driver will
need to call).
As we need to get rid of all those direct calls, because they
cause compilation breakages when bridge is builtin and
frontend is module, we'll need to add a new function that
will be the first one to be called, whatever initialization
is needed.
So, let's rename the function that probes and init the hardware
to dib7000p_init.
A latter patch will add a new dib7000p_attach that will be
used as originally conceived by dvb_attach() way.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/dib7000p.c')
-rw-r--r-- | drivers/media/dvb-frontends/dib7000p.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/dvb-frontends/dib7000p.c b/drivers/media/dvb-frontends/dib7000p.c index effb87f773b0..4b33bce3a4c6 100644 --- a/drivers/media/dvb-frontends/dib7000p.c +++ b/drivers/media/dvb-frontends/dib7000p.c @@ -2374,7 +2374,7 @@ int dib7090_slave_reset(struct dvb_frontend *fe) EXPORT_SYMBOL(dib7090_slave_reset); static struct dvb_frontend_ops dib7000p_ops; -struct dvb_frontend *dib7000p_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib7000p_config *cfg) +struct dvb_frontend *dib7000p_init(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib7000p_config *cfg) { struct dvb_frontend *demod; struct dib7000p_state *st; @@ -2434,7 +2434,7 @@ error: kfree(st); return NULL; } -EXPORT_SYMBOL(dib7000p_attach); +EXPORT_SYMBOL(dib7000p_init); static struct dvb_frontend_ops dib7000p_ops = { .delsys = { SYS_DVBT }, |