diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-02-05 09:43:02 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-02-05 09:43:02 -0200 |
commit | 82f5d43d8ee488c6e20a99d71b2e666a72e9e8f9 (patch) | |
tree | c0fb5adbaab93803f25eb4a86ef0b0ee8eac5e3d /linux/drivers/media/video/dpc7146.c | |
parent | 2806626f1cd30e7ba3109dfdd19d9999e75e62af (diff) | |
download | mediapointer-dvb-s2-82f5d43d8ee488c6e20a99d71b2e666a72e9e8f9.tar.gz mediapointer-dvb-s2-82f5d43d8ee488c6e20a99d71b2e666a72e9e8f9.tar.bz2 |
backport Kernel commit 961f80f9c0c0f7c45d7818f9c9969dfaa9e4463d
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Original Changelog:
Author: Jean Delvare <khali@linux-fr.org>
Date: Sun Jan 27 18:14:51 2008 +0100
i2c: Drivers stop using the redundant client list
The redundant i2c client list maintained by i2c-core is going away
soon, so drivers should stop using it now. Instead, they can use the
standard iterator provided by the device driver model
(device_for_each_child).
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/dpc7146.c')
-rw-r--r-- | linux/drivers/media/video/dpc7146.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/linux/drivers/media/video/dpc7146.c b/linux/drivers/media/video/dpc7146.c index 9ac8e8682..258d46407 100644 --- a/linux/drivers/media/video/dpc7146.c +++ b/linux/drivers/media/video/dpc7146.c @@ -88,11 +88,24 @@ struct dpc int cur_input; /* current input */ }; +static int dpc_check_clients(struct device *dev, void *data) +{ + struct dpc* dpc = data; + struct i2c_client *client = i2c_verify_client(dev); + + if( !client ) + return 0; + + if( I2C_SAA7111A == client->addr ) + dpc->saa7111a = client; + + return 0; +} + /* fixme: add vbi stuff here */ static int dpc_probe(struct saa7146_dev* dev) { struct dpc* dpc = NULL; - struct i2c_client *client; dpc = kzalloc(sizeof(struct dpc), GFP_KERNEL); if( NULL == dpc ) { @@ -116,9 +129,7 @@ static int dpc_probe(struct saa7146_dev* dev) } /* loop through all i2c-devices on the bus and look who is there */ - list_for_each_entry(client, &dpc->i2c_adapter.clients, list) - if( I2C_SAA7111A == client->addr ) - dpc->saa7111a = client; + device_for_each_child(&dpc->i2c_adapter.dev, dpc, dpc_check_clients); /* check if all devices are present */ if( 0 == dpc->saa7111a ) { |