[media] em28xx: Change scope of em28xx-input local functions to static
authorEzequiel García <elezegarcia@gmail.com>
Mon, 26 Mar 2012 12:13:34 +0000 (09:13 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 10 Apr 2012 23:43:03 +0000 (20:43 -0300)
This functions are no longer used from another file,
so they should be declared as static.
Also is it necessary to move some of them before they
are used, since they are no longer header-declared.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/em28xx/em28xx-input.c
drivers/media/video/em28xx/em28xx.h

index 0a58ba89590aa73efcacb7dd4e4062a7de50544f..249662597c0c287cee7d93085c909724ad898249 100644 (file)
@@ -80,7 +80,7 @@ struct em28xx_IR {
  I2C IR based get keycodes - should be used with ir-kbd-i2c
  **********************************************************/
 
-int em28xx_get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
+static int em28xx_get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 {
        unsigned char b;
 
@@ -108,7 +108,7 @@ int em28xx_get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
        return 1;
 }
 
-int em28xx_get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
+static int em28xx_get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 {
        unsigned char buf[2];
        u16 code;
@@ -157,7 +157,7 @@ int em28xx_get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
        return 1;
 }
 
-int em28xx_get_key_pinnacle_usb_grey(struct IR_i2c *ir, u32 *ir_key,
+static int em28xx_get_key_pinnacle_usb_grey(struct IR_i2c *ir, u32 *ir_key,
                                     u32 *ir_raw)
 {
        unsigned char buf[3];
@@ -179,7 +179,8 @@ int em28xx_get_key_pinnacle_usb_grey(struct IR_i2c *ir, u32 *ir_key,
        return 1;
 }
 
-int em28xx_get_key_winfast_usbii_deluxe(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
+static int em28xx_get_key_winfast_usbii_deluxe(struct IR_i2c *ir, u32 *ir_key,
+                                       u32 *ir_raw)
 {
        unsigned char subaddr, keydetect, key;
 
@@ -387,7 +388,7 @@ int em28xx_ir_change_protocol(struct rc_dev *rc_dev, u64 rc_type)
        return rc;
 }
 
-void em28xx_register_i2c_ir(struct em28xx *dev)
+static void em28xx_register_i2c_ir(struct em28xx *dev)
 {
        /* Leadtek winfast tv USBII deluxe can find a non working IR-device */
        /* at address 0x18, so if that address is needed for another board in */
@@ -431,6 +432,93 @@ void em28xx_register_i2c_ir(struct em28xx *dev)
        i2c_new_probed_device(&dev->i2c_adap, &info, addr_list, NULL);
 }
 
+/**********************************************************
+ Handle Webcam snapshot button
+ **********************************************************/
+
+static void em28xx_query_sbutton(struct work_struct *work)
+{
+       /* Poll the register and see if the button is depressed */
+       struct em28xx *dev =
+               container_of(work, struct em28xx, sbutton_query_work.work);
+       int ret;
+
+       ret = em28xx_read_reg(dev, EM28XX_R0C_USBSUSP);
+
+       if (ret & EM28XX_R0C_USBSUSP_SNAPSHOT) {
+               u8 cleared;
+               /* Button is depressed, clear the register */
+               cleared = ((u8) ret) & ~EM28XX_R0C_USBSUSP_SNAPSHOT;
+               em28xx_write_regs(dev, EM28XX_R0C_USBSUSP, &cleared, 1);
+
+               /* Not emulate the keypress */
+               input_report_key(dev->sbutton_input_dev, EM28XX_SNAPSHOT_KEY,
+                                1);
+               /* Now unpress the key */
+               input_report_key(dev->sbutton_input_dev, EM28XX_SNAPSHOT_KEY,
+                                0);
+       }
+
+       /* Schedule next poll */
+       schedule_delayed_work(&dev->sbutton_query_work,
+                             msecs_to_jiffies(EM28XX_SBUTTON_QUERY_INTERVAL));
+}
+
+static void em28xx_register_snapshot_button(struct em28xx *dev)
+{
+       struct input_dev *input_dev;
+       int err;
+
+       em28xx_info("Registering snapshot button...\n");
+       input_dev = input_allocate_device();
+       if (!input_dev) {
+               em28xx_errdev("input_allocate_device failed\n");
+               return;
+       }
+
+       usb_make_path(dev->udev, dev->snapshot_button_path,
+                     sizeof(dev->snapshot_button_path));
+       strlcat(dev->snapshot_button_path, "/sbutton",
+               sizeof(dev->snapshot_button_path));
+       INIT_DELAYED_WORK(&dev->sbutton_query_work, em28xx_query_sbutton);
+
+       input_dev->name = "em28xx snapshot button";
+       input_dev->phys = dev->snapshot_button_path;
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
+       set_bit(EM28XX_SNAPSHOT_KEY, input_dev->keybit);
+       input_dev->keycodesize = 0;
+       input_dev->keycodemax = 0;
+       input_dev->id.bustype = BUS_USB;
+       input_dev->id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor);
+       input_dev->id.product = le16_to_cpu(dev->udev->descriptor.idProduct);
+       input_dev->id.version = 1;
+       input_dev->dev.parent = &dev->udev->dev;
+
+       err = input_register_device(input_dev);
+       if (err) {
+               em28xx_errdev("input_register_device failed\n");
+               input_free_device(input_dev);
+               return;
+       }
+
+       dev->sbutton_input_dev = input_dev;
+       schedule_delayed_work(&dev->sbutton_query_work,
+                             msecs_to_jiffies(EM28XX_SBUTTON_QUERY_INTERVAL));
+       return;
+
+}
+
+static void em28xx_deregister_snapshot_button(struct em28xx *dev)
+{
+       if (dev->sbutton_input_dev != NULL) {
+               em28xx_info("Deregistering snapshot button\n");
+               cancel_delayed_work_sync(&dev->sbutton_query_work);
+               input_unregister_device(dev->sbutton_input_dev);
+               dev->sbutton_input_dev = NULL;
+       }
+       return;
+}
+
 int em28xx_ir_init(struct em28xx *dev)
 {
        struct em28xx_IR *ir;
@@ -530,89 +618,3 @@ int em28xx_ir_fini(struct em28xx *dev)
        return 0;
 }
 
-/**********************************************************
- Handle Webcam snapshot button
- **********************************************************/
-
-static void em28xx_query_sbutton(struct work_struct *work)
-{
-       /* Poll the register and see if the button is depressed */
-       struct em28xx *dev =
-               container_of(work, struct em28xx, sbutton_query_work.work);
-       int ret;
-
-       ret = em28xx_read_reg(dev, EM28XX_R0C_USBSUSP);
-
-       if (ret & EM28XX_R0C_USBSUSP_SNAPSHOT) {
-               u8 cleared;
-               /* Button is depressed, clear the register */
-               cleared = ((u8) ret) & ~EM28XX_R0C_USBSUSP_SNAPSHOT;
-               em28xx_write_regs(dev, EM28XX_R0C_USBSUSP, &cleared, 1);
-
-               /* Not emulate the keypress */
-               input_report_key(dev->sbutton_input_dev, EM28XX_SNAPSHOT_KEY,
-                                1);
-               /* Now unpress the key */
-               input_report_key(dev->sbutton_input_dev, EM28XX_SNAPSHOT_KEY,
-                                0);
-       }
-
-       /* Schedule next poll */
-       schedule_delayed_work(&dev->sbutton_query_work,
-                             msecs_to_jiffies(EM28XX_SBUTTON_QUERY_INTERVAL));
-}
-
-void em28xx_register_snapshot_button(struct em28xx *dev)
-{
-       struct input_dev *input_dev;
-       int err;
-
-       em28xx_info("Registering snapshot button...\n");
-       input_dev = input_allocate_device();
-       if (!input_dev) {
-               em28xx_errdev("input_allocate_device failed\n");
-               return;
-       }
-
-       usb_make_path(dev->udev, dev->snapshot_button_path,
-                     sizeof(dev->snapshot_button_path));
-       strlcat(dev->snapshot_button_path, "/sbutton",
-               sizeof(dev->snapshot_button_path));
-       INIT_DELAYED_WORK(&dev->sbutton_query_work, em28xx_query_sbutton);
-
-       input_dev->name = "em28xx snapshot button";
-       input_dev->phys = dev->snapshot_button_path;
-       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
-       set_bit(EM28XX_SNAPSHOT_KEY, input_dev->keybit);
-       input_dev->keycodesize = 0;
-       input_dev->keycodemax = 0;
-       input_dev->id.bustype = BUS_USB;
-       input_dev->id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor);
-       input_dev->id.product = le16_to_cpu(dev->udev->descriptor.idProduct);
-       input_dev->id.version = 1;
-       input_dev->dev.parent = &dev->udev->dev;
-
-       err = input_register_device(input_dev);
-       if (err) {
-               em28xx_errdev("input_register_device failed\n");
-               input_free_device(input_dev);
-               return;
-       }
-
-       dev->sbutton_input_dev = input_dev;
-       schedule_delayed_work(&dev->sbutton_query_work,
-                             msecs_to_jiffies(EM28XX_SBUTTON_QUERY_INTERVAL));
-       return;
-
-}
-
-void em28xx_deregister_snapshot_button(struct em28xx *dev)
-{
-       if (dev->sbutton_input_dev != NULL) {
-               em28xx_info("Deregistering snapshot button\n");
-               cancel_delayed_work_sync(&dev->sbutton_query_work);
-               input_unregister_device(dev->sbutton_input_dev);
-               dev->sbutton_input_dev = NULL;
-       }
-       return;
-}
index c2a5a99398b069eba132950a735fa64d2121a1c9..005316fd071d692472e8e104941c8fe38cd751bd 100644 (file)
@@ -702,7 +702,6 @@ extern void em28xx_card_setup(struct em28xx *dev);
 extern struct em28xx_board em28xx_boards[];
 extern struct usb_device_id em28xx_id_table[];
 extern const unsigned int em28xx_bcount;
-void em28xx_register_i2c_ir(struct em28xx *dev);
 int em28xx_tuner_callback(void *ptr, int component, int command, int arg);
 void em28xx_release_resources(struct em28xx *dev);
 
@@ -710,27 +709,11 @@ void em28xx_release_resources(struct em28xx *dev);
 
 #ifdef CONFIG_VIDEO_EM28XX_RC
 
-int em28xx_get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw);
-int em28xx_get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw);
-int em28xx_get_key_pinnacle_usb_grey(struct IR_i2c *ir, u32 *ir_key,
-                                    u32 *ir_raw);
-int em28xx_get_key_winfast_usbii_deluxe(struct IR_i2c *ir, u32 *ir_key,
-                                    u32 *ir_raw);
-void em28xx_register_snapshot_button(struct em28xx *dev);
-void em28xx_deregister_snapshot_button(struct em28xx *dev);
-
 int em28xx_ir_init(struct em28xx *dev);
 int em28xx_ir_fini(struct em28xx *dev);
 
 #else
 
-#define em28xx_get_key_terratec                        NULL
-#define em28xx_get_key_em_haup                 NULL
-#define em28xx_get_key_pinnacle_usb_grey       NULL
-#define em28xx_get_key_winfast_usbii_deluxe    NULL
-
-static inline void em28xx_register_snapshot_button(struct em28xx *dev) {}
-static inline void em28xx_deregister_snapshot_button(struct em28xx *dev) {}
 static inline int em28xx_ir_init(struct em28xx *dev) { return 0; }
 static inline int em28xx_ir_fini(struct em28xx *dev) { return 0; }
 
This page took 0.028237 seconds and 5 git commands to generate.