diff options
author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-05-29 09:20:16 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-06-17 12:04:49 -0300 |
commit | b9bc7d59b72511f8a51e847aedc39f74bfc102a3 (patch) | |
tree | 036410bab99e853d682fb896e66f5bd1e6d45bf6 /drivers/media/dvb-frontends/dib8000.c | |
parent | 8abe4a0a3f6d4217b16a1a3f68cd5c72ab5a058e (diff) | |
download | talos-obmc-linux-b9bc7d59b72511f8a51e847aedc39f74bfc102a3.tar.gz talos-obmc-linux-b9bc7d59b72511f8a51e847aedc39f74bfc102a3.zip |
[media] dib8000: rename dib8000_attach to dib8000_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,
but, on dib8000, there are several exported symbols.
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 this function, in order to prepare for
a next patch that will add a new attach() function that
will be the only one exported by this module.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/dib8000.c')
-rw-r--r-- | drivers/media/dvb-frontends/dib8000.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/dvb-frontends/dib8000.c b/drivers/media/dvb-frontends/dib8000.c index 1632d78a5479..c1c8c92ce498 100644 --- a/drivers/media/dvb-frontends/dib8000.c +++ b/drivers/media/dvb-frontends/dib8000.c @@ -4405,12 +4405,12 @@ static const struct dvb_frontend_ops dib8000_ops = { .read_ucblocks = dib8000_read_unc_blocks, }; -struct dvb_frontend *dib8000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib8000_config *cfg) +struct dvb_frontend *dib8000_init(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib8000_config *cfg) { struct dvb_frontend *fe; struct dib8000_state *state; - dprintk("dib8000_attach"); + dprintk("dib8000_init"); state = kzalloc(sizeof(struct dib8000_state), GFP_KERNEL); if (state == NULL) @@ -4467,7 +4467,7 @@ error: return NULL; } -EXPORT_SYMBOL(dib8000_attach); +EXPORT_SYMBOL(dib8000_init); MODULE_AUTHOR("Olivier Grenie <Olivier.Grenie@dibcom.fr, " "Patrick Boettcher <pboettcher@dibcom.fr>"); MODULE_DESCRIPTION("Driver for the DiBcom 8000 ISDB-T demodulator"); |