aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/dpc7146.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/dpc7146.c')
-rw-r--r--drivers/media/video/dpc7146.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/media/video/dpc7146.c b/drivers/media/video/dpc7146.c
index 255dae303708..566e479e2629 100644
--- a/drivers/media/video/dpc7146.c
+++ b/drivers/media/video/dpc7146.c
@@ -87,11 +87,24 @@ struct dpc
87 int cur_input; /* current input */ 87 int cur_input; /* current input */
88}; 88};
89 89
90static int dpc_check_clients(struct device *dev, void *data)
91{
92 struct dpc* dpc = data;
93 struct i2c_client *client = i2c_verify_client(dev);
94
95 if( !client )
96 return 0;
97
98 if( I2C_SAA7111A == client->addr )
99 dpc->saa7111a = client;
100
101 return 0;
102}
103
90/* fixme: add vbi stuff here */ 104/* fixme: add vbi stuff here */
91static int dpc_probe(struct saa7146_dev* dev) 105static int dpc_probe(struct saa7146_dev* dev)
92{ 106{
93 struct dpc* dpc = NULL; 107 struct dpc* dpc = NULL;
94 struct i2c_client *client;
95 108
96 dpc = kzalloc(sizeof(struct dpc), GFP_KERNEL); 109 dpc = kzalloc(sizeof(struct dpc), GFP_KERNEL);
97 if( NULL == dpc ) { 110 if( NULL == dpc ) {
@@ -115,9 +128,7 @@ static int dpc_probe(struct saa7146_dev* dev)
115 } 128 }
116 129
117 /* loop through all i2c-devices on the bus and look who is there */ 130 /* loop through all i2c-devices on the bus and look who is there */
118 list_for_each_entry(client, &dpc->i2c_adapter.clients, list) 131 device_for_each_child(&dpc->i2c_adapter.dev, dpc, dpc_check_clients);
119 if( I2C_SAA7111A == client->addr )
120 dpc->saa7111a = client;
121 132
122 /* check if all devices are present */ 133 /* check if all devices are present */
123 if( 0 == dpc->saa7111a ) { 134 if( 0 == dpc->saa7111a ) {