]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[media] rc-core: Code cleanup after merging rc-sysfs and rc-map into rc-main
authorDavid Härdeman <david@hardeman.nu>
Wed, 10 Nov 2010 14:04:19 +0000 (11:04 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 29 Dec 2010 10:16:37 +0000 (08:16 -0200)
[mchehab@redhat.com: this patch were originally bundled with some renaming
stuff and with the file merges, as seen at:
https://patchwork.kernel.org/patch/291092/.

Instead of using the original approach, I wrote the rename patches and the
code merge as separate changes, then applied the difference on this patch.
This way, it is easier to see the real changes at the code, and will be easier
to merge upstream, especially if some conflict rises on the renaming patches]

Signed-off-by: David Härdeman <david@hardeman.nu>
Acked-by: Jarod Wilson <jarod@redhat.com>
Tested-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/rc/rc-core-priv.h
drivers/media/rc/rc-main.c
include/media/ir-core.h

index 81c936bd793f1bf5c7b337c1dfbf09709be24891..4be075780ad036c3b539c1a5895932b30147e0b1 100644 (file)
@@ -129,14 +129,6 @@ static inline bool is_timing_event(struct ir_raw_event ev)
 
 #define TO_US(duration)                        DIV_ROUND_CLOSEST((duration), 1000)
 #define TO_STR(is_pulse)               ((is_pulse) ? "pulse" : "space")
-/*
- * Routines from ir-sysfs.c - Meant to be called only internally inside
- * ir-core
- */
-int ir_register_input(struct input_dev *input_dev);
-
-int ir_register_class(struct input_dev *input_dev);
-void ir_unregister_class(struct input_dev *input_dev);
 
 /*
  * Routines from ir-raw-event.c to be used internally and by decoders
@@ -148,8 +140,6 @@ int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler);
 void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler);
 void ir_raw_init(void);
 
-int ir_rcmap_init(void);
-void ir_rcmap_cleanup(void);
 /*
  * Decoder initialization code
  *
index afcf0a88464dc0d07a074351da71b429843fc0a5..67a6bd5d94978e83f6bce2033ba8b67b4e850b53 100644 (file)
@@ -32,10 +32,16 @@ static unsigned long ir_core_dev_number;
 /* FIXME: IR_KEYPRESS_TIMEOUT should be protocol specific */
 #define IR_KEYPRESS_TIMEOUT 250
 
-/* Used to handle IR raw handler extensions */
+/* Used to keep track of known keymaps */
 static LIST_HEAD(rc_map_list);
 static DEFINE_SPINLOCK(rc_map_lock);
 
+/* Forward declarations */
+static int ir_register_class(struct input_dev *input_dev);
+static void ir_unregister_class(struct input_dev *input_dev);
+static int ir_register_input(struct input_dev *input_dev);
+
+
 static struct rc_keymap *seek_rc_map(const char *name)
 {
        struct rc_keymap *map = NULL;
@@ -112,16 +118,6 @@ static struct rc_keymap empty_map = {
        }
 };
 
-int ir_rcmap_init(void)
-{
-       return ir_register_map(&empty_map);
-}
-
-void ir_rcmap_cleanup(void)
-{
-       ir_unregister_map(&empty_map);
-}
-
 /**
  * ir_create_table() - initializes a scancode table
  * @rc_tab:    the ir_scancode_table to initialize
@@ -265,7 +261,7 @@ static unsigned int ir_update_mapping(struct input_dev *dev,
 }
 
 /**
- * ir_locate_scancode() - set a keycode in the scancode->keycode table
+ * ir_establish_scancode() - set a keycode in the scancode->keycode table
  * @ir_dev:    the struct ir_input_dev device descriptor
  * @rc_tab:    scancode table to be searched
  * @scancode:  the desired scancode
@@ -1097,7 +1093,7 @@ static struct device_type rc_dev_type = {
  *
  * This routine is used to register the syfs code for IR class
  */
-int ir_register_class(struct input_dev *input_dev)
+static int ir_register_class(struct input_dev *input_dev)
 {
        struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
        int devno = find_first_zero_bit(&ir_core_dev_number,
@@ -1122,7 +1118,7 @@ int ir_register_class(struct input_dev *input_dev)
  * @input_dev: the struct input_dev descriptor of the device
  */
 
-int ir_register_input(struct input_dev *input_dev)
+static int ir_register_input(struct input_dev *input_dev)
 {
        struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
        int rc;
@@ -1155,7 +1151,7 @@ int ir_register_input(struct input_dev *input_dev)
  *
  * This routine is used to unregister the syfs code for IR class
  */
-void ir_unregister_class(struct input_dev *input_dev)
+static void ir_unregister_class(struct input_dev *input_dev)
 {
        struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
 
@@ -1181,7 +1177,7 @@ static int __init ir_core_init(void)
 
        /* Initialize/load the decoders/keymap code that will be used */
        ir_raw_init();
-       ir_rcmap_init();
+       ir_register_map(&empty_map);
 
        return 0;
 }
@@ -1189,7 +1185,7 @@ static int __init ir_core_init(void)
 static void __exit ir_core_exit(void)
 {
        class_unregister(&ir_input_class);
-       ir_rcmap_cleanup();
+       ir_unregister_map(&empty_map);
 }
 
 module_init(ir_core_init);
index 53048a2eefb93733797123325cb2d41b7eb3ea5f..d41502d9919c514468ddc6c1d7e4ac3897bd485c 100644 (file)
@@ -117,7 +117,6 @@ enum raw_event_type {
 
 #define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr)
 
-/* From ir-keytable.c */
 int __ir_input_register(struct input_dev *dev,
                      const struct ir_scancode_table *ir_codes,
                      struct ir_dev_props *props,
@@ -164,7 +163,6 @@ void ir_keyup(struct input_dev *dev);
 u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode);
 
 /* From ir-raw-event.c */
-
 struct ir_raw_event {
        union {
                u32             duration;