Commit 85bca307 authored by Federico Vaga's avatar Federico Vaga

sW:lib: save device ID

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent daba3b67
...@@ -107,9 +107,10 @@ struct fmctdc_board *fmctdc_open(int dev_id) ...@@ -107,9 +107,10 @@ struct fmctdc_board *fmctdc_open(int dev_id)
if (!b) if (!b)
return NULL; return NULL;
b->dev_id = dev_id;
/* get sysfs */ /* get sysfs */
snprintf(path, sizeof(path), snprintf(path, sizeof(path),
"/sys/bus/zio/devices/tdc-1n5c-%04x", dev_id); "/sys/bus/zio/devices/tdc-1n5c-%04x", b->dev_id);
ret = stat(path, &sb); ret = stat(path, &sb);
if (ret < 0) if (ret < 0)
goto err_stat_s; goto err_stat_s;
...@@ -119,7 +120,7 @@ struct fmctdc_board *fmctdc_open(int dev_id) ...@@ -119,7 +120,7 @@ struct fmctdc_board *fmctdc_open(int dev_id)
/* get dev */ /* get dev */
snprintf(path, sizeof(path), snprintf(path, sizeof(path),
"/dev/zio/tdc-1n5c-%04x-0-0-ctrl", dev_id); "/dev/zio/tdc-1n5c-%04x-0-0-ctrl", b->dev_id);
ret = stat(path, &sb); ret = stat(path, &sb);
if (ret < 0) if (ret < 0)
goto err_stat_d; goto err_stat_d;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment