From 3e004ed242b3bb9cd7d41031c089c851021c7680 Mon Sep 17 00:00:00 2001 From: Michael Hunold Date: Thu, 24 Apr 2003 12:57:17 +0000 Subject: Some fixes to get the "analog" i2c drivers to work for both 2.4 and 2.5. Add the DVB_DEVFS_ONLY switch back again. --- linux/drivers/media/video/tea6420.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'linux/drivers/media/video/tea6420.c') diff --git a/linux/drivers/media/video/tea6420.c b/linux/drivers/media/video/tea6420.c index 63aa2caa9..aa0ef021e 100644 --- a/linux/drivers/media/video/tea6420.c +++ b/linux/drivers/media/video/tea6420.c @@ -110,15 +110,19 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, unsigned sho if (0 == client) { return -ENOMEM; } + memset(client, 0, sizeof(struct i2c_client)); /* fill client structure */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) sprintf(client->name,"tea6420 (0x%02x)", address); +#else + sprintf(client->dev.name,"tea6420 (0x%02x)", address); +#endif client->id = tea6420_id++; client->flags = 0; client->addr = address; client->adapter = adapter; client->driver = &driver; - client->data = NULL; /* tell the i2c layer a new client has arrived */ if (0 != (err = i2c_attach_client(client))) { @@ -135,8 +139,11 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, unsigned sho printk("tea6420.o: could not initialize chipset. continuing anyway.\n"); } - printk("tea6420.o: detected @ 0x%02x on adapter %s\n",2*address,&client->adapter->name[0]); - +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) + printk("tea6420.o: detected @ 0x%02x on adapter %s\n",address,&client->adapter->name[0]); +#else + printk("tea6420.o: detected @ 0x%02x on adapter %s\n",address,&client->adapter->dev.name[0]); +#endif return 0; } -- cgit v1.2.3