]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc2: fix dwc2_get_device_property for u8 and u16
authorStefan Wahren <stefan.wahren@i2se.com>
Sun, 20 Nov 2016 21:26:03 +0000 (21:26 +0000)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 2 Jan 2017 08:55:28 +0000 (10:55 +0200)
commit48c4ad6e9d234c5e204658534256098d73d4fb7a
tree19438576fd7a42914a006560dae1b9749f9f86f4
parenta08c5c0e5fed06ac63aeb3729e642e232bb5e92a
usb: dwc2: fix dwc2_get_device_property for u8 and u16

According to the Devicetree ePAPR [1] the datatypes u8 and u16 are
not defined. So using device_property_read_u16() would result in
a partial read of a 32-bit big-endian integer which is not intended.
So we better read the complete 32-bit value. This fixes a regression
on bcm2835 where the values for g-rx-fifo-size and g-np-tx-fifo-size
always read as zero:

  Invalid value 0 for param g-rx-fifo-size
  Invalid value 0 for param g-np-tx-fifo-size

[1] - http://elinux.org/images/c/cf/Power_ePAPR_APPROVED_v1.1.pdf

Fixes: 31e0e9c5365 ("usb: dwc2: Move gadget settings into core_params")
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc2/params.c