[4/5] cx23885: add I2C client for CI into state and handle unregistering
Commit Message
If the CI chip has an I2C driver, we need to store I2C client into state.
Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
---
drivers/media/pci/cx23885/cx23885-dvb.c | 7 +++++++
drivers/media/pci/cx23885/cx23885.h | 1 +
2 files changed, 8 insertions(+)
Comments
Reviewed-by: Antti Palosaari <crope@iki.fi>
I was looking where is the CI I2C client pointer stored to that, but
realized it was upcoming patch which will use that...
regards
Antti
On 09/29/2014 10:44 AM, Olli Salonen wrote:
> If the CI chip has an I2C driver, we need to store I2C client into state.
>
> Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
> ---
> drivers/media/pci/cx23885/cx23885-dvb.c | 7 +++++++
> drivers/media/pci/cx23885/cx23885.h | 1 +
> 2 files changed, 8 insertions(+)
>
> diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c
> index d327459..cc88997 100644
> --- a/drivers/media/pci/cx23885/cx23885-dvb.c
> +++ b/drivers/media/pci/cx23885/cx23885-dvb.c
> @@ -1923,6 +1923,13 @@ int cx23885_dvb_unregister(struct cx23885_tsport *port)
> * implement MFE support.
> */
>
> + /* remove I2C client for CI */
> + client = port->i2c_client_ci;
> + if (client) {
> + module_put(client->dev.driver->owner);
> + i2c_unregister_device(client);
> + }
> +
> /* remove I2C client for tuner */
> client = port->i2c_client_tuner;
> if (client) {
> diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h
> index 1792d1a..c35ba2d 100644
> --- a/drivers/media/pci/cx23885/cx23885.h
> +++ b/drivers/media/pci/cx23885/cx23885.h
> @@ -297,6 +297,7 @@ struct cx23885_tsport {
>
> struct i2c_client *i2c_client_demod;
> struct i2c_client *i2c_client_tuner;
> + struct i2c_client *i2c_client_ci;
>
> int (*set_frontend)(struct dvb_frontend *fe);
> int (*fe_set_voltage)(struct dvb_frontend *fe,
>
@@ -1923,6 +1923,13 @@ int cx23885_dvb_unregister(struct cx23885_tsport *port)
* implement MFE support.
*/
+ /* remove I2C client for CI */
+ client = port->i2c_client_ci;
+ if (client) {
+ module_put(client->dev.driver->owner);
+ i2c_unregister_device(client);
+ }
+
/* remove I2C client for tuner */
client = port->i2c_client_tuner;
if (client) {
@@ -297,6 +297,7 @@ struct cx23885_tsport {
struct i2c_client *i2c_client_demod;
struct i2c_client *i2c_client_tuner;
+ struct i2c_client *i2c_client_ci;
int (*set_frontend)(struct dvb_frontend *fe);
int (*fe_set_voltage)(struct dvb_frontend *fe,