aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2015-02-21 21:53:43 -0500
committerLee Jones <lee.jones@linaro.org>2015-03-12 05:07:03 -0400
commit9a503a7d9ce0eafd4c9c4a73b9c45a53a4ed2314 (patch)
treec6b640b02ea39f399dc4b8c327a997d1272b744c /drivers
parent23a2a22a3f3f17de094f386a893f7047c10e44a0 (diff)
mfd: ab8500-debugfs: Remove use of seq_printf return value
The seq_printf return value, because it's frequently misused, will eventually be converted to void. See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to seq_has_overflowed() and make public") Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/ab8500-debugfs.c196
1 files changed, 121 insertions, 75 deletions
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 9a8e185f11df..cdd6f3d63314 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -1283,7 +1283,7 @@ static irqreturn_t ab8500_debug_handler(int irq, void *data)
1283 1283
1284/* Prints to seq_file or log_buf */ 1284/* Prints to seq_file or log_buf */
1285static int ab8500_registers_print(struct device *dev, u32 bank, 1285static int ab8500_registers_print(struct device *dev, u32 bank,
1286 struct seq_file *s) 1286 struct seq_file *s)
1287{ 1287{
1288 unsigned int i; 1288 unsigned int i;
1289 1289
@@ -1304,20 +1304,19 @@ static int ab8500_registers_print(struct device *dev, u32 bank,
1304 } 1304 }
1305 1305
1306 if (s) { 1306 if (s) {
1307 err = seq_printf(s, 1307 seq_printf(s, " [0x%02X/0x%02X]: 0x%02X\n",
1308 " [0x%02X/0x%02X]: 0x%02X\n", 1308 bank, reg, value);
1309 bank, reg, value); 1309 /* Error is not returned here since
1310 if (err < 0) { 1310 * the output is wanted in any case */
1311 /* Error is not returned here since 1311 if (seq_has_overflowed(s))
1312 * the output is wanted in any case */
1313 return 0; 1312 return 0;
1314 }
1315 } else { 1313 } else {
1316 dev_info(dev, " [0x%02X/0x%02X]: 0x%02X\n", 1314 dev_info(dev, " [0x%02X/0x%02X]: 0x%02X\n",
1317 bank, reg, value); 1315 bank, reg, value);
1318 } 1316 }
1319 } 1317 }
1320 } 1318 }
1319
1321 return 0; 1320 return 0;
1322} 1321}
1323 1322
@@ -1330,8 +1329,7 @@ static int ab8500_print_bank_registers(struct seq_file *s, void *p)
1330 1329
1331 seq_printf(s, " bank 0x%02X:\n", bank); 1330 seq_printf(s, " bank 0x%02X:\n", bank);
1332 1331
1333 ab8500_registers_print(dev, bank, s); 1332 return ab8500_registers_print(dev, bank, s);
1334 return 0;
1335} 1333}
1336 1334
1337static int ab8500_registers_open(struct inode *inode, struct file *file) 1335static int ab8500_registers_open(struct inode *inode, struct file *file)
@@ -1355,9 +1353,12 @@ static int ab8500_print_all_banks(struct seq_file *s, void *p)
1355 seq_puts(s, AB8500_NAME_STRING " register values:\n"); 1353 seq_puts(s, AB8500_NAME_STRING " register values:\n");
1356 1354
1357 for (i = 0; i < AB8500_NUM_BANKS; i++) { 1355 for (i = 0; i < AB8500_NUM_BANKS; i++) {
1358 seq_printf(s, " bank 0x%02X:\n", i); 1356 int err;
1359 1357
1360 ab8500_registers_print(dev, i, s); 1358 seq_printf(s, " bank 0x%02X:\n", i);
1359 err = ab8500_registers_print(dev, i, s);
1360 if (err)
1361 return err;
1361 } 1362 }
1362 return 0; 1363 return 0;
1363} 1364}
@@ -1458,7 +1459,8 @@ static const struct file_operations ab8500_all_banks_fops = {
1458 1459
1459static int ab8500_bank_print(struct seq_file *s, void *p) 1460static int ab8500_bank_print(struct seq_file *s, void *p)
1460{ 1461{
1461 return seq_printf(s, "0x%02X\n", debug_bank); 1462 seq_printf(s, "0x%02X\n", debug_bank);
1463 return 0;
1462} 1464}
1463 1465
1464static int ab8500_bank_open(struct inode *inode, struct file *file) 1466static int ab8500_bank_open(struct inode *inode, struct file *file)
@@ -1490,7 +1492,8 @@ static ssize_t ab8500_bank_write(struct file *file,
1490 1492
1491static int ab8500_address_print(struct seq_file *s, void *p) 1493static int ab8500_address_print(struct seq_file *s, void *p)
1492{ 1494{
1493 return seq_printf(s, "0x%02X\n", debug_address); 1495 seq_printf(s, "0x%02X\n", debug_address);
1496 return 0;
1494} 1497}
1495 1498
1496static int ab8500_address_open(struct inode *inode, struct file *file) 1499static int ab8500_address_open(struct inode *inode, struct file *file)
@@ -1598,7 +1601,8 @@ static int ab8500_interrupts_print(struct seq_file *s, void *p)
1598 for (line = 0; line < num_interrupt_lines; line++) { 1601 for (line = 0; line < num_interrupt_lines; line++) {
1599 struct irq_desc *desc = irq_to_desc(line + irq_first); 1602 struct irq_desc *desc = irq_to_desc(line + irq_first);
1600 1603
1601 seq_printf(s, "%3i: %6i %4i", line, 1604 seq_printf(s, "%3i: %6i %4i",
1605 line,
1602 num_interrupts[line], 1606 num_interrupts[line],
1603 num_wake_interrupts[line]); 1607 num_wake_interrupts[line]);
1604 1608
@@ -1705,8 +1709,7 @@ static int ab8500_print_modem_registers(struct seq_file *s, void *p)
1705 dev_err(dev, "ab->read fail %d\n", err); 1709 dev_err(dev, "ab->read fail %d\n", err);
1706 return err; 1710 return err;
1707 } 1711 }
1708 err = seq_printf(s, " [0x%02X/0x%02X]: 0x%02X\n", 1712 seq_printf(s, " [0x%02X/0x%02X]: 0x%02X\n", bank, reg, value);
1709 bank, reg, value);
1710 } 1713 }
1711 err = abx500_set_register_interruptible(dev, 1714 err = abx500_set_register_interruptible(dev,
1712 AB8500_REGU_CTRL1, AB8500_SUPPLY_CONTROL_REG, orig_value); 1715 AB8500_REGU_CTRL1, AB8500_SUPPLY_CONTROL_REG, orig_value);
@@ -1743,8 +1746,9 @@ static int ab8500_gpadc_bat_ctrl_print(struct seq_file *s, void *p)
1743 bat_ctrl_convert = ab8500_gpadc_ad_to_voltage(gpadc, 1746 bat_ctrl_convert = ab8500_gpadc_ad_to_voltage(gpadc,
1744 BAT_CTRL, bat_ctrl_raw); 1747 BAT_CTRL, bat_ctrl_raw);
1745 1748
1746 return seq_printf(s, "%d,0x%X\n", 1749 seq_printf(s, "%d,0x%X\n", bat_ctrl_convert, bat_ctrl_raw);
1747 bat_ctrl_convert, bat_ctrl_raw); 1750
1751 return 0;
1748} 1752}
1749 1753
1750static int ab8500_gpadc_bat_ctrl_open(struct inode *inode, struct file *file) 1754static int ab8500_gpadc_bat_ctrl_open(struct inode *inode, struct file *file)
@@ -1773,8 +1777,9 @@ static int ab8500_gpadc_btemp_ball_print(struct seq_file *s, void *p)
1773 btemp_ball_convert = ab8500_gpadc_ad_to_voltage(gpadc, BTEMP_BALL, 1777 btemp_ball_convert = ab8500_gpadc_ad_to_voltage(gpadc, BTEMP_BALL,
1774 btemp_ball_raw); 1778 btemp_ball_raw);
1775 1779
1776 return seq_printf(s, 1780 seq_printf(s, "%d,0x%X\n", btemp_ball_convert, btemp_ball_raw);
1777 "%d,0x%X\n", btemp_ball_convert, btemp_ball_raw); 1781
1782 return 0;
1778} 1783}
1779 1784
1780static int ab8500_gpadc_btemp_ball_open(struct inode *inode, 1785static int ab8500_gpadc_btemp_ball_open(struct inode *inode,
@@ -1804,8 +1809,9 @@ static int ab8500_gpadc_main_charger_v_print(struct seq_file *s, void *p)
1804 main_charger_v_convert = ab8500_gpadc_ad_to_voltage(gpadc, 1809 main_charger_v_convert = ab8500_gpadc_ad_to_voltage(gpadc,
1805 MAIN_CHARGER_V, main_charger_v_raw); 1810 MAIN_CHARGER_V, main_charger_v_raw);
1806 1811
1807 return seq_printf(s, "%d,0x%X\n", 1812 seq_printf(s, "%d,0x%X\n", main_charger_v_convert, main_charger_v_raw);
1808 main_charger_v_convert, main_charger_v_raw); 1813
1814 return 0;
1809} 1815}
1810 1816
1811static int ab8500_gpadc_main_charger_v_open(struct inode *inode, 1817static int ab8500_gpadc_main_charger_v_open(struct inode *inode,
@@ -1835,8 +1841,9 @@ static int ab8500_gpadc_acc_detect1_print(struct seq_file *s, void *p)
1835 acc_detect1_convert = ab8500_gpadc_ad_to_voltage(gpadc, ACC_DETECT1, 1841 acc_detect1_convert = ab8500_gpadc_ad_to_voltage(gpadc, ACC_DETECT1,
1836 acc_detect1_raw); 1842 acc_detect1_raw);
1837 1843
1838 return seq_printf(s, "%d,0x%X\n", 1844 seq_printf(s, "%d,0x%X\n", acc_detect1_convert, acc_detect1_raw);
1839 acc_detect1_convert, acc_detect1_raw); 1845
1846 return 0;
1840} 1847}
1841 1848
1842static int ab8500_gpadc_acc_detect1_open(struct inode *inode, 1849static int ab8500_gpadc_acc_detect1_open(struct inode *inode,
@@ -1866,8 +1873,9 @@ static int ab8500_gpadc_acc_detect2_print(struct seq_file *s, void *p)
1866 acc_detect2_convert = ab8500_gpadc_ad_to_voltage(gpadc, 1873 acc_detect2_convert = ab8500_gpadc_ad_to_voltage(gpadc,
1867 ACC_DETECT2, acc_detect2_raw); 1874 ACC_DETECT2, acc_detect2_raw);
1868 1875
1869 return seq_printf(s, "%d,0x%X\n", 1876 seq_printf(s, "%d,0x%X\n", acc_detect2_convert, acc_detect2_raw);
1870 acc_detect2_convert, acc_detect2_raw); 1877
1878 return 0;
1871} 1879}
1872 1880
1873static int ab8500_gpadc_acc_detect2_open(struct inode *inode, 1881static int ab8500_gpadc_acc_detect2_open(struct inode *inode,
@@ -1897,8 +1905,9 @@ static int ab8500_gpadc_aux1_print(struct seq_file *s, void *p)
1897 aux1_convert = ab8500_gpadc_ad_to_voltage(gpadc, ADC_AUX1, 1905 aux1_convert = ab8500_gpadc_ad_to_voltage(gpadc, ADC_AUX1,
1898 aux1_raw); 1906 aux1_raw);
1899 1907
1900 return seq_printf(s, "%d,0x%X\n", 1908 seq_printf(s, "%d,0x%X\n", aux1_convert, aux1_raw);
1901 aux1_convert, aux1_raw); 1909
1910 return 0;
1902} 1911}
1903 1912
1904static int ab8500_gpadc_aux1_open(struct inode *inode, struct file *file) 1913static int ab8500_gpadc_aux1_open(struct inode *inode, struct file *file)
@@ -1926,8 +1935,9 @@ static int ab8500_gpadc_aux2_print(struct seq_file *s, void *p)
1926 aux2_convert = ab8500_gpadc_ad_to_voltage(gpadc, ADC_AUX2, 1935 aux2_convert = ab8500_gpadc_ad_to_voltage(gpadc, ADC_AUX2,
1927 aux2_raw); 1936 aux2_raw);
1928 1937
1929 return seq_printf(s, "%d,0x%X\n", 1938 seq_printf(s, "%d,0x%X\n", aux2_convert, aux2_raw);
1930 aux2_convert, aux2_raw); 1939
1940 return 0;
1931} 1941}
1932 1942
1933static int ab8500_gpadc_aux2_open(struct inode *inode, struct file *file) 1943static int ab8500_gpadc_aux2_open(struct inode *inode, struct file *file)
@@ -1955,8 +1965,9 @@ static int ab8500_gpadc_main_bat_v_print(struct seq_file *s, void *p)
1955 main_bat_v_convert = ab8500_gpadc_ad_to_voltage(gpadc, MAIN_BAT_V, 1965 main_bat_v_convert = ab8500_gpadc_ad_to_voltage(gpadc, MAIN_BAT_V,
1956 main_bat_v_raw); 1966 main_bat_v_raw);
1957 1967
1958 return seq_printf(s, "%d,0x%X\n", 1968 seq_printf(s, "%d,0x%X\n", main_bat_v_convert, main_bat_v_raw);
1959 main_bat_v_convert, main_bat_v_raw); 1969
1970 return 0;
1960} 1971}
1961 1972
1962static int ab8500_gpadc_main_bat_v_open(struct inode *inode, 1973static int ab8500_gpadc_main_bat_v_open(struct inode *inode,
@@ -1986,8 +1997,9 @@ static int ab8500_gpadc_vbus_v_print(struct seq_file *s, void *p)
1986 vbus_v_convert = ab8500_gpadc_ad_to_voltage(gpadc, VBUS_V, 1997 vbus_v_convert = ab8500_gpadc_ad_to_voltage(gpadc, VBUS_V,
1987 vbus_v_raw); 1998 vbus_v_raw);
1988 1999
1989 return seq_printf(s, "%d,0x%X\n", 2000 seq_printf(s, "%d,0x%X\n", vbus_v_convert, vbus_v_raw);
1990 vbus_v_convert, vbus_v_raw); 2001
2002 return 0;
1991} 2003}
1992 2004
1993static int ab8500_gpadc_vbus_v_open(struct inode *inode, struct file *file) 2005static int ab8500_gpadc_vbus_v_open(struct inode *inode, struct file *file)
@@ -2015,8 +2027,9 @@ static int ab8500_gpadc_main_charger_c_print(struct seq_file *s, void *p)
2015 main_charger_c_convert = ab8500_gpadc_ad_to_voltage(gpadc, 2027 main_charger_c_convert = ab8500_gpadc_ad_to_voltage(gpadc,
2016 MAIN_CHARGER_C, main_charger_c_raw); 2028 MAIN_CHARGER_C, main_charger_c_raw);
2017 2029
2018 return seq_printf(s, "%d,0x%X\n", 2030 seq_printf(s, "%d,0x%X\n", main_charger_c_convert, main_charger_c_raw);
2019 main_charger_c_convert, main_charger_c_raw); 2031
2032 return 0;
2020} 2033}
2021 2034
2022static int ab8500_gpadc_main_charger_c_open(struct inode *inode, 2035static int ab8500_gpadc_main_charger_c_open(struct inode *inode,
@@ -2046,8 +2059,9 @@ static int ab8500_gpadc_usb_charger_c_print(struct seq_file *s, void *p)
2046 usb_charger_c_convert = ab8500_gpadc_ad_to_voltage(gpadc, 2059 usb_charger_c_convert = ab8500_gpadc_ad_to_voltage(gpadc,
2047 USB_CHARGER_C, usb_charger_c_raw); 2060 USB_CHARGER_C, usb_charger_c_raw);
2048 2061
2049 return seq_printf(s, "%d,0x%X\n", 2062 seq_printf(s, "%d,0x%X\n", usb_charger_c_convert, usb_charger_c_raw);
2050 usb_charger_c_convert, usb_charger_c_raw); 2063
2064 return 0;
2051} 2065}
2052 2066
2053static int ab8500_gpadc_usb_charger_c_open(struct inode *inode, 2067static int ab8500_gpadc_usb_charger_c_open(struct inode *inode,
@@ -2077,8 +2091,9 @@ static int ab8500_gpadc_bk_bat_v_print(struct seq_file *s, void *p)
2077 bk_bat_v_convert = ab8500_gpadc_ad_to_voltage(gpadc, 2091 bk_bat_v_convert = ab8500_gpadc_ad_to_voltage(gpadc,
2078 BK_BAT_V, bk_bat_v_raw); 2092 BK_BAT_V, bk_bat_v_raw);
2079 2093
2080 return seq_printf(s, "%d,0x%X\n", 2094 seq_printf(s, "%d,0x%X\n", bk_bat_v_convert, bk_bat_v_raw);
2081 bk_bat_v_convert, bk_bat_v_raw); 2095
2096 return 0;
2082} 2097}
2083 2098
2084static int ab8500_gpadc_bk_bat_v_open(struct inode *inode, struct file *file) 2099static int ab8500_gpadc_bk_bat_v_open(struct inode *inode, struct file *file)
@@ -2107,8 +2122,9 @@ static int ab8500_gpadc_die_temp_print(struct seq_file *s, void *p)
2107 die_temp_convert = ab8500_gpadc_ad_to_voltage(gpadc, DIE_TEMP, 2122 die_temp_convert = ab8500_gpadc_ad_to_voltage(gpadc, DIE_TEMP,
2108 die_temp_raw); 2123 die_temp_raw);
2109 2124
2110 return seq_printf(s, "%d,0x%X\n", 2125 seq_printf(s, "%d,0x%X\n", die_temp_convert, die_temp_raw);
2111 die_temp_convert, die_temp_raw); 2126
2127 return 0;
2112} 2128}
2113 2129
2114static int ab8500_gpadc_die_temp_open(struct inode *inode, struct file *file) 2130static int ab8500_gpadc_die_temp_open(struct inode *inode, struct file *file)
@@ -2137,8 +2153,9 @@ static int ab8500_gpadc_usb_id_print(struct seq_file *s, void *p)
2137 usb_id_convert = ab8500_gpadc_ad_to_voltage(gpadc, USB_ID, 2153 usb_id_convert = ab8500_gpadc_ad_to_voltage(gpadc, USB_ID,
2138 usb_id_raw); 2154 usb_id_raw);
2139 2155
2140 return seq_printf(s, "%d,0x%X\n", 2156 seq_printf(s, "%d,0x%X\n", usb_id_convert, usb_id_raw);
2141 usb_id_convert, usb_id_raw); 2157
2158 return 0;
2142} 2159}
2143 2160
2144static int ab8500_gpadc_usb_id_open(struct inode *inode, struct file *file) 2161static int ab8500_gpadc_usb_id_open(struct inode *inode, struct file *file)
@@ -2166,8 +2183,9 @@ static int ab8540_gpadc_xtal_temp_print(struct seq_file *s, void *p)
2166 xtal_temp_convert = ab8500_gpadc_ad_to_voltage(gpadc, XTAL_TEMP, 2183 xtal_temp_convert = ab8500_gpadc_ad_to_voltage(gpadc, XTAL_TEMP,
2167 xtal_temp_raw); 2184 xtal_temp_raw);
2168 2185
2169 return seq_printf(s, "%d,0x%X\n", 2186 seq_printf(s, "%d,0x%X\n", xtal_temp_convert, xtal_temp_raw);
2170 xtal_temp_convert, xtal_temp_raw); 2187
2188 return 0;
2171} 2189}
2172 2190
2173static int ab8540_gpadc_xtal_temp_open(struct inode *inode, struct file *file) 2191static int ab8540_gpadc_xtal_temp_open(struct inode *inode, struct file *file)
@@ -2197,8 +2215,9 @@ static int ab8540_gpadc_vbat_true_meas_print(struct seq_file *s, void *p)
2197 ab8500_gpadc_ad_to_voltage(gpadc, VBAT_TRUE_MEAS, 2215 ab8500_gpadc_ad_to_voltage(gpadc, VBAT_TRUE_MEAS,
2198 vbat_true_meas_raw); 2216 vbat_true_meas_raw);
2199 2217
2200 return seq_printf(s, "%d,0x%X\n", 2218 seq_printf(s, "%d,0x%X\n", vbat_true_meas_convert, vbat_true_meas_raw);
2201 vbat_true_meas_convert, vbat_true_meas_raw); 2219
2220 return 0;
2202} 2221}
2203 2222
2204static int ab8540_gpadc_vbat_true_meas_open(struct inode *inode, 2223static int ab8540_gpadc_vbat_true_meas_open(struct inode *inode,
@@ -2233,9 +2252,13 @@ static int ab8540_gpadc_bat_ctrl_and_ibat_print(struct seq_file *s, void *p)
2233 ibat_convert = ab8500_gpadc_ad_to_voltage(gpadc, IBAT_VIRTUAL_CHANNEL, 2252 ibat_convert = ab8500_gpadc_ad_to_voltage(gpadc, IBAT_VIRTUAL_CHANNEL,
2234 ibat_raw); 2253 ibat_raw);
2235 2254
2236 return seq_printf(s, "%d,0x%X\n" "%d,0x%X\n", 2255 seq_printf(s,
2237 bat_ctrl_convert, bat_ctrl_raw, 2256 "%d,0x%X\n"
2238 ibat_convert, ibat_raw); 2257 "%d,0x%X\n",
2258 bat_ctrl_convert, bat_ctrl_raw,
2259 ibat_convert, ibat_raw);
2260
2261 return 0;
2239} 2262}
2240 2263
2241static int ab8540_gpadc_bat_ctrl_and_ibat_open(struct inode *inode, 2264static int ab8540_gpadc_bat_ctrl_and_ibat_open(struct inode *inode,
@@ -2269,9 +2292,13 @@ static int ab8540_gpadc_vbat_meas_and_ibat_print(struct seq_file *s, void *p)
2269 ibat_convert = ab8500_gpadc_ad_to_voltage(gpadc, IBAT_VIRTUAL_CHANNEL, 2292 ibat_convert = ab8500_gpadc_ad_to_voltage(gpadc, IBAT_VIRTUAL_CHANNEL,
2270 ibat_raw); 2293 ibat_raw);
2271 2294
2272 return seq_printf(s, "%d,0x%X\n" "%d,0x%X\n", 2295 seq_printf(s,
2273 vbat_meas_convert, vbat_meas_raw, 2296 "%d,0x%X\n"
2274 ibat_convert, ibat_raw); 2297 "%d,0x%X\n",
2298 vbat_meas_convert, vbat_meas_raw,
2299 ibat_convert, ibat_raw);
2300
2301 return 0;
2275} 2302}
2276 2303
2277static int ab8540_gpadc_vbat_meas_and_ibat_open(struct inode *inode, 2304static int ab8540_gpadc_vbat_meas_and_ibat_open(struct inode *inode,
@@ -2307,9 +2334,13 @@ static int ab8540_gpadc_vbat_true_meas_and_ibat_print(struct seq_file *s,
2307 ibat_convert = ab8500_gpadc_ad_to_voltage(gpadc, IBAT_VIRTUAL_CHANNEL, 2334 ibat_convert = ab8500_gpadc_ad_to_voltage(gpadc, IBAT_VIRTUAL_CHANNEL,
2308 ibat_raw); 2335 ibat_raw);
2309 2336
2310 return seq_printf(s, "%d,0x%X\n" "%d,0x%X\n", 2337 seq_printf(s,
2311 vbat_true_meas_convert, vbat_true_meas_raw, 2338 "%d,0x%X\n"
2312 ibat_convert, ibat_raw); 2339 "%d,0x%X\n",
2340 vbat_true_meas_convert, vbat_true_meas_raw,
2341 ibat_convert, ibat_raw);
2342
2343 return 0;
2313} 2344}
2314 2345
2315static int ab8540_gpadc_vbat_true_meas_and_ibat_open(struct inode *inode, 2346static int ab8540_gpadc_vbat_true_meas_and_ibat_open(struct inode *inode,
@@ -2344,9 +2375,13 @@ static int ab8540_gpadc_bat_temp_and_ibat_print(struct seq_file *s, void *p)
2344 ibat_convert = ab8500_gpadc_ad_to_voltage(gpadc, IBAT_VIRTUAL_CHANNEL, 2375 ibat_convert = ab8500_gpadc_ad_to_voltage(gpadc, IBAT_VIRTUAL_CHANNEL,
2345 ibat_raw); 2376 ibat_raw);
2346 2377
2347 return seq_printf(s, "%d,0x%X\n" "%d,0x%X\n", 2378 seq_printf(s,
2348 bat_temp_convert, bat_temp_raw, 2379 "%d,0x%X\n"
2349 ibat_convert, ibat_raw); 2380 "%d,0x%X\n",
2381 bat_temp_convert, bat_temp_raw,
2382 ibat_convert, ibat_raw);
2383
2384 return 0;
2350} 2385}
2351 2386
2352static int ab8540_gpadc_bat_temp_and_ibat_open(struct inode *inode, 2387static int ab8540_gpadc_bat_temp_and_ibat_open(struct inode *inode,
@@ -2373,16 +2408,19 @@ static int ab8540_gpadc_otp_cal_print(struct seq_file *s, void *p)
2373 gpadc = ab8500_gpadc_get("ab8500-gpadc.0"); 2408 gpadc = ab8500_gpadc_get("ab8500-gpadc.0");
2374 ab8540_gpadc_get_otp(gpadc, &vmain_l, &vmain_h, &btemp_l, &btemp_h, 2409 ab8540_gpadc_get_otp(gpadc, &vmain_l, &vmain_h, &btemp_l, &btemp_h,
2375 &vbat_l, &vbat_h, &ibat_l, &ibat_h); 2410 &vbat_l, &vbat_h, &ibat_l, &ibat_h);
2376 return seq_printf(s, "VMAIN_L:0x%X\n" 2411 seq_printf(s,
2377 "VMAIN_H:0x%X\n" 2412 "VMAIN_L:0x%X\n"
2378 "BTEMP_L:0x%X\n" 2413 "VMAIN_H:0x%X\n"
2379 "BTEMP_H:0x%X\n" 2414 "BTEMP_L:0x%X\n"
2380 "VBAT_L:0x%X\n" 2415 "BTEMP_H:0x%X\n"
2381 "VBAT_H:0x%X\n" 2416 "VBAT_L:0x%X\n"
2382 "IBAT_L:0x%X\n" 2417 "VBAT_H:0x%X\n"
2383 "IBAT_H:0x%X\n", 2418 "IBAT_L:0x%X\n"
2384 vmain_l, vmain_h, btemp_l, btemp_h, 2419 "IBAT_H:0x%X\n",
2385 vbat_l, vbat_h, ibat_l, ibat_h); 2420 vmain_l, vmain_h, btemp_l, btemp_h,
2421 vbat_l, vbat_h, ibat_l, ibat_h);
2422
2423 return 0;
2386} 2424}
2387 2425
2388static int ab8540_gpadc_otp_cal_open(struct inode *inode, struct file *file) 2426static int ab8540_gpadc_otp_cal_open(struct inode *inode, struct file *file)
@@ -2400,7 +2438,9 @@ static const struct file_operations ab8540_gpadc_otp_calib_fops = {
2400 2438
2401static int ab8500_gpadc_avg_sample_print(struct seq_file *s, void *p) 2439static int ab8500_gpadc_avg_sample_print(struct seq_file *s, void *p)
2402{ 2440{
2403 return seq_printf(s, "%d\n", avg_sample); 2441 seq_printf(s, "%d\n", avg_sample);
2442
2443 return 0;
2404} 2444}
2405 2445
2406static int ab8500_gpadc_avg_sample_open(struct inode *inode, struct file *file) 2446static int ab8500_gpadc_avg_sample_open(struct inode *inode, struct file *file)
@@ -2445,7 +2485,9 @@ static const struct file_operations ab8500_gpadc_avg_sample_fops = {
2445 2485
2446static int ab8500_gpadc_trig_edge_print(struct seq_file *s, void *p) 2486static int ab8500_gpadc_trig_edge_print(struct seq_file *s, void *p)
2447{ 2487{
2448 return seq_printf(s, "%d\n", trig_edge); 2488 seq_printf(s, "%d\n", trig_edge);
2489
2490 return 0;
2449} 2491}
2450 2492
2451static int ab8500_gpadc_trig_edge_open(struct inode *inode, struct file *file) 2493static int ab8500_gpadc_trig_edge_open(struct inode *inode, struct file *file)
@@ -2490,7 +2532,9 @@ static const struct file_operations ab8500_gpadc_trig_edge_fops = {
2490 2532
2491static int ab8500_gpadc_trig_timer_print(struct seq_file *s, void *p) 2533static int ab8500_gpadc_trig_timer_print(struct seq_file *s, void *p)
2492{ 2534{
2493 return seq_printf(s, "%d\n", trig_timer); 2535 seq_printf(s, "%d\n", trig_timer);
2536
2537 return 0;
2494} 2538}
2495 2539
2496static int ab8500_gpadc_trig_timer_open(struct inode *inode, struct file *file) 2540static int ab8500_gpadc_trig_timer_open(struct inode *inode, struct file *file)
@@ -2533,7 +2577,9 @@ static const struct file_operations ab8500_gpadc_trig_timer_fops = {
2533 2577
2534static int ab8500_gpadc_conv_type_print(struct seq_file *s, void *p) 2578static int ab8500_gpadc_conv_type_print(struct seq_file *s, void *p)
2535{ 2579{
2536 return seq_printf(s, "%d\n", conv_type); 2580 seq_printf(s, "%d\n", conv_type);
2581
2582 return 0;
2537} 2583}
2538 2584
2539static int ab8500_gpadc_conv_type_open(struct inode *inode, struct file *file) 2585static int ab8500_gpadc_conv_type_open(struct inode *inode, struct file *file)