diff options
Diffstat (limited to 'drivers/clk/at91/clk-master.c')
-rw-r--r-- | drivers/clk/at91/clk-master.c | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/drivers/clk/at91/clk-master.c b/drivers/clk/at91/clk-master.c index 8d94ddfc9c72..7d4a1864ea7c 100644 --- a/drivers/clk/at91/clk-master.c +++ b/drivers/clk/at91/clk-master.c @@ -12,13 +12,6 @@ #include <linux/clkdev.h> #include <linux/clk/at91_pmc.h> #include <linux/of.h> -#include <linux/of_address.h> -#include <linux/of_irq.h> -#include <linux/io.h> -#include <linux/wait.h> -#include <linux/sched.h> -#include <linux/interrupt.h> -#include <linux/irq.h> #include <linux/mfd/syscon.h> #include <linux/regmap.h> @@ -47,22 +40,10 @@ struct clk_master_layout { struct clk_master { struct clk_hw hw; struct regmap *regmap; - unsigned int irq; - wait_queue_head_t wait; const struct clk_master_layout *layout; const struct clk_master_characteristics *characteristics; }; -static irqreturn_t clk_master_irq_handler(int irq, void *dev_id) -{ - struct clk_master *master = (struct clk_master *)dev_id; - - wake_up(&master->wait); - disable_irq_nosync(master->irq); - - return IRQ_HANDLED; -} - static inline bool clk_master_ready(struct regmap *regmap) { unsigned int status; @@ -76,11 +57,8 @@ static int clk_master_prepare(struct clk_hw *hw) { struct clk_master *master = to_clk_master(hw); - while (!clk_master_ready(master->regmap)) { - enable_irq(master->irq); - wait_event(master->wait, - clk_master_ready(master->regmap)); - } + while (!clk_master_ready(master->regmap)) + cpu_relax(); return 0; } @@ -143,13 +121,12 @@ static const struct clk_ops master_ops = { }; static struct clk * __init -at91_clk_register_master(struct regmap *regmap, unsigned int irq, +at91_clk_register_master(struct regmap *regmap, const char *name, int num_parents, const char **parent_names, const struct clk_master_layout *layout, const struct clk_master_characteristics *characteristics) { - int ret; struct clk_master *master; struct clk *clk = NULL; struct clk_init_data init; @@ -171,19 +148,9 @@ at91_clk_register_master(struct regmap *regmap, unsigned int irq, master->layout = layout; master->characteristics = characteristics; master->regmap = regmap; - master->irq = irq; - init_waitqueue_head(&master->wait); - irq_set_status_flags(master->irq, IRQ_NOAUTOEN); - ret = request_irq(master->irq, clk_master_irq_handler, - IRQF_TRIGGER_HIGH, "clk-master", master); - if (ret) { - kfree(master); - return ERR_PTR(ret); - } clk = clk_register(NULL, &master->hw); if (IS_ERR(clk)) { - free_irq(master->irq, master); kfree(master); } @@ -233,7 +200,6 @@ of_at91_clk_master_setup(struct device_node *np, { struct clk *clk; int num_parents; - unsigned int irq; const char *parent_names[MASTER_SOURCE_MAX]; const char *name = np->name; struct clk_master_characteristics *characteristics; @@ -255,11 +221,7 @@ of_at91_clk_master_setup(struct device_node *np, if (IS_ERR(regmap)) return; - irq = irq_of_parse_and_map(np, 0); - if (!irq) - goto out_free_characteristics; - - clk = at91_clk_register_master(regmap, irq, name, num_parents, + clk = at91_clk_register_master(regmap, name, num_parents, parent_names, layout, characteristics); if (IS_ERR(clk)) |