From cab462f716cdd522edc71436482d8734e8258489 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 9 Jan 2006 15:53:26 -0200 Subject: [PATCH] V4L/DVB (3307): Some cleanups at I2C modules - i2c names shorten - removed obsoleted flags on newer modules - small cleanups Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/bttv-i2c.c | 4 ++-- drivers/media/video/cx25840/cx25840-core.c | 2 -- drivers/media/video/cx25840/cx25840.h | 1 + drivers/media/video/ir-kbd-i2c.c | 2 +- drivers/media/video/msp3400-driver.c | 4 ---- drivers/media/video/saa6588.c | 2 +- drivers/media/video/saa711x.c | 2 -- drivers/media/video/saa7134/saa6752hs.c | 8 +++++--- drivers/media/video/tda7432.c | 6 +++--- drivers/media/video/tda9875.c | 2 +- drivers/media/video/tda9887.c | 2 +- drivers/media/video/tuner-core.c | 8 ++++---- drivers/media/video/tvaudio.c | 3 +-- drivers/media/video/tvmixer.c | 6 +----- drivers/media/video/tvp5150.c | 13 ++++++------- drivers/media/video/wm8775.c | 8 +++----- include/media/tuner.h | 1 - include/media/v4l2-common.h | 2 +- 18 files changed, 31 insertions(+), 45 deletions(-) diff --git a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c index fd66d386fa7..748d630c7fe 100644 --- a/drivers/media/video/bttv-i2c.c +++ b/drivers/media/video/bttv-i2c.c @@ -107,7 +107,7 @@ static struct i2c_algo_bit_data bttv_i2c_algo_bit_template = { static struct i2c_adapter bttv_i2c_adap_sw_template = { .owner = THIS_MODULE, .class = I2C_CLASS_TV_ANALOG, - .name = "bt848", + .name = "bttv", .id = I2C_HW_B_BT848, .client_register = attach_inform, }; @@ -274,7 +274,7 @@ static struct i2c_algorithm bttv_algo = { }; static struct i2c_adapter bttv_i2c_adap_hw_template = { - .owner = THIS_MODULE, + .owner = THIS_MODULE, .class = I2C_CLASS_TV_ANALOG, .name = "bt878", .id = I2C_HW_B_BT848 /* FIXME */, diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 29b378b6097..d45237d508c 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c @@ -939,9 +939,7 @@ static struct i2c_driver i2c_driver_cx25840 = { .driver = { .name = "cx25840", }, - .id = I2C_DRIVERID_CX25840, - .attach_adapter = cx25840_attach_adapter, .detach_client = cx25840_detach_client, .command = cx25840_command, diff --git a/drivers/media/video/cx25840/cx25840.h b/drivers/media/video/cx25840/cx25840.h index 4260c3faa37..fd22f30dcc1 100644 --- a/drivers/media/video/cx25840/cx25840.h +++ b/drivers/media/video/cx25840/cx25840.h @@ -20,6 +20,7 @@ #ifndef _CX25840_H_ #define _CX25840_H_ + #include #include diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index caa0f58d149..58b0e698282 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c @@ -279,7 +279,7 @@ static int ir_probe(struct i2c_adapter *adap); static struct i2c_driver driver = { .driver = { - .name = "ir remote kbd driver", + .name = "ir-kbd-i2c", }, .id = I2C_DRIVERID_INFRARED, .attach_adapter = ir_probe, diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index eece5fe46cb..fbd85120c33 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c @@ -106,10 +106,8 @@ MODULE_PARM_DESC(dolby, "Activates Dolby processsing"); /* Addresses to scan */ static unsigned short normal_i2c[] = { 0x80 >> 1, 0x88 >> 1, I2C_CLIENT_END }; - I2C_CLIENT_INSMOD; - /* ----------------------------------------------------------------------- */ /* functions for talking to the MSP3400C Sound processor */ @@ -975,7 +973,6 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind) client->addr = address; client->adapter = adapter; client->driver = &i2c_driver; - client->flags = I2C_CLIENT_ALLOW_USE; snprintf(client->name, sizeof(client->name) - 1, "msp3400"); if (msp_reset(client) == -1) { @@ -1119,7 +1116,6 @@ static struct i2c_driver i2c_driver = { .suspend = msp_suspend, .resume = msp_resume, }, - .owner = THIS_MODULE, }; static int __init msp3400_init_module(void) diff --git a/drivers/media/video/saa6588.c b/drivers/media/video/saa6588.c index ad582bd3981..e70b17ef36e 100644 --- a/drivers/media/video/saa6588.c +++ b/drivers/media/video/saa6588.c @@ -486,7 +486,7 @@ static int saa6588_command(struct i2c_client *client, unsigned int cmd, static struct i2c_driver driver = { .driver = { - .name = "i2c saa6588 driver", + .name = "saa6588", }, .id = -1, /* FIXME */ .attach_adapter = saa6588_probe, diff --git a/drivers/media/video/saa711x.c b/drivers/media/video/saa711x.c index 8008537391b..f39a7be0858 100644 --- a/drivers/media/video/saa711x.c +++ b/drivers/media/video/saa711x.c @@ -567,9 +567,7 @@ static struct i2c_driver i2c_driver_saa711x = { .driver = { .name = "saa711x", }, - .id = I2C_DRIVERID_SAA711X, - .attach_adapter = saa711x_attach_adapter, .detach_client = saa711x_detach_client, .command = saa711x_command, diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c index 4615a982ac6..ad73c4a60f2 100644 --- a/drivers/media/video/saa7134/saa6752hs.c +++ b/drivers/media/video/saa7134/saa6752hs.c @@ -9,7 +9,8 @@ #include #include #include -#include +#include +#include #include #include @@ -509,7 +510,6 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind) { struct saa6752hs_state *h; - printk("saa6752hs: chip found @ 0x%x\n", addr<<1); if (NULL == (h = kmalloc(sizeof(*h), GFP_KERNEL))) return -ENOMEM; @@ -525,6 +525,8 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind) i2c_set_clientdata(&h->client, h); i2c_attach_client(&h->client); + v4l_info(&h->client,"saa6752hs: chip found @ 0x%x\n", addr<<1); + return 0; } @@ -598,7 +600,7 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg) static struct i2c_driver driver = { .driver = { - .name = "i2c saa6752hs MPEG encoder", + .name = "saa6752hs", }, .id = I2C_DRIVERID_SAA6752HS, .attach_adapter = saa6752hs_probe, diff --git a/drivers/media/video/tda7432.c b/drivers/media/video/tda7432.c index c6efc9826ba..99261f15e66 100644 --- a/drivers/media/video/tda7432.c +++ b/drivers/media/video/tda7432.c @@ -341,8 +341,8 @@ static int tda7432_command(struct i2c_client *client, { struct tda7432 *t = i2c_get_clientdata(client); v4l_dbg(2,client,"In tda7432_command\n"); - if (debug>1) - v4l_i2c_print_ioctl(client,cmd); + if (debug>1) + v4l_i2c_print_ioctl(client,cmd); switch (cmd) { /* --- v4l ioctls --- */ @@ -489,7 +489,7 @@ static int tda7432_command(struct i2c_client *client, static struct i2c_driver driver = { .driver = { - .name = "i2c tda7432 driver", + .name = "tda7432", }, .id = I2C_DRIVERID_TDA7432, .attach_adapter = tda7432_probe, diff --git a/drivers/media/video/tda9875.c b/drivers/media/video/tda9875.c index 760ec3c2ac6..299393bf900 100644 --- a/drivers/media/video/tda9875.c +++ b/drivers/media/video/tda9875.c @@ -368,7 +368,7 @@ static int tda9875_command(struct i2c_client *client, static struct i2c_driver driver = { .driver = { - .name = "i2c tda9875 driver", + .name = "tda9875", }, .id = I2C_DRIVERID_TDA9875, .attach_adapter = tda9875_probe, diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index f64baa4b002..9cf47dc6557 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -882,7 +882,7 @@ static struct i2c_driver driver = { .detach_client = tda9887_detach, .command = tda9887_command, .driver = { - .name = "i2c tda9887 driver", + .name = "tda9887", .suspend = tda9887_suspend, .resume = tda9887_resume, }, diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index a727c3ae62c..57bc585a695 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -805,10 +805,10 @@ static struct i2c_driver driver = { .detach_client = tuner_detach, .command = tuner_command, .driver = { - .name = "tuner", - .suspend = tuner_suspend, - .resume = tuner_resume, - }, + .name = "tuner", + .suspend = tuner_suspend, + .resume = tuner_resume, + }, }; static struct i2c_client client_template = { .name = "(tuner unset)", diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c index 9f6b6d855f0..b582943a0d3 100644 --- a/drivers/media/video/tvaudio.c +++ b/drivers/media/video/tvaudio.c @@ -1744,10 +1744,9 @@ static int chip_command(struct i2c_client *client, return 0; } - static struct i2c_driver driver = { .driver = { - .name = "generic i2c audio driver", + .name = "tvaudio", }, .id = I2C_DRIVERID_TVAUDIO, .attach_adapter = chip_probe, diff --git a/drivers/media/video/tvmixer.c b/drivers/media/video/tvmixer.c index ce0da9c1a76..9e86caeb96a 100644 --- a/drivers/media/video/tvmixer.c +++ b/drivers/media/video/tvmixer.c @@ -227,13 +227,9 @@ static int tvmixer_release(struct inode *inode, struct file *file) } static struct i2c_driver driver = { -#ifdef I2C_PEC .driver = { - .name = "tv card mixer driver", + .name = "tvmixer", }, -#else - .name = "tv card mixer driver", -#endif .id = I2C_DRIVERID_TVMIXER, .detach_adapter = tvmixer_adapters, .attach_adapter = tvmixer_adapters, diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index 07ad675cd58..c35b8042eee 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c @@ -30,14 +30,15 @@ module_param(debug, int, 0); MODULE_PARM_DESC(debug, "Debug level (0-1)"); #define tvp5150_info(fmt, arg...) do { \ - printk(KERN_INFO "%s %d-%04x: " fmt, c->driver->name, \ + printk(KERN_INFO "%s %d-%04x: " fmt, c->driver->driver.name, \ i2c_adapter_id(c->adapter), c->addr , ## arg); } while (0) #define tvp5150_dbg(num, fmt, arg...) \ do { \ if (debug >= num) \ - printk(KERN_DEBUG "%s debug %d-%04x: " fmt, c->driver->name, \ - i2c_adapter_id(c->adapter), c->addr , ## arg); \ - } while (0) + printk(KERN_DEBUG "%s debug %d-%04x: " fmt,\ + c->driver->driver.name, \ + i2c_adapter_id(c->adapter), \ + c->addr , ## arg); } while (0) /* supported controls */ static struct v4l2_queryctrl tvp5150_qctrl[] = { @@ -1137,9 +1138,7 @@ static struct i2c_driver driver = { .driver = { .name = "tvp5150", }, - - /* FIXME */ - .id = I2C_DRIVERID_SAA7110, + .id = I2C_DRIVERID_TVP5150, .attach_adapter = tvp5150_attach_adapter, .detach_client = tvp5150_detach_client, diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c index 20b4ec93d7c..c2e6d2e9f5f 100644 --- a/drivers/media/video/wm8775.c +++ b/drivers/media/video/wm8775.c @@ -237,12 +237,10 @@ static struct i2c_driver i2c_driver = { .driver = { .name = "wm8775", }, - - .id = I2C_DRIVERID_WM8775, - + .id = I2C_DRIVERID_WM8775, .attach_adapter = wm8775_probe, - .detach_client = wm8775_detach, - .command = wm8775_command, + .detach_client = wm8775_detach, + .command = wm8775_command, }; diff --git a/include/media/tuner.h b/include/media/tuner.h index 584f3ab1fcf..7674b121ce8 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h @@ -214,7 +214,6 @@ extern int tea5767_autodetection(struct i2c_client *c); #define tuner_warn(fmt, arg...) do {\ printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) - #define tuner_info(fmt, arg...) do {\ printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 51cdca8365c..3cc3132f391 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h @@ -34,7 +34,7 @@ #define v4l_printk(level, name, adapter, addr, fmt, arg...) \ printk(level "%s %d-%04x: " fmt, name, i2c_adapter_id(adapter), addr , ## arg) -#define v4l_client_printk(level, client, fmt, arg...) \ +#define v4l_client_printk(level, client, fmt, arg...) \ v4l_printk(level, (client)->driver->driver.name, (client)->adapter, \ (client)->addr, fmt , ## arg) -- 2.20.1