Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-cao committed Jul 7, 2020
2 parents 8f6bd7c + 93436d7 commit a1a33ac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions cli/fabric.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*
*/

#ifdef __linux__

#include "commands.h"
#include "argconfig.h"
#include "common.h"
Expand Down Expand Up @@ -2041,3 +2043,5 @@ static struct subcommand subcmd = {
};

REGISTER_SUBCMD(subcmd);

#endif //__linux__
8 changes: 6 additions & 2 deletions lib/platform/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,14 @@ int switchtec_list(struct switchtec_device_info **devlist)

static int linux_get_device_id(struct switchtec_dev *dev)
{
int ret;
char link_path[PATH_MAX];
struct switchtec_linux *ldev = to_switchtec_linux(dev);

snprintf(link_path, sizeof(link_path), "%s/%s/device/device",
sys_path, basename(dev->name));
ret = dev_to_sysfs_path(ldev, "device/device", link_path,
sizeof(link_path));
if (ret)
return ret;

return sysfs_read_int(link_path, 16);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/switchtec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ static int log_a_to_file(struct switchtec_dev *dev, int sub_cmd_id,
cmd.start = res.hdr.next_start;
}

ret = read;
ret = 0;

ret_free_log_defs:
free_log_defs(&defs);
Expand Down Expand Up @@ -1157,7 +1157,7 @@ static int log_b_to_file(struct switchtec_dev *dev, int sub_cmd_id, int fd)
cmd.offset = htole32(read);
}

return read;
return 0;
}

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

0 comments on commit a1a33ac

Please sign in to comment.