Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ main(int argc, char *const *argv) {
}

const char *cmd = argv[optind++];
optind = 0; /* reset */

int fd = pmbus_open(opt_bus, opt_addr);
if (fd < 0) {
Expand All @@ -111,6 +110,8 @@ main(int argc, char *const *argv) {
int sub_argc = argc - optind;
char * const *sub_argv = &argv[optind];

optind = 0; /* reset */

if (!strcmp(cmd, "read")) {
rc = cmd_read(fd, sub_argc, sub_argv, opt_pretty);
goto fini;
Expand Down
4 changes: 2 additions & 2 deletions src/mfr_restart.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

int
cmd_restart(int fd) {
const char *s = "00000000";
const char *s = "ERIC";

if (pmbus_wr_block(fd, MFR_RESTART, (const uint8_t *) s, 8) < 0) {
if (pmbus_wr_block(fd, MFR_RESTART, (const uint8_t *) s, 4) < 0) {
perror("MFR_RESTART");
return 1;
}
Expand Down