Skip to content

Commit a1a33ac

Browse files
committed
Merge branch 'devel'
2 parents 8f6bd7c + 93436d7 commit a1a33ac

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

cli/fabric.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
*
2323
*/
2424

25+
#ifdef __linux__
26+
2527
#include "commands.h"
2628
#include "argconfig.h"
2729
#include "common.h"
@@ -2041,3 +2043,5 @@ static struct subcommand subcmd = {
20412043
};
20422044

20432045
REGISTER_SUBCMD(subcmd);
2046+
2047+
#endif //__linux__

lib/platform/linux.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,14 @@ int switchtec_list(struct switchtec_device_info **devlist)
267267

268268
static int linux_get_device_id(struct switchtec_dev *dev)
269269
{
270+
int ret;
270271
char link_path[PATH_MAX];
272+
struct switchtec_linux *ldev = to_switchtec_linux(dev);
271273

272-
snprintf(link_path, sizeof(link_path), "%s/%s/device/device",
273-
sys_path, basename(dev->name));
274+
ret = dev_to_sysfs_path(ldev, "device/device", link_path,
275+
sizeof(link_path));
276+
if (ret)
277+
return ret;
274278

275279
return sysfs_read_int(link_path, 16);
276280
}

lib/switchtec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ static int log_a_to_file(struct switchtec_dev *dev, int sub_cmd_id,
11231123
cmd.start = res.hdr.next_start;
11241124
}
11251125

1126-
ret = read;
1126+
ret = 0;
11271127

11281128
ret_free_log_defs:
11291129
free_log_defs(&defs);
@@ -1157,7 +1157,7 @@ static int log_b_to_file(struct switchtec_dev *dev, int sub_cmd_id, int fd)
11571157
cmd.offset = htole32(read);
11581158
}
11591159

1160-
return read;
1160+
return 0;
11611161
}
11621162

11631163
static int log_c_to_file(struct switchtec_dev *dev, int sub_cmd_id, int fd)

0 commit comments

Comments
 (0)