diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-03-26 23:36:00 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-03-26 23:36:00 -0400 |
commit | cd00b1154d3c7d711e83c3c17b831aafe6377532 (patch) | |
tree | a889195111765a9db3677dca35dfebc898607441 /drivers/video/via/dvi.c | |
parent | 7f980a06e4a9e3bb26db91da8f0e980b0786023a (diff) |
viafb: replace custom return values
This patch replaces OK/FAIL by true/false which is simpler and saner.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/via/dvi.c')
-rw-r--r-- | drivers/video/via/dvi.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/video/via/dvi.c b/drivers/video/via/dvi.c index 3dbcd7743f14..b1f364745ca0 100644 --- a/drivers/video/via/dvi.c +++ b/drivers/video/via/dvi.c | |||
@@ -30,12 +30,9 @@ static void __devinit dvi_get_panel_size_from_DDCv1( | |||
30 | struct tmds_setting_information *tmds_setting); | 30 | struct tmds_setting_information *tmds_setting); |
31 | static int viafb_dvi_query_EDID(void); | 31 | static int viafb_dvi_query_EDID(void); |
32 | 32 | ||
33 | static int check_tmds_chip(int device_id_subaddr, int device_id) | 33 | static inline bool check_tmds_chip(int device_id_subaddr, int device_id) |
34 | { | 34 | { |
35 | if (tmds_register_read(device_id_subaddr) == device_id) | 35 | return tmds_register_read(device_id_subaddr) == device_id; |
36 | return OK; | ||
37 | else | ||
38 | return FAIL; | ||
39 | } | 36 | } |
40 | 37 | ||
41 | void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip, | 38 | void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip, |
@@ -50,7 +47,7 @@ void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip, | |||
50 | return; | 47 | return; |
51 | } | 48 | } |
52 | 49 | ||
53 | int __devinit viafb_tmds_trasmitter_identify(void) | 50 | bool __devinit viafb_tmds_trasmitter_identify(void) |
54 | { | 51 | { |
55 | unsigned char sr2a = 0, sr1e = 0, sr3e = 0; | 52 | unsigned char sr2a = 0, sr1e = 0, sr3e = 0; |
56 | 53 | ||
@@ -89,7 +86,7 @@ int __devinit viafb_tmds_trasmitter_identify(void) | |||
89 | viaparinfo->chip_info-> | 86 | viaparinfo->chip_info-> |
90 | tmds_chip_info.tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR; | 87 | tmds_chip_info.tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR; |
91 | viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_31; | 88 | viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_31; |
92 | if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID) != FAIL) { | 89 | if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID)) { |
93 | /* | 90 | /* |
94 | * Currently only support 12bits,dual edge,add 24bits mode later | 91 | * Currently only support 12bits,dual edge,add 24bits mode later |
95 | */ | 92 | */ |
@@ -100,11 +97,10 @@ int __devinit viafb_tmds_trasmitter_identify(void) | |||
100 | viaparinfo->chip_info->tmds_chip_info.tmds_chip_name); | 97 | viaparinfo->chip_info->tmds_chip_info.tmds_chip_name); |
101 | DEBUG_MSG(KERN_INFO "\n %2d", | 98 | DEBUG_MSG(KERN_INFO "\n %2d", |
102 | viaparinfo->chip_info->tmds_chip_info.i2c_port); | 99 | viaparinfo->chip_info->tmds_chip_info.i2c_port); |
103 | return OK; | 100 | return true; |
104 | } else { | 101 | } else { |
105 | viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_2C; | 102 | viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_2C; |
106 | if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID) | 103 | if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID)) { |
107 | != FAIL) { | ||
108 | tmds_register_write(0x08, 0x3b); | 104 | tmds_register_write(0x08, 0x3b); |
109 | DEBUG_MSG(KERN_INFO "\n VT1632 TMDS ! \n"); | 105 | DEBUG_MSG(KERN_INFO "\n VT1632 TMDS ! \n"); |
110 | DEBUG_MSG(KERN_INFO "\n %2d", | 106 | DEBUG_MSG(KERN_INFO "\n %2d", |
@@ -113,7 +109,7 @@ int __devinit viafb_tmds_trasmitter_identify(void) | |||
113 | DEBUG_MSG(KERN_INFO "\n %2d", | 109 | DEBUG_MSG(KERN_INFO "\n %2d", |
114 | viaparinfo->chip_info-> | 110 | viaparinfo->chip_info-> |
115 | tmds_chip_info.i2c_port); | 111 | tmds_chip_info.i2c_port); |
116 | return OK; | 112 | return true; |
117 | } | 113 | } |
118 | } | 114 | } |
119 | 115 | ||
@@ -123,7 +119,7 @@ int __devinit viafb_tmds_trasmitter_identify(void) | |||
123 | ((viafb_display_hardware_layout == HW_LAYOUT_DVI_ONLY) || | 119 | ((viafb_display_hardware_layout == HW_LAYOUT_DVI_ONLY) || |
124 | (viafb_display_hardware_layout == HW_LAYOUT_LCD_DVI))) { | 120 | (viafb_display_hardware_layout == HW_LAYOUT_LCD_DVI))) { |
125 | DEBUG_MSG(KERN_INFO "\n Integrated TMDS ! \n"); | 121 | DEBUG_MSG(KERN_INFO "\n Integrated TMDS ! \n"); |
126 | return OK; | 122 | return true; |
127 | } | 123 | } |
128 | 124 | ||
129 | switch (viaparinfo->chip_info->gfx_chip_name) { | 125 | switch (viaparinfo->chip_info->gfx_chip_name) { |
@@ -147,7 +143,7 @@ int __devinit viafb_tmds_trasmitter_identify(void) | |||
147 | tmds_chip_info.tmds_chip_name = NON_TMDS_TRANSMITTER; | 143 | tmds_chip_info.tmds_chip_name = NON_TMDS_TRANSMITTER; |
148 | viaparinfo->chip_info->tmds_chip_info. | 144 | viaparinfo->chip_info->tmds_chip_info. |
149 | tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR; | 145 | tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR; |
150 | return FAIL; | 146 | return false; |
151 | } | 147 | } |
152 | 148 | ||
153 | static void tmds_register_write(int index, u8 data) | 149 | static void tmds_register_write(int index, u8 data) |