• Russell King's avatar
    clk: fix clk-gpio.c with optional clock= DT property · 7ed88aa2
    Russell King authored
    When the clock DT property is not given, of_clk_get_parent_count()
    returns -ENOENT, which then tries to allocate -2 x 4 bytes of memory,
    which of course fails, causing the whole driver to fail to create
    the clock.
    
    This causes the SolidRun platforms to fail probing the SDHCI1 interface
    which is connected to the WiFi.
    
    Fix this by detecting errno codes, skipping the allocation, and fixing
    of_clk_gpio_gate_delayed_register_get() to handle a NULL parent_names
    array.
    
    Fixes: 80eeb1f0 ("clk: add gpio controlled clock multiplexer")
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: default avatarMichael Turquette <mturquette@baylibre.com>
    7ed88aa2
clk-gpio.c 8.59 KB