@@ -15,10 +15,13 @@ static unsigned char onsemi_addrs[] = {0x20, 0};
1515static unsigned char gc_addrs [] = {0x6e , 0x52 , 0 };
1616static unsigned char soi_addrs [] = {0x60 , 0x80 , 0 };
1717
18- sensor_addr_t ingenic_possible_i2c_addrs [] = {
19- {SENSOR_SONY , sony_addrs }, {SENSOR_SMARTSENS , ssens_addrs },
20- {SENSOR_ONSEMI , onsemi_addrs }, {SENSOR_OMNIVISION , omni_addrs },
21- {SENSOR_GALAXYCORE , gc_addrs }, {SENSOR_SOI , soi_addrs }, {0 , NULL }};
18+ sensor_addr_t ingenic_possible_i2c_addrs [] = {{SENSOR_SONY , sony_addrs },
19+ {SENSOR_SMARTSENS , ssens_addrs },
20+ {SENSOR_ONSEMI , onsemi_addrs },
21+ {SENSOR_OMNIVISION , omni_addrs },
22+ {SENSOR_GALAXYCORE , gc_addrs },
23+ {SENSOR_SOI , soi_addrs },
24+ {0 , NULL }};
2225
2326typedef unsigned char uint8 ;
2427typedef unsigned short uint16 ;
@@ -219,8 +222,7 @@ bool ingenic_detect_cpu(char *chip_name) {
219222static unsigned long ingenic_media_mem () {
220223 char buf [256 ];
221224
222- if (!get_regex_line_from_file ("/proc/cmdline" , "rmem=([0-9x]+)" , buf ,
223- sizeof (buf )))
225+ if (!line_from_file ("/proc/cmdline" , "rmem=([0-9x]+)" , buf , sizeof (buf )))
224226 return 0 ;
225227 return strtoul (buf , NULL , 10 );
226228}
@@ -233,8 +235,8 @@ unsigned long ingenic_totalmem(unsigned long *media_mem) {
233235float ingenic_get_temp () {
234236 float ret = -237.0 ;
235237 char buf [16 ];
236- if (get_regex_line_from_file ("/sys/class/thermal/thermal_zone0/temp" ,
237- "(.+)" , buf , sizeof (buf ))) {
238+ if (line_from_file ("/sys/class/thermal/thermal_zone0/temp" , "(.+)" , buf ,
239+ sizeof (buf ))) {
238240 ret = strtof (buf , NULL );
239241 }
240242 return ret ;
0 commit comments