git: 19643b415b2b - main - if_dwc: Ignore clk_set_assigned errors if "assigned_clocks" is not specified

From: Bojan Novković <bnovkov_at_FreeBSD.org>
Date: Fri, 01 Aug 2025 12:37:09 UTC
The branch main has been updated by bnovkov:

URL: https://cgit.FreeBSD.org/src/commit/?id=19643b415b2b93d1a1ed619f40f1a7ee2adebc0a

commit 19643b415b2b93d1a1ed619f40f1a7ee2adebc0a
Author:     Bojan Novković <bnovkov@FreeBSD.org>
AuthorDate: 2025-01-18 19:04:37 +0000
Commit:     Bojan Novković <bnovkov@FreeBSD.org>
CommitDate: 2025-08-01 12:35:54 +0000

    if_dwc: Ignore clk_set_assigned errors if "assigned_clocks" is not specified
    
    dwc_attach will currently fail if clk_set_assigned fails, even if the
    "assigned_clock" property was not specified. Since there are platforms
    whose DTS files do not have this property (e.g. if_dwc_aw,
    if_dwc_socfpga), do not return an error if clk_set_assigned
    returns ENOENT.
    
    Reviewed by:    manu
    Differential review:    https://reviews.freebsd.org/D48529
---
 sys/dev/dwc/if_dwc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c
index 33657b33fe25..1b4b4be68747 100644
--- a/sys/dev/dwc/if_dwc.c
+++ b/sys/dev/dwc/if_dwc.c
@@ -535,7 +535,7 @@ dwc_attach(device_t dev)
 		sc->aal = true;
 
 	error = clk_set_assigned(dev, ofw_bus_get_node(dev));
-	if (error != 0) {
+	if (error != 0 && error != ENOENT) {
 		device_printf(dev, "clk_set_assigned failed\n");
 		return (error);
 	}