Skip to content

Commit a9f28db

Browse files
alcharkgregkh
authored andcommitted
usb: uhci-platform: Make the clock really optional
commit a5c7973 upstream. Device tree bindings state that the clock is optional for UHCI platform controllers, and some existing device trees don't provide those - such as those for VIA/WonderMedia devices. The driver however fails to probe now if no clock is provided, because devm_clk_get returns an error pointer in such case. Switch to devm_clk_get_optional instead, so that it could probe again on those platforms where no clocks are given. Cc: stable <[email protected]> Fixes: 26c5027 ("usb: uhci: Add clk support to uhci-platform") Signed-off-by: Alexey Charkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 92d0a28 commit a9f28db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/host/uhci-platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev)
121121
}
122122

123123
/* Get and enable clock if any specified */
124-
uhci->clk = devm_clk_get(&pdev->dev, NULL);
124+
uhci->clk = devm_clk_get_optional(&pdev->dev, NULL);
125125
if (IS_ERR(uhci->clk)) {
126126
ret = PTR_ERR(uhci->clk);
127127
goto err_rmr;

0 commit comments

Comments
 (0)