diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-06-25 13:54:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-07-18 13:24:20 -0400 |
commit | 829ea96477e775df0698b54dbfa913b6b55a4d6d (patch) | |
tree | 5c43bc6c9d0d9f1658cdc3286bf87bbc3d0cc837 /drivers | |
parent | e7d11ecbde987e56845cff012b4a28d7001667b8 (diff) |
V4L/DVB (5788): Cx88-input: convert nested if's to switch..case
In the function, cx88_ir_handle_key:
- convert nested if statement to a switch..case block
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/cx88/cx88-input.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index 22cbdf2f0fdd..f5d4a565346e 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c | |||
@@ -74,7 +74,8 @@ static void cx88_ir_handle_key(struct cx88_IR *ir) | |||
74 | 74 | ||
75 | /* read gpio value */ | 75 | /* read gpio value */ |
76 | gpio = cx_read(ir->gpio_addr); | 76 | gpio = cx_read(ir->gpio_addr); |
77 | if (core->board == CX88_BOARD_NPGTECH_REALTV_TOP10FM) { | 77 | switch (core->board) { |
78 | case CX88_BOARD_NPGTECH_REALTV_TOP10FM: | ||
78 | /* This board apparently uses a combination of 2 GPIO | 79 | /* This board apparently uses a combination of 2 GPIO |
79 | to represent the keys. Additionally, the second GPIO | 80 | to represent the keys. Additionally, the second GPIO |
80 | can be used for parity. | 81 | can be used for parity. |
@@ -90,12 +91,14 @@ static void cx88_ir_handle_key(struct cx88_IR *ir) | |||
90 | auxgpio = cx_read(MO_GP1_IO); | 91 | auxgpio = cx_read(MO_GP1_IO); |
91 | /* Take out the parity part */ | 92 | /* Take out the parity part */ |
92 | gpio=(gpio & 0x7fd) + (auxgpio & 0xef); | 93 | gpio=(gpio & 0x7fd) + (auxgpio & 0xef); |
93 | } else if (core->board == CX88_BOARD_WINFAST_DTV1000) { | 94 | break; |
95 | case CX88_BOARD_WINFAST_DTV1000: | ||
94 | gpio = (gpio & 0x6ff) | ((cx_read(MO_GP1_IO) << 8) & 0x900); | 96 | gpio = (gpio & 0x6ff) | ((cx_read(MO_GP1_IO) << 8) & 0x900); |
95 | auxgpio = gpio; | 97 | auxgpio = gpio; |
96 | } else | 98 | break; |
99 | default: | ||
97 | auxgpio = gpio; | 100 | auxgpio = gpio; |
98 | 101 | } | |
99 | if (ir->polling) { | 102 | if (ir->polling) { |
100 | if (ir->last_gpio == auxgpio) | 103 | if (ir->last_gpio == auxgpio) |
101 | return; | 104 | return; |