mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
clocksource/drivers/timer-of: Make the code compatible with modules
The next changes will bring the module support on the timer drivers. Those use the API exported by the timer-of which are not exporting their symbols. Fix that by adding EXPORT_SYMBOL_GPL(). Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20260327180600.8150-4-daniel.lezcano@kernel.org
This commit is contained in:
parent
2423405880
commit
68ed094971
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
* Free the irq resource
|
* Free the irq resource
|
||||||
*/
|
*/
|
||||||
static __init void timer_of_irq_exit(struct of_timer_irq *of_irq)
|
static void timer_of_irq_exit(struct of_timer_irq *of_irq)
|
||||||
{
|
{
|
||||||
struct timer_of *to = container_of(of_irq, struct timer_of, of_irq);
|
struct timer_of *to = container_of(of_irq, struct timer_of, of_irq);
|
||||||
|
|
||||||
|
|
@ -41,8 +41,8 @@ static __init void timer_of_irq_exit(struct of_timer_irq *of_irq)
|
||||||
*
|
*
|
||||||
* Returns 0 on success, < 0 otherwise
|
* Returns 0 on success, < 0 otherwise
|
||||||
*/
|
*/
|
||||||
static __init int timer_of_irq_init(struct device_node *np,
|
static int timer_of_irq_init(struct device_node *np,
|
||||||
struct of_timer_irq *of_irq)
|
struct of_timer_irq *of_irq)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct timer_of *to = container_of(of_irq, struct timer_of, of_irq);
|
struct timer_of *to = container_of(of_irq, struct timer_of, of_irq);
|
||||||
|
|
@ -82,7 +82,7 @@ static __init int timer_of_irq_init(struct device_node *np,
|
||||||
*
|
*
|
||||||
* Disables and releases the refcount on the clk
|
* Disables and releases the refcount on the clk
|
||||||
*/
|
*/
|
||||||
static __init void timer_of_clk_exit(struct of_timer_clk *of_clk)
|
static void timer_of_clk_exit(struct of_timer_clk *of_clk)
|
||||||
{
|
{
|
||||||
of_clk->rate = 0;
|
of_clk->rate = 0;
|
||||||
clk_disable_unprepare(of_clk->clk);
|
clk_disable_unprepare(of_clk->clk);
|
||||||
|
|
@ -98,8 +98,8 @@ static __init void timer_of_clk_exit(struct of_timer_clk *of_clk)
|
||||||
*
|
*
|
||||||
* Returns 0 on success, < 0 otherwise
|
* Returns 0 on success, < 0 otherwise
|
||||||
*/
|
*/
|
||||||
static __init int timer_of_clk_init(struct device_node *np,
|
static int timer_of_clk_init(struct device_node *np,
|
||||||
struct of_timer_clk *of_clk)
|
struct of_timer_clk *of_clk)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
@ -137,13 +137,13 @@ static __init int timer_of_clk_init(struct device_node *np,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __init void timer_of_base_exit(struct of_timer_base *of_base)
|
static void timer_of_base_exit(struct of_timer_base *of_base)
|
||||||
{
|
{
|
||||||
iounmap(of_base->base);
|
iounmap(of_base->base);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __init int timer_of_base_init(struct device_node *np,
|
static int timer_of_base_init(struct device_node *np,
|
||||||
struct of_timer_base *of_base)
|
struct of_timer_base *of_base)
|
||||||
{
|
{
|
||||||
of_base->base = of_base->name ?
|
of_base->base = of_base->name ?
|
||||||
of_io_request_and_map(np, of_base->index, of_base->name) :
|
of_io_request_and_map(np, of_base->index, of_base->name) :
|
||||||
|
|
@ -156,7 +156,7 @@ static __init int timer_of_base_init(struct device_node *np,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int __init timer_of_init(struct device_node *np, struct timer_of *to)
|
int timer_of_init(struct device_node *np, struct timer_of *to)
|
||||||
{
|
{
|
||||||
int ret = -EINVAL;
|
int ret = -EINVAL;
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|
@ -200,6 +200,7 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to)
|
||||||
timer_of_base_exit(&to->of_base);
|
timer_of_base_exit(&to->of_base);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(timer_of_init);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* timer_of_cleanup - release timer_of resources
|
* timer_of_cleanup - release timer_of resources
|
||||||
|
|
@ -208,7 +209,7 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to)
|
||||||
* Release the resources that has been used in timer_of_init().
|
* Release the resources that has been used in timer_of_init().
|
||||||
* This function should be called in init error cases
|
* This function should be called in init error cases
|
||||||
*/
|
*/
|
||||||
void __init timer_of_cleanup(struct timer_of *to)
|
void timer_of_cleanup(struct timer_of *to)
|
||||||
{
|
{
|
||||||
if (to->flags & TIMER_OF_IRQ)
|
if (to->flags & TIMER_OF_IRQ)
|
||||||
timer_of_irq_exit(&to->of_irq);
|
timer_of_irq_exit(&to->of_irq);
|
||||||
|
|
@ -219,3 +220,4 @@ void __init timer_of_cleanup(struct timer_of *to)
|
||||||
if (to->flags & TIMER_OF_BASE)
|
if (to->flags & TIMER_OF_BASE)
|
||||||
timer_of_base_exit(&to->of_base);
|
timer_of_base_exit(&to->of_base);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(timer_of_cleanup);
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,8 @@ static inline unsigned long timer_of_period(struct timer_of *to)
|
||||||
return to->of_clk.period;
|
return to->of_clk.period;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int __init timer_of_init(struct device_node *np,
|
int timer_of_init(struct device_node *np, struct timer_of *to);
|
||||||
struct timer_of *to);
|
|
||||||
|
|
||||||
extern void __init timer_of_cleanup(struct timer_of *to);
|
void timer_of_cleanup(struct timer_of *to);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user