hw/drivers/adp5061: Fix shell reg access by name
@@ -750,7 +750,7 @@ adp5061_shell_read_reg(int argc, char **argv)
for (i = 0; i < NUM_DEVICE_REGS; ++i) {
if ((status == 0 && adp5061_device_regs[i].addr == reg_ix) ||
- (strcmp(adp5061_device_regs[i].name, argv[3]) == 0)) {
+ (strcmp(adp5061_device_regs[i].name, argv[2]) == 0)) {
if (adp5061_get_reg(adp5061_dev,
adp5061_device_regs[i].addr, &reg_val)) {
console_printf("%21s [0x%02x] = READ ERROR \n",
@@ -798,7 +798,7 @@ adp5061_shell_write_reg(int argc, char **argv)
for (i = 0; i < NUM_DEVICE_REGS; ++i) {
if ((status == 0 && adp5061_device_regs[i].addr == reg_ix) ||
- (strcmp(adp5061_device_regs[i].name, argv[3]) == 0)) {
+ (strcmp(adp5061_device_regs[i].name, argv[2]) == 0)) {
rc = adp5061_set_reg(adp5061_dev, adp5061_device_regs[i].addr,
reg_val);
if (rc) {
