[PATCH] usb: host: ehci-generic: Handle DM_RESET=n case

Marek Vasut marek.vasut at mailbox.org
Tue Jan 24 17:58:52 CET 2023


On 1/24/23 09:07, Patrice CHOTARD wrote:
> Hi Marek

Hi,

> On 1/23/23 23:32, Marek Vasut wrote:
>> In case CONFIG_DM_RESET=n, reset_get_bulk() returns -ENOTSUPP.
>> Do not fail in that case either. This is a valid use case, e.g.
>> in case the reset driver is a no-op and would only waste space
>> in the build.
>>
>> Fixes: 81755b8c20f ("usb: host: ehci-generic: Make resets and clocks optional")
>> Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
>> ---
>> Cc: Andre Przywara <andre.przywara at arm.com>
>> Cc: Patrice Chotard <patrice.chotard at foss.st.com>
>> ---
>>   drivers/usb/host/ehci-generic.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
>> index a765a307a32..83fe701ff67 100644
>> --- a/drivers/usb/host/ehci-generic.c
>> +++ b/drivers/usb/host/ehci-generic.c
>> @@ -81,7 +81,7 @@ static int ehci_usb_probe(struct udevice *dev)
>>   	}
>>   
>>   	err = reset_get_bulk(dev, &priv->resets);
>> -	if (err && err != -ENOENT) {
>> +	if (err && err != -ENOENT && err != -ENOTSUPP) {
>>   		dev_err(dev, "Failed to get resets (err=%d)\n", err);
>>   		goto clk_err;
>>   	}
> 
> A similar patch can be applied for testing return value of clk_get_bulk() ?
> In case CONFIG_CLK is not set, clk_get_bulk() can return -ENOSYS.

I would much prefer a proper STIH clock driver however.

And looking at R-Car CPG, I think I will also write a reset controller 
driver instead of this patch.


More information about the U-Boot mailing list