staging: most: usb: pass correct register table
authorChristian Gromm <christian.gromm@microchip.com>
Fri, 7 Apr 2017 13:38:40 +0000 (15:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Apr 2017 10:41:40 +0000 (12:41 +0200)
Inside the function store_value() the table of writable registers need to
be passed to function get_static_reg_addr() or else the correct register
address is never going to be found.

Reported-by: Alex Riesen <alexander.riesen@cetitec.com>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/hdm-usb/hdm_usb.c

index ad907e9c59bbb3daf2e61b85454b3f5f5ad2856e..477c0ed305d36600b3035a63f7dfc57b268e9364 100644 (file)
@@ -1005,7 +1005,7 @@ static ssize_t store_value(struct most_dci_obj *dci_obj,
                err = drci_wr_reg(usb_dev, dci_obj->reg_addr, val);
        else if (!strcmp(name, "sync_ep"))
                err = start_sync_ep(usb_dev, val);
-       else if (!get_static_reg_addr(ro_regs, name, &reg_addr))
+       else if (!get_static_reg_addr(rw_regs, name, &reg_addr))
                err = drci_wr_reg(usb_dev, reg_addr, val);
        else
                return -EFAULT;