usb: pd: Fix probe failure in case of no sink capablities passed
Commit b76105e359
("usb: pd: Read sink capabilities from device
tree") added support in usbpd driver to pass sink capablities from
device tree. But it introduced bug in case of no sink capablities
passed from device tree as in this case, device_property_read_u32_array()
returns -EINVAL. Due to this, usbpd driver probe fails as usbpd_create()
returns errors. Fix this issue by checking if return value > 0 and then
only try to read sink capablities from device tree. If not, use default
sink capabliites defined in usbpd driver.
Change-Id: I51beeba282c6e067881c664d38c2657843a1c716
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
This commit is contained in:
parent
3a7e752617
commit
1cdcea066d
1 changed files with 1 additions and 1 deletions
|
@ -3166,7 +3166,7 @@ struct usbpd *usbpd_create(struct device *parent)
|
|||
|
||||
pd->num_sink_caps = device_property_read_u32_array(parent,
|
||||
"qcom,default-sink-caps", NULL, 0);
|
||||
if (pd->num_sink_caps) {
|
||||
if (pd->num_sink_caps > 0) {
|
||||
int i;
|
||||
u32 sink_caps[14];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue