summaryrefslogtreecommitdiff
path: root/lib/conf-parse.y
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-08-19 15:04:29 +0000
committerJean Delvare <khali@linux-fr.org>2007-08-19 15:04:29 +0000
commita74addb5d48a367362fdcb9e8c3fad87f7f86b72 (patch)
tree7186b9a1dd6ba4617f99e0624ab624af55b0127d /lib/conf-parse.y
parent7ee15371dfd3354b296e9636614d9d0c014a964c (diff)
downloadlm-sensors-git-a74addb5d48a367362fdcb9e8c3fad87f7f86b72.tar.gz
Support more bus types (part 2 of 2). Originally libsensors was very
i2c-centric. Make it more neutral so that we can cleanly support additional bus types such as SPI or One-Wire. This second part updates sensors_bus to use sensors_bus_id. Thanks to Mark M. Hoffman for showing me how the configuration file parser could be modified to support that change. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4687 7894878c-1315-0410-8ee3-d5d059ff63e0
Diffstat (limited to 'lib/conf-parse.y')
-rw-r--r--lib/conf-parse.y14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/conf-parse.y b/lib/conf-parse.y
index 88a1cf49..3df1f808 100644
--- a/lib/conf-parse.y
+++ b/lib/conf-parse.y
@@ -94,7 +94,7 @@ static sensors_chip *current_chip = NULL;
void *nothing;
sensors_chip_name_list chips;
sensors_expr *expr;
- int bus;
+ sensors_bus_id bus;
sensors_chip_name chip;
int line;
}
@@ -118,7 +118,7 @@ static sensors_chip *current_chip = NULL;
%type <chips> chip_name_list
%type <expr> expression
-%type <bus> i2cbus_name
+%type <bus> bus_id
%type <name> adapter_name
%type <name> function_name
%type <name> string
@@ -141,10 +141,10 @@ line: bus_statement EOL
| error EOL
;
-bus_statement: BUS i2cbus_name adapter_name
+bus_statement: BUS bus_id adapter_name
{ sensors_bus new_el;
new_el.lineno = $1;
- new_el.number = $2;
+ new_el.bus = $2;
new_el.adapter = $3;
bus_add_el(&new_el);
}
@@ -287,11 +287,11 @@ expression: FLOAT
}
;
-i2cbus_name: NAME
- { int res = sensors_parse_i2cbus_name($1,&$$);
+bus_id: NAME
+ { int res = sensors_parse_bus_id($1,&$$);
free($1);
if (res) {
- sensors_yyerror("Parse error in i2c bus name");
+ sensors_yyerror("Parse error in bus id");
YYERROR;
}
}