Skip to content

Commit e51879d

Browse files
Thinh Nguyengregkh
authored andcommitted
usb: dwc3: drd: Don't check against CONFIG_OF
The CONFIG_OF maybe set, but it may not be applicable to a device. In such case, checking against that can cause the device fail to initialize. Check against the device node (device->of_node) instead. Fixes: a102f07 ("usb: dwc3: drd: Add support for usb-conn-gpio based usb-role-switch") Tested-by: Alexander Stein <[email protected]> Signed-off-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/9f15580ad5810b1e5f31c241b35ebedfbfc30a3f.1644964864.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5f508d7 commit e51879d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/dwc3/drd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static int dwc3_setup_role_switch(struct dwc3 *dwc)
560560
if (IS_ERR(dwc->role_sw))
561561
return PTR_ERR(dwc->role_sw);
562562

563-
if (IS_ENABLED(CONFIG_OF)) {
563+
if (dwc->dev->of_node) {
564564
/* populate connector entry */
565565
int ret = devm_of_platform_populate(dwc->dev);
566566

0 commit comments

Comments
 (0)