Skip to content

Commit 753e834

Browse files
sumanannadlezcano
authored andcommitted
clocksource/drivers/timer-ti-dm: Drop bogus omap_dm_timer_of_set_source()
The function omap_dm_timer_of_set_source() was originally added in commit 31a7448 ("ARM: OMAP: dmtimer: Add clock source from DT"), and is designed to set a clock source from DT using the clocks property of a timer node. This design choice is okay for clk provider nodes but otherwise is a bad design as typically the clocks property is used to specify the functional clocks for a device, and not its parents. The timer nodes now all define a timer functional clock after the conversion to ti-sysc and the new clkctrl layout, and this results in an attempt to set the same functional clock as its parent when a consumer driver attempts to acquire any of these timers in the omap_dm_timer_prepare() function. This was masked and worked around in commit 983a5a4 ("clocksource: timer-ti-dm: Fix pwm dmtimer usage of fck reparenting"). Fix all of this by simply dropping the entire function. Any DT configuration of clock sources should be achieved using assigned-clocks and assigned-clock-parents properties provided by the Common Clock Framework. Cc: Tony Lindgren <tony@atomide.com> Cc: Tero Kristo <t-kristo@ti.com> Cc: Neil Armstrong <narmstrong@baylibre.com> Cc: H. Nikolaus Schaller <hns@goldelico.com> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> Cc: Keerthy <j-keerthy@ti.com> Cc: Ladislav Michl <ladis@linux-mips.org> Cc: Pavel Machek <pavel@ucw.cz> Cc: Sebastian Reichel <sre@kernel.org> Signed-off-by: Suman Anna <s-anna@ti.com> Tested-by: Lokesh Vutla <lokeshvutla@ti.com> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200213053504.22638-1-s-anna@ti.com
1 parent 6ce4fcb commit 753e834

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

drivers/clocksource/timer-ti-dm.c

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -138,35 +138,6 @@ static int omap_dm_timer_reset(struct omap_dm_timer *timer)
138138
return 0;
139139
}
140140

141-
static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer)
142-
{
143-
int ret;
144-
struct clk *parent;
145-
146-
/*
147-
* FIXME: OMAP1 devices do not use the clock framework for dmtimers so
148-
* do not call clk_get() for these devices.
149-
*/
150-
if (!timer->fclk)
151-
return -ENODEV;
152-
153-
parent = clk_get(&timer->pdev->dev, NULL);
154-
if (IS_ERR(parent))
155-
return -ENODEV;
156-
157-
/* Bail out if both clocks point to fck */
158-
if (clk_is_match(parent, timer->fclk))
159-
return 0;
160-
161-
ret = clk_set_parent(timer->fclk, parent);
162-
if (ret < 0)
163-
pr_err("%s: failed to set parent\n", __func__);
164-
165-
clk_put(parent);
166-
167-
return ret;
168-
}
169-
170141
static int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
171142
{
172143
int ret;
@@ -276,9 +247,7 @@ static int omap_dm_timer_prepare(struct omap_dm_timer *timer)
276247
__omap_dm_timer_enable_posted(timer);
277248
omap_dm_timer_disable(timer);
278249

279-
rc = omap_dm_timer_of_set_source(timer);
280-
if (rc == -ENODEV)
281-
return omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
250+
rc = omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
282251

283252
return rc;
284253
}

0 commit comments

Comments
 (0)