mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
UPSTREAM: usb: dwc3: Do core validation early on probe
The setting of the dr_mode may need to check the controller's revision.
The revision is set in the dwc3_core_is_valid(), which comes after
dr_mode setting. Let's move it closer to the start of the dwc3_probe()
function and before calling dwc3_get_dr_mode().
Change-Id: I400f22c66cd03abebfed2c8791c88baafb581b39
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit b873e2d0ea)
This commit is contained in:
parent
150cb8ab0c
commit
3a23345224
|
|
@ -896,12 +896,6 @@ static int dwc3_core_init(struct dwc3 *dwc)
|
|||
u32 reg;
|
||||
int ret;
|
||||
|
||||
if (!dwc3_core_is_valid(dwc)) {
|
||||
dev_err(dwc->dev, "this is not a DesignWare USB3 DRD Core\n");
|
||||
ret = -ENODEV;
|
||||
goto err0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write Linux Version Code to our GUID register so it's easy to figure
|
||||
* out which kernel version a bug was found.
|
||||
|
|
@ -1435,6 +1429,11 @@ static int dwc3_probe(struct platform_device *pdev)
|
|||
dwc->regs = regs;
|
||||
dwc->regs_size = resource_size(&dwc_res);
|
||||
|
||||
if (!dwc3_core_is_valid(dwc)) {
|
||||
dev_err(dwc->dev, "this is not a DesignWare USB3 DRD Core\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
dwc3_get_properties(dwc);
|
||||
|
||||
dwc->reset = devm_reset_control_get_optional_shared(dev, NULL);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user