From ecb3b2b35db49778b6d89e3ffd0c400776c20735 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 18 Nov 2011 09:46:12 -0800 Subject: USB: convert drivers/media/* to use module_usb_driver() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This converts the drivers in drivers/media/* to use the module_usb_driver() macro which makes the code smaller and a bit simpler. Added bonus is that it removes some unneeded kernel log messages about drivers loading and/or unloading. Cc: Mauro Carvalho Chehab Cc: Luca Risolia Cc: Jean-Francois Moine Cc: Frank Zago Cc: Olivier Lorin Cc: Erik Andren Cc: Hans de Goede Cc: Brian Johnson Cc: Leandro Costantino Cc: Antoine Jacquet Cc: Jarod Wilson Cc: Florian Mickler Cc: Antti Palosaari Cc: Michael Krufky Cc: "David Härdeman" Cc: Florent Audebert Cc: Sam Doshi Cc: Manu Abraham Cc: Olivier Grenie Cc: Patrick Boettcher Cc: "Igor M. Liplianin" Cc: Derek Kelly Cc: Malcolm Priestley Cc: Steven Toth Cc: "André Weidemann" Cc: Martin Wilks Cc: Tejun Heo Cc: Jose Alberto Reguero Cc: David Henningsson Cc: Paul Gortmaker Cc: Joe Perches Cc: Jesper Juhl Cc: Lucas De Marchi Cc: Hans Verkuil Cc: Alexey Khoroshilov Cc: Anssi Hannula Cc: Rafi Rubin Cc: Dan Carpenter Cc: Paul Bender Cc: Devin Heitmueller Cc: "Márcio A Alves" Cc: Julia Lawall Cc: Laurent Pinchart Cc: Chris Rankin Cc: Lee Jones Cc: Andy Walls Cc: Andrew Morton Cc: Mike Frysinger Cc: Dean Anderson Cc: Pete Eberlein Cc: Arvydas Sidorenko Cc: Andrea Anacleto Signed-off-by: Greg Kroah-Hartman --- drivers/media/rc/ati_remote.c | 33 +-------------------------------- drivers/media/rc/imon.c | 21 +-------------------- drivers/media/rc/mceusb.c | 20 +------------------- drivers/media/rc/redrat3.c | 20 +------------------- drivers/media/rc/streamzap.c | 28 +--------------------------- 5 files changed, 5 insertions(+), 117 deletions(-) (limited to 'drivers/media/rc') diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index 303f22ea04c0..4363bc38aab0 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -908,38 +908,7 @@ static void ati_remote_disconnect(struct usb_interface *interface) kfree(ati_remote); } -/* - * ati_remote_init - */ -static int __init ati_remote_init(void) -{ - int result; - - result = usb_register(&ati_remote_driver); - if (result) - printk(KERN_ERR KBUILD_MODNAME - ": usb_register error #%d\n", result); - else - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" - DRIVER_DESC "\n"); - - return result; -} - -/* - * ati_remote_exit - */ -static void __exit ati_remote_exit(void) -{ - usb_deregister(&ati_remote_driver); -} - -/* - * module specification - */ - -module_init(ati_remote_init); -module_exit(ati_remote_exit); +module_usb_driver(ati_remote_driver); MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 6ed96465137a..3aeb29a7ce11 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -2458,23 +2458,4 @@ static int imon_resume(struct usb_interface *intf) return rc; } -static int __init imon_init(void) -{ - int rc; - - rc = usb_register(&imon_driver); - if (rc) { - pr_err("usb register failed(%d)\n", rc); - rc = -ENODEV; - } - - return rc; -} - -static void __exit imon_exit(void) -{ - usb_deregister(&imon_driver); -} - -module_init(imon_init); -module_exit(imon_exit); +module_usb_driver(imon_driver); diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 60d3c1e09712..20bb12d6fbbe 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -1448,25 +1448,7 @@ static struct usb_driver mceusb_dev_driver = { .id_table = mceusb_dev_table }; -static int __init mceusb_dev_init(void) -{ - int ret; - - ret = usb_register(&mceusb_dev_driver); - if (ret < 0) - printk(KERN_ERR DRIVER_NAME - ": usb register failed, result = %d\n", ret); - - return ret; -} - -static void __exit mceusb_dev_exit(void) -{ - usb_deregister(&mceusb_dev_driver); -} - -module_init(mceusb_dev_init); -module_exit(mceusb_dev_exit); +module_usb_driver(mceusb_dev_driver); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_AUTHOR(DRIVER_AUTHOR); diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index 61287fcca61a..07322fb75eff 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -1300,25 +1300,7 @@ static struct usb_driver redrat3_dev_driver = { .id_table = redrat3_dev_table }; -static int __init redrat3_dev_init(void) -{ - int ret; - - ret = usb_register(&redrat3_dev_driver); - if (ret < 0) - pr_err(DRIVER_NAME - ": usb register failed, result = %d\n", ret); - - return ret; -} - -static void __exit redrat3_dev_exit(void) -{ - usb_deregister(&redrat3_dev_driver); -} - -module_init(redrat3_dev_init); -module_exit(redrat3_dev_exit); +module_usb_driver(redrat3_dev_driver); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_AUTHOR(DRIVER_AUTHOR); diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c index e435d94c0776..b1d29d09eeae 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c @@ -523,33 +523,7 @@ static int streamzap_resume(struct usb_interface *intf) return 0; } -/** - * streamzap_init - */ -static int __init streamzap_init(void) -{ - int ret; - - /* register this driver with the USB subsystem */ - ret = usb_register(&streamzap_driver); - if (ret < 0) - printk(KERN_ERR DRIVER_NAME ": usb register failed, " - "result = %d\n", ret); - - return ret; -} - -/** - * streamzap_exit - */ -static void __exit streamzap_exit(void) -{ - usb_deregister(&streamzap_driver); -} - - -module_init(streamzap_init); -module_exit(streamzap_exit); +module_usb_driver(streamzap_driver); MODULE_AUTHOR("Jarod Wilson "); MODULE_DESCRIPTION(DRIVER_DESC); -- cgit v1.2.2 From 90802ed9c3dbab2e067bd9fc67a30e66e6774e8f Mon Sep 17 00:00:00 2001 From: Paul Bolle Date: Mon, 5 Dec 2011 13:00:34 +0100 Subject: treewide: Fix comment and string typo 'bufer' Signed-off-by: Paul Bolle Signed-off-by: Jiri Kosina --- drivers/media/rc/ene_ir.c | 2 +- drivers/media/rc/ene_ir.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/rc') diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index cf10ecf5acec..860c112e0fd2 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c @@ -324,7 +324,7 @@ static int ene_rx_get_sample_reg(struct ene_device *dev) return dev->extra_buf2_address + r_pointer; } - dbg("attempt to read beyong ring bufer end"); + dbg("attempt to read beyond ring buffer end"); return 0; } diff --git a/drivers/media/rc/ene_ir.h b/drivers/media/rc/ene_ir.h index fd108d90f750..6f978e85db8c 100644 --- a/drivers/media/rc/ene_ir.h +++ b/drivers/media/rc/ene_ir.h @@ -227,7 +227,7 @@ struct ene_device { /* TX buffer */ unsigned *tx_buffer; /* input samples buffer*/ - int tx_pos; /* position in that bufer */ + int tx_pos; /* position in that buffer */ int tx_len; /* current len of tx buffer */ int tx_done; /* done transmitting */ /* one more sample pending*/ -- cgit v1.2.2 From d36b691077dc59c74efec0d54ed21b86f7a2a21a Mon Sep 17 00:00:00 2001 From: Al Viro Date: Thu, 29 Dec 2011 17:09:01 -0500 Subject: misc latin1 to utf8 conversions Signed-off-by: Al Viro Signed-off-by: Jiri Kosina --- drivers/media/rc/winbond-cir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/rc') diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 13f54b51194a..e7f7a57bf684 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c @@ -1176,6 +1176,6 @@ wbcir_exit(void) module_init(wbcir_init); module_exit(wbcir_exit); -MODULE_AUTHOR("David Härdeman "); +MODULE_AUTHOR("David Härdeman "); MODULE_DESCRIPTION("Winbond SuperI/O Consumer IR Driver"); MODULE_LICENSE("GPL"); -- cgit v1.2.2 From 2c9ede55ecec58099b72e4bb8eab719f32f72c31 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 23 Jul 2011 20:24:48 -0400 Subject: switch device_get_devnode() and ->devnode() to umode_t * both callers of device_get_devnode() are only interested in lower 16bits and nobody tries to return anything wider than 16bit anyway. Signed-off-by: Al Viro --- drivers/media/rc/rc-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/rc') diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 29f900065d8a..f5db8b949bc3 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -715,7 +715,7 @@ static void ir_close(struct input_dev *idev) } /* class for /sys/class/rc */ -static char *ir_devnode(struct device *dev, mode_t *mode) +static char *ir_devnode(struct device *dev, umode_t *mode) { return kasprintf(GFP_KERNEL, "rc/%s", dev_name(dev)); } -- cgit v1.2.2 From 90ab5ee94171b3e28de6bb42ee30b527014e0be7 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 13 Jan 2012 09:32:20 +1030 Subject: module_param: make bool parameters really bool (drivers & misc) module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Acked-by: Mauro Carvalho Chehab Signed-off-by: Rusty Russell --- drivers/media/rc/lirc_dev.c | 2 +- drivers/media/rc/mceusb.c | 4 ++-- drivers/media/rc/streamzap.c | 4 ++-- drivers/media/rc/winbond-cir.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/media/rc') diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 27997a9ceb0d..ca12d3289bfe 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/media/rc/lirc_dev.c @@ -38,7 +38,7 @@ #include #include -static int debug; +static bool debug; #define IRCTL_DEV_NAME "BaseRemoteCtl" #define NOPLUG -1 diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 20bb12d6fbbe..21105bf9594d 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -156,9 +156,9 @@ /* module parameters */ #ifdef CONFIG_USB_DEBUG -static int debug = 1; +static bool debug = 1; #else -static int debug; +static bool debug; #endif #define mce_dbg(dev, fmt, ...) \ diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c index b1d29d09eeae..d6f4bfe09391 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c @@ -43,9 +43,9 @@ #define DRIVER_DESC "Streamzap Remote Control driver" #ifdef CONFIG_USB_DEBUG -static int debug = 1; +static bool debug = 1; #else -static int debug; +static bool debug; #endif #define USB_STREAMZAP_VENDOR_ID 0x0e9c diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index e7f7a57bf684..b09c5fae489b 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c @@ -226,11 +226,11 @@ module_param(protocol, uint, 0444); MODULE_PARM_DESC(protocol, "IR protocol to use for the power-on command " "(0 = RC5, 1 = NEC, 2 = RC6A, default)"); -static int invert; /* default = 0 */ +static bool invert; /* default = 0 */ module_param(invert, bool, 0444); MODULE_PARM_DESC(invert, "Invert the signal from the IR receiver"); -static int txandrx; /* default = 0 */ +static bool txandrx; /* default = 0 */ module_param(txandrx, bool, 0444); MODULE_PARM_DESC(invert, "Allow simultaneous TX and RX"); -- cgit v1.2.2