diff -drupN a/drivers/clk/clk.c b/drivers/clk/clk.c --- a/drivers/clk/clk.c 2018-08-06 17:23:04.000000000 +0300 +++ b/drivers/clk/clk.c 2022-06-12 05:28:14.000000000 +0300 @@ -275,6 +275,7 @@ unsigned int __clk_get_enable_count(stru { return !clk ? 0 : clk->core->enable_count; } +EXPORT_SYMBOL_GPL(__clk_get_enable_count); static unsigned long clk_core_get_rate_nolock(struct clk_core *core) { @@ -1797,8 +1798,10 @@ static int clk_core_set_parent(struct cl /* prevent racing with updates to the clock topology */ clk_prepare_lock(); + /* if (core->parent == parent) goto out; + */ /* verify ops for for multi-parent clks */ if ((core->num_parents > 1) && (!core->ops->set_parent)) { @@ -2996,20 +2999,15 @@ int clk_notifier_unregister(struct clk * if (cn->clk == clk) break; - if (cn->clk == clk) { - ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb); - - clk->core->notifier_count--; + ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb); - /* XXX the notifier code should handle this better */ - if (!cn->notifier_head.head) { - srcu_cleanup_notifier_head(&cn->notifier_head); - list_del(&cn->node); - kfree(cn); - } + clk->core->notifier_count--; - } else { - ret = -ENOENT; + /* XXX the notifier code should handle this better */ + if (!cn->notifier_head.head) { + srcu_cleanup_notifier_head(&cn->notifier_head); + list_del(&cn->node); + kfree(cn); } clk_prepare_unlock();