[media] dib7000p: rename dib7000p_attach to dib7000p_init
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 29 May 2014 12:20:14 +0000 (09:20 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 17 Jun 2014 15:04:48 +0000 (12:04 -0300)
commit7f67d96ab181aff4af2074ba0a56b3f81333e896
tree376662efe8440d6d4a282dbed9c37d6d1021a022
parent4647f487083ded0d42a61bf2e066ce5328624ed3
[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>
drivers/media/dvb-frontends/dib7000p.c
drivers/media/dvb-frontends/dib7000p.h
drivers/media/pci/cx23885/cx23885-dvb.c
drivers/media/usb/dvb-usb/cxusb.c
drivers/media/usb/dvb-usb/dib0700_devices.c
This page took 0.025434 seconds and 5 git commands to generate.