Skip to content

Commit a663bd1

Browse files
asheplyakovdlezcano
authored andcommitted
clocksource/drivers/dw_apb_timer_of: Fix probe failure
The driver refuses to probe with -EINVAL since the commit 5d9814d ("clocksource/drivers/dw_apb_timer_of: Add error handling if no clock available"). Before the driver used to probe successfully if either "clock-freq" or "clock-frequency" properties has been specified in the device tree. That commit changed if (A && B) panic("No clock nor clock-frequency property"); into if (!A && !B) return 0; That's a bug: the reverse of `A && B` is '!A || !B', not '!A && !B' Signed-off-by: Vadim V. Vlasov <vadim.vlasov@elpitech.ru> Signed-off-by: Alexey Sheplyakov <asheplyakov@basealt.ru> Fixes: 5d9814d ("clocksource/drivers/dw_apb_timer_of: Add error handling if no clock available"). Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vadim V. Vlasov <vadim.vlasov@elpitech.ru> Acked-by: Dinh Nguyen <dinguyen@kernel.org> Link: https://lore.kernel.org/r/20211109153401.157491-1-asheplyakov@basealt.ru Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
1 parent 53e87e3 commit a663bd1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/clocksource/dw_apb_timer_of.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int __init timer_get_base_and_rate(struct device_node *np,
4747
pr_warn("pclk for %pOFn is present, but could not be activated\n",
4848
np);
4949

50-
if (!of_property_read_u32(np, "clock-freq", rate) &&
50+
if (!of_property_read_u32(np, "clock-freq", rate) ||
5151
!of_property_read_u32(np, "clock-frequency", rate))
5252
return 0;
5353

0 commit comments

Comments
 (0)