struct sunxi_ccu {
const struct sunxi_ccu_desc *desc;
+ spinlock_t lock;
struct ccu_reset reset;
};
-static DEFINE_SPINLOCK(ccu_lock);
-
void ccu_helper_wait_for_lock(struct ccu_common *common, u32 lock)
{
void __iomem *addr;
ccu->desc = desc;
+ spin_lock_init(&ccu->lock);
+
for (i = 0; i < desc->num_ccu_clks; i++) {
struct ccu_common *cclk = desc->ccu_clks[i];
continue;
cclk->base = reg;
- cclk->lock = &ccu_lock;
+ cclk->lock = &ccu->lock;
}
for (i = 0; i < desc->hw_clks->num ; i++) {
reset->rcdev.owner = dev ? dev->driver->owner : THIS_MODULE;
reset->rcdev.nr_resets = desc->num_resets;
reset->base = reg;
- reset->lock = &ccu_lock;
+ reset->lock = &ccu->lock;
reset->reset_map = desc->resets;
ret = reset_controller_register(&reset->rcdev);