From 73c5fb6887d21bdbe4c5aec07f132e0010a554da Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 8 Jan 2006 12:05:34 +0000 Subject: i2c fixes and cleanups - Miscelaneous i2c cleanups and fixes to work with kernel >2.6.15 - linux/sound/pci/bt87x.c updated to kernel version. kernel-sync Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/wm8775.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'linux/drivers/media/video/wm8775.c') diff --git a/linux/drivers/media/video/wm8775.c b/linux/drivers/media/video/wm8775.c index 30e5ce058..4fa692129 100644 --- a/linux/drivers/media/video/wm8775.c +++ b/linux/drivers/media/video/wm8775.c @@ -187,7 +187,9 @@ static int wm8775_attach(struct i2c_adapter *adapter, int address, client->addr = address; client->adapter = adapter; client->driver = &i2c_driver; +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) client->flags = I2C_CLIENT_ALLOW_USE; +#endif snprintf(client->name, sizeof(client->name) - 1, "wm8775"); v4l_info(client, "chip found @ 0x%x (%s)\n", address << 1, adapter->name); @@ -258,17 +260,21 @@ static int wm8775_detach(struct i2c_client *client) /* i2c implementation */ static struct i2c_driver i2c_driver = { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))&&(LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)) + .owner = THIS_MODULE, +#endif +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) .name = "wm8775", - - .id = I2C_DRIVERID_WM8775, .flags = I2C_DF_NOTIFY, - - .attach_adapter = wm8775_probe, - .detach_client = wm8775_detach, - .command = wm8775_command, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - .owner = THIS_MODULE, +#else + .driver = { + .name = "wm8775", + }, #endif + .id = I2C_DRIVERID_WM8775, + .attach_adapter = wm8775_probe, + .detach_client = wm8775_detach, + .command = wm8775_command, }; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -- cgit v1.2.3