upstream: [media] dib8000: rename dib8000_attach to dib8000_init
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 29 May 2014 12:20:16 +0000 (09:20 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:59:45 +0000 (11:59 +0900)
commitf015ea43ae58cc2cc7d57fc79b895a5cccf69aff
treef67f56dfa5c9a7155d00e70d57eaef9a34eb153c
parent074e2b65a0abca9dd374653a6f9142705cbb5168
upstream: [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.

Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=b9bc7d59b725
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/dvb-frontends/dib8000.c
drivers/media/dvb-frontends/dib8000.h
drivers/media/usb/dvb-usb/dib0700_devices.c