diff options
author | Krzysztof Kozlowski <[email protected]> | 2024-08-14 12:35:38 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2024-09-03 09:52:45 +0200 |
commit | a93c3ad6a9b2f9b8add42cc07e8857bab0eb1616 (patch) | |
tree | 79ccd39b600668a3c37cccb272605aa39a2b04ac | |
parent | bde053252c02186836ea0d1bee492d2e95c3f983 (diff) |
usb: dwc3: st: simplify with dev_err_probe
Use dev_err_probe() to make the error paths a bit simpler.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Patrice Chotard <[email protected]>
Acked-by: Thinh Nguyen <[email protected]>
Link: https://lore.kernel.org/r/20240814-b4-cleanup-h-of-node-put-usb-v1-2-95481b9682bc@linaro.org
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/usb/dwc3/dwc3-st.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c index 98f43d7082d7..7a0b1821768a 100644 --- a/drivers/usb/dwc3/dwc3-st.c +++ b/drivers/usb/dwc3/dwc3-st.c @@ -237,10 +237,9 @@ static int st_dwc3_probe(struct platform_device *pdev) dwc3_data->rstc_pwrdn = devm_reset_control_get_exclusive(dev, "powerdown"); - if (IS_ERR(dwc3_data->rstc_pwrdn)) { - dev_err(&pdev->dev, "could not get power controller\n"); - return PTR_ERR(dwc3_data->rstc_pwrdn); - } + if (IS_ERR(dwc3_data->rstc_pwrdn)) + return dev_err_probe(dev, PTR_ERR(dwc3_data->rstc_pwrdn), + "could not get power controller\n"); /* Manage PowerDown */ reset_control_deassert(dwc3_data->rstc_pwrdn); @@ -248,8 +247,8 @@ static int st_dwc3_probe(struct platform_device *pdev) dwc3_data->rstc_rst = devm_reset_control_get_shared(dev, "softreset"); if (IS_ERR(dwc3_data->rstc_rst)) { - dev_err(&pdev->dev, "could not get reset controller\n"); - ret = PTR_ERR(dwc3_data->rstc_rst); + ret = dev_err_probe(dev, PTR_ERR(dwc3_data->rstc_rst), + "could not get reset controller\n"); goto undo_powerdown; } |