linux/drivers/clk/clk.c
<<
>>
Prefs
   1/*
   2 * Copyright (C) 2010-2011 Canonical Ltd <jeremy.kerr@canonical.com>
   3 * Copyright (C) 2011-2012 Linaro Ltd <mturquette@linaro.org>
   4 *
   5 * This program is free software; you can redistribute it and/or modify
   6 * it under the terms of the GNU General Public License version 2 as
   7 * published by the Free Software Foundation.
   8 *
   9 * Standard functionality for the common clock API.  See Documentation/clk.txt
  10 */
  11
  12#include <linux/clk-private.h>
  13#include <linux/module.h>
  14#include <linux/mutex.h>
  15#include <linux/spinlock.h>
  16#include <linux/err.h>
  17#include <linux/list.h>
  18#include <linux/slab.h>
  19#include <linux/of.h>
  20
  21static DEFINE_SPINLOCK(enable_lock);
  22static DEFINE_MUTEX(prepare_lock);
  23
  24static HLIST_HEAD(clk_root_list);
  25static HLIST_HEAD(clk_orphan_list);
  26static LIST_HEAD(clk_notifier_list);
  27
  28/***        debugfs support        ***/
  29
  30#ifdef CONFIG_COMMON_CLK_DEBUG
  31#include <linux/debugfs.h>
  32
  33static struct dentry *rootdir;
  34static struct dentry *orphandir;
  35static int inited = 0;
  36
  37/* caller must hold prepare_lock */
  38static int clk_debug_create_one(struct clk *clk, struct dentry *pdentry)
  39{
  40        struct dentry *d;
  41        int ret = -ENOMEM;
  42
  43        if (!clk || !pdentry) {
  44                ret = -EINVAL;
  45                goto out;
  46        }
  47
  48        d = debugfs_create_dir(clk->name, pdentry);
  49        if (!d)
  50                goto out;
  51
  52        clk->dentry = d;
  53
  54        d = debugfs_create_u32("clk_rate", S_IRUGO, clk->dentry,
  55                        (u32 *)&clk->rate);
  56        if (!d)
  57                goto err_out;
  58
  59        d = debugfs_create_x32("clk_flags", S_IRUGO, clk->dentry,
  60                        (u32 *)&clk->flags);
  61        if (!d)
  62                goto err_out;
  63
  64        d = debugfs_create_u32("clk_prepare_count", S_IRUGO, clk->dentry,
  65                        (u32 *)&clk->prepare_count);
  66        if (!d)
  67                goto err_out;
  68
  69        d = debugfs_create_u32("clk_enable_count", S_IRUGO, clk->dentry,
  70                        (u32 *)&clk->enable_count);
  71        if (!d)
  72                goto err_out;
  73
  74        d = debugfs_create_u32("clk_notifier_count", S_IRUGO, clk->dentry,
  75                        (u32 *)&clk->notifier_count);
  76        if (!d)
  77                goto err_out;
  78
  79        ret = 0;
  80        goto out;
  81
  82err_out:
  83        debugfs_remove(clk->dentry);
  84out:
  85        return ret;
  86}
  87
  88/* caller must hold prepare_lock */
  89static int clk_debug_create_subtree(struct clk *clk, struct dentry *pdentry)
  90{
  91        struct clk *child;
  92        struct hlist_node *tmp;
  93        int ret = -EINVAL;;
  94
  95        if (!clk || !pdentry)
  96                goto out;
  97
  98        ret = clk_debug_create_one(clk, pdentry);
  99
 100        if (ret)
 101                goto out;
 102
 103        hlist_for_each_entry(child, tmp, &clk->children, child_node)
 104                clk_debug_create_subtree(child, clk->dentry);
 105
 106        ret = 0;
 107out:
 108        return ret;
 109}
 110
 111/**
 112 * clk_debug_register - add a clk node to the debugfs clk tree
 113 * @clk: the clk being added to the debugfs clk tree
 114 *
 115 * Dynamically adds a clk to the debugfs clk tree if debugfs has been
 116 * initialized.  Otherwise it bails out early since the debugfs clk tree
 117 * will be created lazily by clk_debug_init as part of a late_initcall.
 118 *
 119 * Caller must hold prepare_lock.  Only clk_init calls this function (so
 120 * far) so this is taken care.
 121 */
 122static int clk_debug_register(struct clk *clk)
 123{
 124        struct clk *parent;
 125        struct dentry *pdentry;
 126        int ret = 0;
 127
 128        if (!inited)
 129                goto out;
 130
 131        parent = clk->parent;
 132
 133        /*
 134         * Check to see if a clk is a root clk.  Also check that it is
 135         * safe to add this clk to debugfs
 136         */
 137        if (!parent)
 138                if (clk->flags & CLK_IS_ROOT)
 139                        pdentry = rootdir;
 140                else
 141                        pdentry = orphandir;
 142        else
 143                if (parent->dentry)
 144                        pdentry = parent->dentry;
 145                else
 146                        goto out;
 147
 148        ret = clk_debug_create_subtree(clk, pdentry);
 149
 150out:
 151        return ret;
 152}
 153
 154/**
 155 * clk_debug_init - lazily create the debugfs clk tree visualization
 156 *
 157 * clks are often initialized very early during boot before memory can
 158 * be dynamically allocated and well before debugfs is setup.
 159 * clk_debug_init walks the clk tree hierarchy while holding
 160 * prepare_lock and creates the topology as part of a late_initcall,
 161 * thus insuring that clks initialized very early will still be
 162 * represented in the debugfs clk tree.  This function should only be
 163 * called once at boot-time, and all other clks added dynamically will
 164 * be done so with clk_debug_register.
 165 */
 166static int __init clk_debug_init(void)
 167{
 168        struct clk *clk;
 169        struct hlist_node *tmp;
 170
 171        rootdir = debugfs_create_dir("clk", NULL);
 172
 173        if (!rootdir)
 174                /a>->rs/clk/clk.c#L28" id="L28" class="line" name="L28">  28 175
 176        orphandir = debugfs_create_dir("orphans", rootdir)28">  28 177
 178        if (!orphandir)
 179                /a>->rs/clk/clk.c#L28" id="L28" class="line" name="L28">  28 180
 181        mutex_lock(&prepare_lock);
 182
 183        hlist_for_each_entry(clk, tmp, &clk_root_list, child_node)
 184                clk_debug_create_subtree(clk, rootdir)28">  28 185
 186        hlist_for_each_entry(clk, tmp, &clk_orphan_list, child_node)
 187                clk_debug_create_subtree(clk, orphandir)28">  28 188
 189        inited = 1;
 190
 191        mutex_unlock(&prepare_lock);
 192
 193        /a>->0;
 194}
 195late_initcall(clk_debug_init);
 196#else
 197static inline int clk_debug_register(struct clk *clk) { /a>->0; }
 198#endif
 199
 200/* caller must hold prepare_lock */
 201static void clk_disable_unused_subtree(struct clk *clk)
 202{
 203        struct clk *child;
 204        struct hlist_node *tmp;
 205        unsigned long flags;
 206
 207        if (!clk)
 208                goto out;
 209
 210        hlist_for_each_entry(child, tmp, &clk->children, child_node)
 211                clk_disable_unused_subtree(child);
 212
 213        spin_lock_irqsave(&enable_lock, flags);
 214
 215        if (clk->enable_count)
 216                goto unlock_out;
 217
 218        if (clk->flags & CLK_IGNORE_UNUSED)
 219                goto unlock_out;
 220
 221        if (__clk_is_enabled(clk) && clk->ops->disable)
 222                clk->ops->disable(clk->hw);
 223
 224unlock_out:
 225        spin_unlock_irqrestore(&enable_lock, flags);
 226
 227out:
 228        return;
 229}
 230
 231static int clk_disable_unused(void)
 232{
 233        struct clk *clk;
 234        struct hlist_node *tmp;
 235
 236        mutex_lock(&prepare_lock);
 237
 238        hlist_for_each_entry(clk, tmp, &clk_root_list, child_node)
 239                clk_disable_unused_subtree(clk);
 240
 241        hlist_for_each_entry(clk, tmp, &clk_orphan_list, child_node)
 242                clk_disable_unused_subtree(clk);
 243
 244        mutex_unlock(&prepare_lock);
 245
 246        /a>->0;
 247}
 248late_initcall(clk_disable_unused);
 249
 250/***    helper functions   ***/
 251
 252inline const char *__clk_get_name(struct clk *clk)
 253{
 254        /a>->!clk ? NULL : clk->name;
 255}
 256
 257inline struct clk_hw *__clk_get_hw(struct clk *clk)
 258{
 259        /a>->!clk ? NULL : clk->hw;
 260}
 261
 262inline u8 __clk_get_num_parents(struct clk *clk)
 263{
 264        /a>->!clk ? -EINVAL : clk->num_parents;
 265}
 266
 267inline struct clk *__clk_get_parent(struct clk *clk)
 268{
 269        /a>->!clk ? NULL : clk->parent;
 270}
 271
 272inline int __clk_get_enable_count(struct clk *clk)
 273{
 274        /a>->!clk ? -EINVAL : clk->enable_count;
 275}
 276
 277inline int __clk_get_prepare_count(struct clk *clk)
 278{
 279        /a>->!clk ? -EINVAL : clk->prepare_count;
 280}
 281
 282unsigned long __clk_get_rate(struct clk *clk)
 283{
 284        unsigned long ret;
 285
 286        if (!clk) {
 287                ret = 0;
 288                goto out;
 289        }
 290
 291        ret = clk->rate;
 292
 293        if (clk->flags & CLK_IS_ROOT)
 294                goto out;
 295
 296        if (!clk->parent)
 297                ret = 0;
 298
 299out:
 300        return ret;
 301}
 302
 303inline unsigned long __clk_get_flags(struct clk *clk)
 304{
 305        /a>->!clk ? -EINVAL : clk->flags;
 306}
 307
 308int __clk_is_enabled(struct clk *clk)
 309{
 310        int ret;
 311
 312        if (!clk)
 313                /a>->rs/clk/clk.c#L28"INVAL" class="sref">EINVAL;
 314
 315        /*
 316         * .is_enabled is only mandatory for clocks that gate
 317         * fall back to software usage counter if .is_enabled is missing
 318         */
 319        if (!clk->ops->is_enabled) {
 320                ret = clk->enable_count ? 1 : 0;
 321                goto out;
 322        }
 323
 324        ret = clk->ops->is_enabled(clk->hw);
 325out:
 326        /a>->ret;
 327}
 328
 329static struct clk *__clk_lookup_subtree(const char *name, struct clk *clk)
 330{
 331        struct clk *child;
 332        struct clk *ret;
 333        struct hlist_node *tmp;
 334
 335        if (!strcmp(clk->name, name))
 336                /a>->clk;
 337
 338        hlist_for_each_entry(child, tmp, &clk->children, child_node) {
 339                ret = __clk_lookup_subtree(name, child);
 340                if (ret)
 341                        /a>->ret;
 342        }
 343
 344        /a>->NULL;
 345}
 346
 347struct clk *__clk_lookup(const char *name)
 348{
 349        struct clk *root_clk;
 350        struct clk *ret;
 351        struct hlist_node *tmp;
 352
 353        if (!name)
 354                /a>->NULL;
 355
 356        /* search the 'proper' clk tree first */
 357        hlist_for_each_entry(root_clk, tmp, &clk_root_list, child_node) {
 358                ret = __clk_lookup_subtree(name, root_clk);
 359                if (ret)
 360                        /a>->ret;
 361        }
 362
 363        /* if not found, then search the orphan tree */
 364        hlist_for_each_entry(root_clk, tmp, &clk_orphan_list, child_node) {
 365                ret = __clk_lookup_subtree(name, root_clk);
 366                if (ret)
 367                        /a>->ret;
 368        }
 369
 370        return NULL;
 371}
 372
 373/***        clk api        ***/
 374
 375void __clk_unprepare(struct clk *clk)
 376{
 377        if (!clk)
 378                return;
 379
 380        if (WARN_ON(clk->prepare_count == 0))
 381                return;
 382
 383        if (-rs/clk/clk.c#L28clk" class="sref">clk->prepare_count > 0)
 384                return;
 385
 386        WARN_ON(clk->enable_count > 0);
 387
 388        if (clk->ops->unprepare)
 389                clk->ops->unprepare(clk->hw);
 390
 391        __clk_unprepare(s/clk/clk.c#L28clk" class="sref">clk->parent);
 392}
 393
 394/**
 395 * clk_unprepare - undo preparation of a clock source
 396 * @clk: the clk being unprepare
 397 *
 398 * clk_unprepare may sleep, which differentiates it from clk_disable.  In a
 399 * simple case, clk_unprepare can be used instead of clk_disable to gate a clk
 400 * if the operation may sleep.  One example is a clk which is accessed over
 401 * I2c.  In the complex case a clk gate operation may require a fast and a slow
 402 * part.  It is this reason that clk_unprepare and clk_disable are not mutually
 403 * exclusive.  In fact clk_disable must be called before clk_unprepare.
 404 */
 405void clk_unprepare(struct clk *clk)
 406{
 407        mutex_lock(&prepare_lock);
 408        __clk_unprepare(s/clk/clk.c#L28clk" class="sref">clk);
 409        mutex_unlock(&prepare_lock);
 410}
 411EXPORT_SYMBOL_GPL(s/clk/clk.c#L28clk_unprepare" class="sref">clk_unprepare);
 412
 413int __clk_prepare(struct clk *clk)
 414{
 415        int ret = 0;
 416
 417        if (!clk)
 418                return 0;
 419
 420        if (clk->prepare_count == 0) {
 421                ret = __clk_prepare(s/clk/clk.c#L28clk" class="sref">clk->parent);
 422                if (ret)
 423                        return ret;
 424
 425                if (clk->ops->prepare) {
 426                        ret = clk->ops->prepare(clk->hw);
 427                        if (ret) {
 428                                __clk_unprepare(s/clk/clk.c#L28clk" class="sref">clk->parent);
 429                                return ret;
 430                        }
 431                }
 432        }
 433
 434        clk->prepare_count++;
 435
 436        /a>->0;
 437}
 438
 439/**
 440 * clk_prepare - prepare a clock source
 441 * @clk: the clk being prepared
 442 *
 443 * clk_prepare may sleep, which differentiates it from clk_enable.  In a simple
 444 * case, clk_prepare can be used instead of clk_enable to ungate a clk if the
 445 * operation may sleep.  One example is a clk which is accessed over I2c.  In
 446 * the complex case a clk ungate operation may require a fast and a slow part.
 447 * It is this reason that clk_prepare and clk_enable are not mutually
 448 * exclusive.  In fact clk_prepare must be called before clk_enable.
 449 * Ra>-&gs 0 on success, -EERROR otherwise.
 450 */
 451int clk_prepare(struct clk *clk)
 452{
 453        int ret;
 454
 455        mutex_lock(&prepare_lock);
 456        ret = __clk_prepare(s/clk/clk.c#L28clk" class="sref">clk);
 457        mutex_unlock(&prepare_lock);
 458
 459        /a>->ret;
 460}
 461EXPORT_SYMBOL_GPL(s/clk/clk.c#L28clk_prepare" class="sref">clk_prepare);
 462
 463static void __clk_disable(struct clk *clk)
 464{
 465        if (!clk)
 466                return;
 467
 468        if (WARN_ON(IS_ERR(s/clk/clk.c#L28clk" class="sref">clk)))
 469                return;
 470
 471        if (WARN_ON(clk->enable_count == 0))
 472                return;
 473
 474        if (-rs/clk/clk.c#L28clk" class="sref">clk->enable_count > 0)
 475                return;
 476
 477        if (clk->ops->disable)
 478                clk->ops->disable(clk->hw);
 479
 480        __clk_disable(s/clk/clk.c#L28clk" class="sref">clk->parent);
 481}
 482
 483/**
 484 * clk_disable - gate a clock
 485 * @clk: the clk being gated
 486 *
 487 * clk_disable must not sleep, which differentiates it from clk_unprepare.  In
 488 * a simple case, clk_disable can be used instead of clk_unprepare to gate a
 489 * clk if the operation is fast and will never sleep.  One example is a
 490 * SoC-internal clk which is controlled via simple register writes.  In the
 491 * complex case a clk gate operation may require a fast and a slow part.  It is
 492 * this reason that clk_unprepare and clk_disable are not mutually exclusive.
 493 * In fact clk_disable must be called before clk_unprepare.
 494 */
 495void clk_disable(struct clk *clk)
 496{
 497        unsigned long flags;
 498
 499        spin_lock_irqsave(&enable_lock, flags);
 500        __clk_disable(s/clk/clk.c#L28clk" class="sref">clk);
 501        spin_unlock_irqrestore(&enable_lock, flags);
 502}
 503EXPORT_SYMBOL_GPL(s/clk/clk.c#L28clk_disable" class="sref">clk_disable);
 504
 505static int __clk_enable(struct clk *clk)
 506{
 507        int ret = 0;
 508
 509        if (!clk)
 510                /a>->0;
 511
 512        if (WARN_ON(clk->prepare_count == 0))
 513                /a>->rs/clk/clk.c#L28"SHUTDOWN" class="sref">"SHUTDOWN;
 514
 515        if (clk->enable_count == 0) {
 516                ret = __clk_enable(s/clk/clk.c#L28clk" class="sref">clk->parent);
 517
 518                if (ret)
 519                        /a>->ret;
 520
 521                if (clk->ops->enable) {
 522                        ret = clk->ops->enable(clk->hw);
 523                        if (ret) {
 524                                __clk_disable(s/clk/clk.c#L28clk" class="sref">clk->parent);
 525                                /a>->ret;
 526                        }
 527                }
 528        }
 529
 530        clk->enable_count++;
 531        /a>->0;
 532}
 533
 534/**
 535 * clk_enable - ungate a clock
 536 * @clk: the clk being ungated
 537 *
 538 * clk_enable must not sleep, which differentiates it from clk_prepare.  In a
 539 * simple case, clk_enable can be used instead of clk_prepare to ungate a clk
 540 * if the operation will never sleep.  One example is a SoC-internal clk which
 541 * is controlled via simple register writes.  In the complex case a clk ungate
 542 * operation may require a fast and a slow part.  It is this reason that
 543 * clk_enable and clk_prepare are not mutually exclusive.  In fact clk_prepare
 544 * must be called before clk_enable.  Ra>-&gs 0 on success, -EERROR
 545 * otherwise.
 546 */
 547int clk_enable(struct clk *clk)
 548{
 549        unsigned long flags;
 550        int ret;
 551
 552        spin_lock_irqsave(&enable_lock, flags);
 553        ret = __clk_enable(s/clk/clk.c#L28clk" class="sref">clk);
 554        spin_unlock_irqrestore(&enable_lock, flags);
 555
 556        /a>->ret;
 557}
 558EXPORT_SYMBOL_GPL(s/clk/clk.c#L28clk_enable" class="sref">clk_enable);
 559
 560/**
 561 * __clk_round_rate - round the given rate for a clk
 562 * @clk: round the rate of this clock
 563 *
 564 * Caller must hold prepare_lock.  Useful for clk_ops such as .set_rate
 565 */
 566unsigned long __clk_round_rate(struct clk *clk, unsigned long rate)
 567{
 568        unsigned long parent_rate = 0;
 569
 570        if (!clk)
 571                returntrs/clk/clk.c#L28"INVAL" class="sref">EINVAL;
 572
 573        if (!clk->ops->round_rate) {
 574                if (clk->flags & CLK_SET_RATE_PARENT)
 575                        /a>->__clk_round_rate(s/clk/clk.c#L28clk" class="sref">clk->parent, rate);
 576                else
 577                        /a>->clk->rate;
 578        }
 579
 580        if (clk->parent)
 581                parent_rate = clk->parent->rate;
 582
 583        /a>->clk->ops->round_rate(clk->hw, rate, &parent_rate);
 584}
 585
 586/**
 587 * clk_round_rate - round the given rate for a clk
 588 * @clk: the clk for which we are rounding a rate
 589 * @rate: the rate which is to be rounded
 590 *
 591 * Takes in a rate as input and rounds it to a rate that the clk can actually
 592 * use which is then ra>-&ged.  If clk doesn't support round_rate operation
 593 * then the parent rate is re>-&ged.
 594 */
 595long clk_round_rate(struct clk *clk, unsigned long rate)
 596{
 597        unsigned long ret;
 598
 599        mutex_lock(&prepare_lock);
 600        ret = __clk_round_rate(s/clk/clk.c#L28clk" class="sref">clk, rate);
 601        mutex_unlock(&prepare_lock);
 602
 603        /a>->ret;
 604}
 605EXPORT_SYMBOL_GPL(s/clk/clk.c#L28clk_round_rate" class="sref">clk_round_rate);
 606
 607/**
 608 * __clk_notify - call clk notifier chain
 609 * @clk: struct clk * that is changing rate
 610 * @msg: clk notifier type (see include/linux/clk.h)
 611 * @old_rate: old clk rate
 612 * @new_rate: new clk rate
 613 *
 614 * Triggers a notifier call chain on the clk rate-change notification
 615 * for 'clk'.  Passes a pointer to the struct clk and the previous
 616 * and current rates to the notifier callback.  Intended to be called by
 617 * internal clock c#L2 only.  Ra>-&gs NOTIFY_DONE from the last driver
 618 * called if all went well, or NOTIFY_STOP or NOTIFY_BAD immediately if
 619 * a driver /a>-&gs that.
 620 */
 621static int __clk_notify(struct clk *clk, unsigned long msg,
 622                unsigned long old_rate, unsigned long new_rate)
 623{
 624        struct clk_notifier *cn;
 625        struct clk_notifier_data cnd;
 626        int ret = NOTIFY_DONE;
 627
 628        cnd.clk = clk;
 629        cnd.old_rate = old_rate;
 630        cnd.new_rate = new_rate;
 631
 632        list_for_each_entry(s/clk/clk.c#L28cn" class="sref">cn, &clk_notifier_list, node) {
 633                if (cn->clk == clk) {
 634                        ret = srcu_notifier_call_chain(&cn->notifier_head, msg,
 635                                        &cnd);
 636                        break;
 637                }
 638        }
 639
 640        /a>->ret;
 641}
 642
 643/**
 644 * __clk_recalc_rates
 645 * @clk: first clk in the subtree
 646 * @msg: notification type (see include/linux/clk.h)
 647 *
 648 * Walks the subtree of clks starting with clk and recalculates rates as it
 649 * goes.  Note that if a clk does not implement the .recalc_rate callback then
 650 * it is assumed that the clock will take on the rate of it's parent.
 651 *
 652 * clk_recalc_rates also propagates the POST_RATE_CHANGE notification,
 653 * if necessary.
 654 *
 655 * Caller must hold prepare_lock.
 656 */
 657static void __clk_recalc_rates(struct clk *clk, unsigned long msg)
 658{
 659        unsigned long old_rate;
 660        unsigned long parent_rate = 0;
 661        struct hlist_node *tmp;
 662        struct clk *child;
 663
 664        old_rate = clk->rate;
 665
 666        if (clk->parent)
 667                parent_rate = clk->parent->rate;
 668
 669        if (clk->ops->recalc_rate)
 670                clk->rate = clk->ops->recalc_rate(clk->hw, parent_rate);
 671        else
 672                clk->rate = parent_rate;
 673
 674        /*
 675         * ignore NOTIFY_STOP and NOTIFY_BAD /a>->values for POST_RATE_CHANGE
 676         * & ABORT_RATE_CHANGE notifiers
 677         */
 678        if (clk->notifier_count && msg)
 679                __clk_notify(clk, msg, old_rate, clk->rate);
 680
 681        hlist_for_each_entry(child, tmp, &clk->children, child_node)
 682                __clk_recalc_rates(child, msg);
 683}
 684
 685/**
 686 * clk_get_rate - ra>->the rate of clk
 687 * @clk: the clk whose rate is being re>-&ged
 688 *
 689 * Simply /a>-&gs the cached rate of the clk, unless CLK_GET_RATE_NOCACHE flag
 690 * is set, which means a recalc_rate will be issued.
 691 * If clk is NULL then ra>-&gs 0.
 692 */
 693unsigned long clk_get_rate(struct clk *clk)
 694{
 695        unsigned long rate;
 696
 697        mutex_lock(&prepare_lock);
 698
 699        if (clk && (clk->flags & CLK_GET_RATE_NOCACHE))
 700                __clk_recalc_rates(clk, 0);
 701
 702        rate = __clk_get_rate(clk);
 703        mutex_unlock(&prepare_lock);
 704
 705        /a>->rate;
 706}
 707EXPORT_SYMBOL_GPL(s/clk/clk.c#L28clk_get_rate" class="sref">clk_get_rate);
 708
 709/**
 710 * __clk_speculate_rates
 711 * @clk: first clk in the subtree
 712 * @parent_rate: the "fu>-&e" rate of clk's parent
 713 *
 714 * Walks the subtree of clks starting with clk, speculating rates as it
 715 * goes and firing off PRE_RATE_CHANGE notifications as necessary.
 716 *
 717 * Unlike clk_recalc_rates, clk_speculate_rates exists only for sending
 718 * pre-rate change notifications and re>-&gs early if no clks in the
 719 * subtree have subscribed to the notifications.  Note that if a clk does not
 720 * implement the .recalc_rate callback then it is assumed that the clock will
 721 * take on the rate of it's parent.
 722 *
 723 * Caller must hold prepare_lock.
 724 */
 725static int __clk_speculate_rates(struct clk *clk, unsigned long parent_rate)
 726{
 727        struct hlist_node *tmp;
 728        struct clk *child;
 729        unsigned long new_rate;
 730        int ret = NOTIFY_DONE;
 731
 732        if (clk->ops->recalc_rate)
 733                new_rate = clk->ops->recalc_rate(clk->hw, parent_rate);
 734        else
 735                new_rate = parent_rate;
 736
 737        /* abort the rate change if a driver /a>-&gs NOTIFY_BAD */
 738        if (clk->notifier_count)
 739                ret = __clk_notify(clk, PRE_RATE_CHANGE, clk->rate, new_rate);
 740
 741        if (ret == NOTIFY_BAD)
 742                goto out;
 743
 744        hlist_for_each_entry(child, tmp, &clk->children, child_node) {
 745                ret = __clk_speculate_rates(child, new_rate);
 746                if (ret == NOTIFY_BAD)
 747                        break;
 748        }
 749
 750out:
 751        /a>->ret;
 752}
 753
 754static void clk_calc_subtree(struct clk *clk, unsigned long new_rate)
 755{
 756        struct clk *child;
 757        struct hlist_node *tmp;
 758
 759        clk->new_rate = new_rate;
 760
 761        hlist_for_each_entry(child, tmp, &clk->children, child_node) {
 762                if (child->ops->recalc_rate)
 763                        child->new_rate = child->ops->recalc_rate(child->hw, new_rate);
 764                else
 765                        child->new_rate = new_rate;
 766                clk_calc_subtree(child, child->new_rate);
 767        }
 768}
 769
 770/*
 771 * calculate the new rates /a>-&ging the topmost clock that has to be
 772 * changed.
 773 */
 774static struct clk *clk_calc_new_rates(struct clk *clk, unsigned long rate)
 775{
 776        struct clk *top = clk;
 777        unsigned long best_parent_rate = 0;
 778        unsigned long new_rate;
 779
 780        /* sanity */
 781        if (IS_ERR_OR_NULL(clk))
 782                /a>->NULL;
 783
 784        /* save parent rate, if it exists */
 785        if (clk->parent)
 786                best_parent_rate = clk->parent->rate;
 787
 788        /* never propagate up to the parent */
 789        if (!(clk->flags & CLK_SET_RATE_PARENT)) {
 790                if (!clk->ops->round_rate) {
 791                        clk->new_rate = clk->rate;
 792                        /a>->NULL;
 793                }
 794                new_rate = clk->ops->round_rate(clk->hw, rate, &best_parent_rate);
 795                goto out;
 796        }
 797
 798        /* need clk->parent from here on out */
 799        if (!clk->parent) {
 800                pr_debug("%s: %s has NULL parent\n", __func__, clk->name);
 801                /a>->NULL;
 802        }
 803
 804        if (!clk->ops->round_rate) {
 805                top = clk_calc_new_rates(clk->parent, rate);
 806                new_rate = clk->parent->new_rate;
 807
 808                goto out;
 809        }
 810
 811        new_rate = clk->ops->round_rate(clk->hw, rate, &best_parent_rate);
 812
 813        if (best_parent_rate != clk->parent->rate) {
 814                top = clk_calc_new_rates(clk->parent, best_parent_rate);
 815
 816                goto out;
 817        }
 818
 819out:
 820        clk_calc_subtree(clk, new_rate);
 821
 822        /a>->top;
 823}
 824
 825/*
 826 * Notify about rate changes in a subtree. Always walk down the whole tree
 827 * so that in case of an error we can walk down the whole tree again and
 828 * abort the change.
 829 */
 830static struct clk *clk_propagate_rate_change(struct clk *clk, unsigned long event)
 831{
 832        struct hlist_node *tmp;
 833        struct clk *child, *fail_clk = NULL;
 834        int ret = NOTIFY_DONE;
 835
 836        if (clk->rate == clk->new_rate)
 837                /a>->0;
 838
 839        if (clk->notifier_count) {
 840                ret = __clk_notify(clk, event, clk->rate, clk->new_rate);
 841                if (ret == NOTIFY_BAD)
 842                        fail_clk = clk;
 843        }
 844
 845        hlist_for_each_entry(child, tmp, &clk->children, child_node) {
 846                clk = clk_propagate_rate_change(child, event);
 847                if (clk)
 848                        fail_clk = clk;
 849        }
 850
 851        /a>->fail_clk;
 852}
 853
 854/*
 855 * walk down a subtree and set the new rates notifying the rate
 856 * change on the way
 857 */
 858static void clk_change_rate(struct clk *clk)
 859{
 860        struct clk *child;
 861        unsigned long old_rate;
 862        unsigned long best_parent_rate = 0;
 758
 86935     href="+code=recalc_rate" class="s1(2class="sref">hw,  843   ers/clk/c8k.c#L764" id="L764" clas8="lin86="L844" class="line" name="Lclk->new_rate = new_rate = parent_ra8ld" class8"sref">child->
 785        if (old_rate;
clk->new_rate =  788}

new_ratsne" name="L707"> 707 788ef="+coded="L770" class="line" na8e="L787ode=new_rate" class=", if it exists */
new_ratsne" name="L707"> 707clk->ops->roent, clk->(clk-> *8calculate the new rates 8a>-&g87rate" class="sref">best_parent_rateid="L772"8class="line" name="L772"8 772<87="L812" class="line" name="L812"*/
new_ratif (child->rateclk-> 733                new_rate = clk->ops->rec(clk->clk, unsigned8long 87="L844" classsref">new_rate);
child_node) {
clk->(clk->< href="+code=parent" class="sremd" class8ode=top" class="sref">to8 87code=new_rate" class="sref">new_ratsigned lo8g  738      s/clk/clk.c#="line" name="L 813        if (clk * 778notifier_countL739" class="line" name="L739"> 739                ret = ret = __clk_notify(clk,  849    class="l8ne" name="L780"> 7808     88="L760" class="line" name="L760"> 760
 761        hlist_for_each_entry(child, tmp, &clk 849    ment"> *8lass="sref">IS_ERR_OR_NU8L8 */
 761                        /8>->88topL;
 843   "> 78488="L824" class="line" name="L8853"> 853
clk-&g8; 853
parent 853
 853
/*88ass="comment"> * abort the chhi"> 853

an>
 853
ops-> 770 853
 *8clk" class="sref">clkclk-> 853
->89"> 722
 853
 713clk-&ris uno be 853
 854 853
 795             8  got89t the new rates notifying the *">clk-&rass7s ba namethspk/clk.c#Llass=e=c"L712" class=s.c#L7wet href="drhi"> 853
 853
  il ei hrr ="line" name=" suppndclk-> 853
8* nee89nd re>-&gs early if no clks in.k" class="sstoprivequ<" "L85o be 853
clk->9a hre90ions.  Note that if a clk doehi"> 853
ops-> 770
 853
9801                /9>->90g the topmost clock that has t.c#L85ass=="line" n/clk/cfirL85off sOSTf="+code=__c 38"> 738skhi"> 853
98                      /9L802"90"> 722 853
98clk.c#L793" id="L793" c9803" 90"> 713 853
98amp; 854parent<9a>, <9 href=NULL" class="sref">r    href="+ef="drivers/clk/clkshref="+code"clk *clk_calc_new_rates(struct clk *parent->cl9e;
tmp;

 833        struct  808             9  got9 NULL;
 862        u9 href="dr9vers/clk/clk.c#L809" id=9L809"9class="line" name="L809"> 809  9     }
 797clkt.cc"L85methsupdspasn>o=="line" nc#L7ologa href="drivers/clk/clk.c#L780" id="L7809rate,9&mutex_e" nL;
;
 89e=parent"9class="sref">parent-9gt; 7979/a>,  836        if (clkclk * 815
 816             9  got91code=new_rate" class="sref">new_ra9 href="dr9vers/clk/clk.c#L817" id=9L817"91 if a driver /a>-to the parent */
 789        if (!(cl9     }
notifier_count)
9819nname="L815"> 815
clk, to9);
best_parent_rat9"line" na9e="L822"> 822       9/a>-&923ef="+code=ra="line" name="L797"> 797<">/* 814                top lk_calc_new_rates(clk->}
a>) {
cl9.c#L825" 9d="L825" class="line" na9e="L892hild_node" class="sref">child_node)
 815
 747                        break;
<9 class="l9ne" name="L828"> 8289span 92"L768" class="line" name="L768"> 79c#L829" i9="L829" class="line" nam9="L8293="L779" class="line" name="L779"> 779<39ee
clk, unsigned l9ng  846                ret = clk->)
cl9=hlist_no9e" class="sref">hlist_no9e93 href="+code=NULL" cllk.c#L789" id="pr_wara href="+code=tmpr_waracode=c" id="L800" class="line" name="L80c#L8/sis/cvers0"> 800 pr_debug(cl9=/a>;
fail_clk<9a> = 93ref="+code=rate" clas="+code=NULL" cllk.c#L789" id=" href="drivers/clk/clk.c#L848" id="rent\n", __func__, ret = round_rate 846                ret = __func__, child_node)
clk-> 815
 747                        break;
<9->0;
 79sref">clk9/a>-> 779clk->) {
ret == best_parent_rat9ode=fail_9lk" class="sref">fail_cl9 9 mutex_une" nL;
;
 843  9     }
new_rate)
children,  815
childmutex_une" nL;
;
 847            9   if94="L837"> 837                /a9ode=fail_9lk" class="sref">fail_cl9 9  8)
9851        /a>->best_parent_rat9;
 722 853
clk< -d="line"lk/clk.c#L7ref= c=chi"> 853
 854 853
 * walk down a subtre9 and 9et the new rates notifying thehi"> 853
 8569span 9lass="comment"> * change on th S notyivers/csinekref="driver. tR" id="L     i" id= is     khi"> 853
c9k9* */
clkclkclk *clk *cl9ref="+cod9=clk" class="sref">clk *clk * 861best_parent_rat9signed lo9g mutex_e" nL;
;
hw, clkclk<    top a href="+code=parent" class="sr9lc#L854" 9k.c#L764" id="L764" clas9="lin96="L844" class="line" name="Lmutex_une" nL;
;
new_rate = parent_ra9ld" class9"sref">child-> 8="L785" class="line" name="L785 href="+code=parent" class="sr9"#L857" i9vers/clk/clk.c#L767" id=9L767"96clkclk 809  98ef="+cod9d="L770" class="line" na9e="L797"> 770 853
 *9calculate the new rates 9a>-&g97g the topmost clock that has t.geef">clk< is mandatorylass=e=" n/cmethsmultiplrelossiblrelk.c#Ls.  I< is53"> 853
 722clk< e=" n/.  826" ids/clt.geef">clk< is/clkis53"> 853
clk< e=" n/.53"> 853
clk, unsigned9long 97"> 854 853
clk< e=" n/cmethn>
<.geef">clk<,cfir" id e nc#L see is/>
 853
to9 97ass="comment"> * change on th .lk.c#Ls arrayk/clk.c,elk/cis/so usrei
 826 853
 * abort the change.
 829 */
clkclkclk *clk * 7809     98ref="+code=event" class="sref">even9 ment"> *9lass="sref">IS_ERR_OR_NU9L98"L831" class="line" name="L831"> 83ass="sref">clk *child, *                /9>->98u8f="+code=child"u7"> 74" class="sref">indexf="+code=child"indexss="sref">child, * 843  9"> 78498="L844" class="line" name="L779"> 779clk-&g9;parent_ra9+d" class9" class="sref">parent 803
clk<" name="L814"> 8numf">clk<"ref"sref">clk * 807
/*98"L768" class="line" name="L768"> 79 & 
clk<" name="L814"> 8numf">clk<"ref"L8361ssef="+code=clk" class="sref">cl9 class="l9ef">ops->new_rate)IS_ERR_OR_ihref="+code=child"IS_ERR_OR_ihre    top s/clk/clk.c#L785" id="L785" class="line" name="L785"sref">clk * *9clk" class="sref">clkNOTIFY_BAD)
;
top s/clk/clk.c#L785" id="L785" class="line" name="L785k/clk.c#L840" id="L840" lookupef="drivers/clkL840" lookup    top s/clk/clk.c#L785" id="L785_>clk" name="L814"> 8="L785_>clk"/a> [0]a href="+code=parent" class="sr9 d="L772"9                       /9>->99 href="+code=NULL" cllk.c#L789" id="NULL;
top s/clk/clk.c#L785" id="L785" class="line" name="L785 href="+code=parent" class="sr9 ass="s1(9/clk.c#L793" id="L793" c9ass="99ref="+code=rate" clasname="L807"> 807
 795             9  got99arent_rate" class="sref">parent_ra9rd" class9vers/clk/clk.c#L796" id=9L796"99ode=new_rate"ratene" name="L803"> 803
new_ratgeef">clkclkcl9 igned lo9href="drivers/clk/clk.c#9797" 99old_rate;
WARNef="drivers/clkWARN     803
new_ratgeef">clkclkcl9r> 7789* nee99r_count" class="sref"e=clk" c>" id="L800" class="line" name="L80multi-">clk< e=" n/0muk.s notclk<     cl10ode=clk" 10ode=pan class="comment">10ode>10odNOTIFY_BAD" class="sref">NOTIFY_BAD)
pr_debug(pr_debdo="coclk"12/54/4dd60cb3f361f1ab7b1181e101fa280542db_3/10ode>="+code=clk" class="sref">cl10o1e=clk" 10of">ops->10oode=new_rate" class="name="L807"> 807
clk10o=NOTIFY_BAD" }.c#L808" id="L808" class="line10o3e=clk" 10o                      /10o  >10o"L852" class="line" name="L852"> 810o4e=clk" 10oclk.c#L793" id="L793" c10ocl>10oref="+code=ra="line" name="L797"> 797ef="drivers/clk/clk.c#L780" id="L78010o5e=clk" 10oamp; 854clks53"> 853
 795             10o">>10ot the new rates notifying theeeeeeee* unnecessaryelk/crxpensf=""s/clsn>o=L840" lookup.  We do="L712tcver53"> 853
10oass="comment"> * change on teeeeeeee* 
ekref="driver here;ee 853
10o <>10o"L768" class="line" name="L768"> 7101de=clk" 10vers/clk/clk.c#L809" id=10ver>10vea href="+cod" class="sref">indexf="+code=child"indexss="33" id="L733" class="line" name="L733"> 733                new_ratgeef">clkclk->ops->new_rat10v2e=clk" 10& 803
 8">clk<"ref"sref">clk * 8">clk<"ref" =ref">clk *parent-10cla>10vref="+code=rate" clas="+code=clk.c#L804" id=kzalloc name="L814"> 8kzalloccodec(sizeof"clk * 803
clk<" name="L814"> 8numf">clk<"ref"scf="+code=clk" class="sref">cl1015e=clk" 10/a>, parent_ra10v7e=clk" 106"> 816             106">>10vode=new_rate"ratene" name="L803"> 803
 8">clk<"ref"sref">clk *10vold_rate;
a>) {
top s/clk/clk.c#L785" id="L785_>clk" name="L814"> 8="L785_>clk"/a> [" class="sref">indexf="+code=child"indexss="]a href="+code=parent" class="sr10v9e=clk" 10href="drivers/clk/clk.c#10hre>10vr_count" classref"ratene" name="L803"> 803
 8">clk<"ref"[" class="sref">indexf="+code=child"indexss="]ahref="+code=parent" class="sr102de=clk" 10lass="line" name="L819">10las>10lahref="+code=NULL" cllk.c#L789" id="NULL;
top s/clk/clk.c#L785" id="L785" name="L814"> 8">clk<"ref"[" class="sref">indexf="+code=child"indexss="] =ref">clk *clk, 10lode=new_rate" class="NULL" cllk.c#L789" id="L840" lookupef="drivers/clkL840" lookup    top s/clk/clk.c#L785" id="L785_>clk" name="L814"> 8="L785_>clk"/a> [" class="sref">indexf="+code=child"indexss="]a href="+code=parent" class="sr1022e=clk" 10href="drivers/clk/clk.c#10hre>10l2_count" classrefhref="+code=parent" class="sr1023e=clk" 10e="L822"> 822       10e=">10l href="+code=NULL" cllk.c#L789" id="NULL;
top s/clk/clk.c#L785" id="L785" name="L814"> 8">clk<"ref"[" class="sref">indexf="+code=child"indexss="] href="+code=parent" class="sr1024e=clk" 10ref="drivers/clk/clk.c#L10ref>10llass="line" name="L843"> 843  10l5e=clk" 10href="drivers/clk/clk.c#10hre>10l"> 854L807"> 807
 8)
10lode=n                      break;
<10l8e=clk" 10that in case of an error10tha>10l="L837"> 837                /a10l9e=clk" 10ne" name="L828"> 82810ne">10lr_couan class="comment"> L840" r"claskclk * 83ass="sref">clk *clk *even10=1e=clk" 10ref">clk, unsigned l10ref>10=ode=n#ifdef        if (!ONFIG_COMMON_!( 837                /a1032e=clk" 10ref="drivers/clk/clk.c#L10ref>10="L831" class="line" name="L831"> 83de href="drivers/clk/de hrea href="+code=clk_cal1"> 761     e="L860"> 860        struct hlist_no10e" >10=e" class="sref">best_parent_rate 761         clask<_1="L860"> 860        struct fail_clk<10" c>10=lass=#endif0"> 860        struct ret = 10=5"L837"> 837                /a1036e=clk" 10href="drivers/clk/clk.c#10hre>10=hild_node" clratene" name="L803"> 803
    claskclk *clk->10=code=new_rate" class=="line60"> 860        struct  837                /a1039e=clk" 10href="drivers/clk/clk.c#10hre>10=r_count" clasps->(child,ref="+code=clk" class="sref">clk 860        struct -> 837                /a1041e=clk" 10s="sref">clk->    claskclk *ret == 10/a href="+code=clk" class="comment"> _lk.c#add_hea1"> 761     _lk.c#add_hea1code"hlist_for_each_entry(child,ref="+code=clk" class="sref">clkhlist_for_each_entry    claskchild,  860        struct fail_cl10lk">10/e" class="sresrefhref="+code=parent" class="sr1044e=clk" 10vers/clk/clk.c#L843" id=10ver>10/ref="+code=rate" class="sref">rate 761     _lk.c#add_hea1code"hlist_for_each_entry(child,ref="+code=clk" class="sref">clkhlist_for_each_entry40" orphan_lk.c>( 860        struct  837                /a1046e=clk" 10">children, c>10/6de=n#ifdef        if (!ONFIG_COMMON_!( 837                /a1047e=clk" 10d" class="sref">child10/ode=new_rate"ratene" name="L803">iniee1"> 761     iniee1ref"sref">clk * 847            1047">10/="L807" class="line" name="L807"> 807
fail_cl10lk">10/"L768" class="line" name="L768"> 7105de=clk" 10vers/clk/clk.c#L849" id=10ver>10veild_node" clratee" name="L803">    claskclk * 761         clask<_1="L8s/clk/clk.c#L834"     claskchildde href="drivers/clk/de hrea hr.c#L808" id="L808" class="line1052e=clk" 10851        /a>->10v2_count" classrefhref="+code=parent" class="sr1053e=clk" 10ref="drivers/clk/clk.c#L10ref>10v href="+code=NULL" cllk.c#L789" id="    clask<_1"> 761         clask<_1="L8s/clk/clk.c#L834" orphandir href="drivers/crphandira hr.c#L808" id="L808" class="line1054e=clk" 10href="drivers/clk/clk.c#10hre>10vlass="line" name="L843"> 843  1055e=clk" 10d="L854" class="line" na10d=">10v="L844" class="line" name="L1"> 761     e="L8s/clk/clk.c#L834" debugfs_askaa href="+code=__fdebugfs_askaa     top s/clk/clk.c#L785" idde href="drivers/clk/de hrea hrs/clk/clk.c#L785" idd claskclktop s/clk/clk.c#L785" idde href="drivers/clk/de hrea hrcf="+code=clk" class="sref">cl1056e=clk" 10t"> * walk down a subtre10t">>10vhild_node" class="sreNULL" cllk.c#L789" id="    clask<_1"> 761         clask<_1="L8" class="sref">roent, clk 860        struct  85610ne">10vode=new_rate"rate, if it exists 1"> 761     e="L8sref">clk *old_rate;
op" class="sref">top s/clk/clk.c#L785" idde href="drivers/clk/de hrea hrs/clk/clk.c#L834" d"> 761     e="L860"> 860        struct c10cod>10vr_count" classref0"> 860        struct old_rate;
pr_debug name="L814"> 8"r_debug    cl1061e=clk" 10=clk" class="sref">clk10rode=new_rate" class="NULL" cle=clk" c>old_rate;
ass="sref">pr_debug(roent, clk 860        struct 10r2> 854L807"> 807
 860        struct hw, 10rlass="line" name="L843"> 843  1065e=clk" 10k.c#L764" id="L764" clas10k.c>10r="L844" class="line" name="Lop" class="sref">top s/clk/clk.c#L785" id="L785 name="L814"> 8">clk<="L8s/clk/clk.c#L834"     clask 860        struct new_rate = 10rarent_rate" class="sref">parent_ra1067e=clk" 10"sref">child->10ref="+code=eve" class="sref">L840" r"class="sr" name="L814"> 8L840" r"class="sr"    top ef">ret =  860        struct 10r 7107de=clk" 10href="drivers/clk/clk.c#10hre>10hrL768L840" seef">clkclkclk * 83ass="sref">clk * 71071e=clk" 10d="L770" class="line" na10d=">10href="+code=event" class="sref">even10h2e=clk" 10calculate the new rates 10cal>10h"L831" class="line" name="L831"> 83ass="sref">clk * 860        struct 10h href="+code=lk_calc_new_rates(struct L789" class="line" name="L78960"> 860        struct NULL;
clk, unsigned10"sr>10h="L844" class="line" name="Lu8f="+code=child"u7"> 74" class="sref">i"> 761     i/clk.c#L816" id="L816" class="line10h6e=clk" 10ref="drivers/clk/clk.c#L10ref>10harent_rate" class="sref">parent_ra1077e=clk" 10ode=top" class="sref">to10ode>10hef="+code=eve" class="sref">k.c#="L785" class="line" k.c#="L785ref"s/clk/clk.c#L834" op" class="sref">top s/clk/clk.c#L785" id="L785" class="line" name="L785 href="+code=parent" class="sr10h8e=clk" 10g  837                /a1079e=clk" 10        unsigned long 10h 803
 8">clk<"ref"sref">clk *old_rate;
op" class="sref">top s/clk/clk.c#L785" id">clk<" name="L814"> 8">clk<"ref" ==clk.c#L804" id=kzalloc name="L814"> 8kzalloccodec(sizeof"clk * 803
clk<" name="L814"> 8numf">clk<"ref"scf="+code=clk" class="sref">cl1081e=clk" 10ne" name="L780"> 78010ne">10hode=new_rate" class="NULL" cle=clk" cew_rate" class="NULL" cle=clk" c>old_rate;
GFP_KERNEef="+code=child"GFP_KERNEeate"a href="+code=parent" class="sr1082e=clk" 10lass="sref">IS_ERR_OR_NU10las>10hrate" class="sref">best_parent_rat10h3e=clk" 10782                /10782>10h3ef="+code=ra="line" name="L797"> 797ef="drivers/clk/clk.c#L780" id="L7801084e=clk" 10href="drivers/clk/clk.c#10hre>10h="L853" class="line" name="hhhhhhhhh* fik/cindex7ref/clklk.c#L7e=" n usinglcack/dclk.c#L7 trs,ef="drivers/clk/clk.c#L780" id="L7801085e=clk" 10         854clk-&g10 cl>10ht the new rates notifying theeeeeeee* them 38wo=L840" lookup.ef="drivers/clk/clk.c#L780" id="L7801087e=clk" 10" class="sref">parent10hass="comment"> * change on teeeeeeee*ref="drivers/clk/clk.c#L780" id="L7801088e=clk" 10href="drivers/clk/clk.c#10hre>10h 761     i/clks/c" 4" class="sref">i"> 761     i/clk <c#="line" name="L
clk<" name="L814"> 8numf">clk<"ref" 4" class="sref">i"> 761     i/clk++asef="+code=clk" class="sref">cl10h9e=clk" 10      
clk<" name="L814"> 8">clk<"ref" /clk/clk.c#="line" name="L
 8">clk<"ref"[" class="sref">i"> 761     i/clk]L836"> 836     ="L785" class="line" name="L785"" class="line" name="L768"> 7109de=clk" 10href="+code=CLK_SET_RATE10hre>10hrde=new_rate" class="NULL" clbreak href="+code=parent" class="sr1091e=clk" 10ef">ops->10hode=new_rate" class="sref"ratene" name="L803">clacmpef="drivers/clkclacmp    top s/clk/clk.c#L785" id="L785_>clk" name="L814"> 8="L785_>clk"/a> [" class="sref">i"> 761     i/clk]ef">ret = clkcl1092e=clk" 10clk" class="sref">clk10h=NOTIFY_BAD" class="sref">NOTrate, if it exists */
clk<" name="L814"> 8">clk<"ref""" class="line" name="L768"> 71093e=clk" 10                       /10   >10h href="+code=NULL" clllllllllllllllll="line" name="L
 8">clk<"ref"[" class="sref">i"> 761     i/clk]L8llk.c#L789" id="L840" lookupef="drivers/clkL840" lookup    clk10href="+code=rate" clas="+code=break href="+code=parent" class="sr1095e=clk" 10& 795             105">>10hhild_node" cl                      break;
<1097e=clk" 10vers/clk/clk.c#L796" id=10ver>10hcode=new_rate" class="sref">new_ra10h8e=clk" 10href="drivers/clk/clk.c#10hre>10h if a driver /a>-a href="+code=ti"> 761     i/clks//clk/clk.c#L834" op" class="sref">top s/clk/clk.c#L785" idnumf">clk<" name="L814"> 8numf">clk<"ref"ssef="+code=clk" class="sref">cl1099e=clk" 10  10  <>10hr_count" class="sref">notifier_countpr_debug name="L814"> 8"r_debug     800iame=" aelossiblrelk.c#L7refe=" n 0"> 80     cl11ode=clk" 11ode=pan class="comment">11ode>11odNOTIFY_BAD" class="sref">NOTs="sref">notifier_countass="sref">pr_debug(ro="L785" class="line" name="L785lk" class="sref">clkroent, clk 860        struct ops->11oode=new_rate" class="name="L807"> 807
clk11o=NOTIFY_BAD" }c#L808" id="L808" class="line11o3e=clk" 11o                      /11o  >11o"L852" class="line" name="L852"> 811o4e=clk" 11oclk.c#L793" id="L793" c11ocl>11oref="+code=ra="line" name="L797"> 797 mig="sr pr"claselk/crnablre*ref="drivers/clk/clk.c#L780" id="L78011o5e=clk" 11oamp; 795             11o">>110hild_node" class="sref">child_node 860        struct 110code=new_rate" class="sref">new_ra11o8e=clk" 11oref="drivers/clk/clk.c#11ore>1108ef="+code=ra="line" name="L797"> 797 FIXME r"clacssmeths40" is_rnablrd(40") somedaye*ref="drivers/clk/clk.c#L780" id="L78011o9e=clk" 11o 11o <>110r_count" clasps->;
roL789" class="line" name="L789a60"> 860        struct 1110de=new_rate"rate, if it exists */
 860        struct ->;
roL789" class="line" name="L789a60"> 860        struct  811v4e=clk" 11class="sref">parent-11cla>111ref="+code=ra="line" name="L797"> 797 cvers/ce=" n input sourcre*ref="drivers/clk/clk.c#L780" id="L7801115e=clk" 11/a>, top s/clk/clk.c#L785" idnew_ratseef">clkclk->ops->roi"> 761     i/clka60"> 860        struct parent_ra11v7e=clk" 116"> 816             116">>11vode=new_rate"="line" name="L797"> 797 cleineup old pr"claselk/crnablre*ref="drivers/clk/clk.c#L780" id="L78011v8e=clk" 11vers/clk/clk.c#L817" id=11ver>11v;
roL789" class="line" name="L789a60"> 860        struct 
11las>11lahref="+code=NULL" cllk.c#L789" id="L840" disablref="drivers/clkL840" disablrcodeclk-> 860        struct clk, 112="L760" class="line" name="Lspin_une" n_irqrestoasef="drivers/clkspin_une" n_irqrestoas    ;
roL789" class="line" name="L789a60"> 860        struct best_parent_rat1123e=clk" 11e="L822"> 822       11e=">11l href="+code=rate, if it exists 
rate-> 860        struct  837                /a11l6e=clk" 11d="L825" class="line" na11d=">112hild_"L815"> 815
112ode=new_rate"="line" name="L850"> 8)
112 82811ne">112"L768" class="line" name="L768"> 7113de=clk" 11="L829" class="line" nam11="L>11="ef="2 853
clk, unsigned l11ref>113"> 770clk< -dsmetch"lk/clk.c#L7ref= mux c=chi"> 853
 853
hlist_no11e" >113"> 722 853
fail_clk<11" c>113="L853" class="line" name="hehi"> 853
ret = 113"> 854clk< e=nc#L usrelk.c#L7as it"L712si/clkinput sourcr.  If e=nchas >
 853
 853
clk->113ass="comment"> * change on th operad719c#L succeed.  8fter successfully cversinglclk"L712si="L785re"> 853
clk< willeupd"sr ="linek"topology, sysfs"topologyelk/re"> 853
 * abort the ch propagate ="sr r"clasulad719cvia L840" r"class="sr". tR" id="L0 1953"> 853
->clk-> 770ret == 11/a hreNULL" class="sref">c0" seef">clkclkclk * 83ass="sref">clk * 71143e=clk" 11lk" class="sref">fail_cl11lk">11/e" clef="+code=clk" class="sref">cl1144e=clk" 11vers/clk/clk.c#L843" id=11ver>114ref="+code=raNULL" class="sref">NULL;
 837                /a1146e=clk" 11">children, c>114hild_node" clratene" name="L803"> 803
op" class="sref">top s/clk/clk.c#L785" id 71147e=clk" 11d" class="sref">child114code=new_rate" class=="linec->notifier_countEINVAef="+code=child"EINVAe/clk.c#L816" id="L816" class="line1148e=clk" 1147"> 847            1147">114="L837"> 837                /a11/9e=clk" 11lk" class="sref">fail_cl11lk">114 803
new_ratseef">clkclk 7115de=clk" 11vers/clk/clk.c#L849" id=11ver>115ahref="+code=NULL" cl="linec->notifier_countENOSYSf="+code=child"ENOSYS/clk.c#L816" id="L816" class="line1151e=clk" 11href="drivers/clk/clk.c#11hre>115ode=new_rate" class="sref">new_rat1152e=clk" 11851        /a>->11v2_count" clas="line" name="L797"> 797 pr">clk ="cinglmethsupd"srsn>o=="lineock"topologyheref="drivers/clk/clk.c#L780" id="L7801153e=clk" 11ref="drivers/clk/clk.c#L11ref>11v href="+code=>notifier_countmutex_e" nL;
;
 843  1155e=clk" 11d="L854" class="line" na11d=">115 save parent rate, if it exists 
 8">clk<="L8s/36"> 836     ="L785" class="line" name="L785"" class="line" name="L768"> 71156e=clk" 11t"> * walk down a subtre11t">>11vhild_node" class="srename="L807"> 807
 85611ne">115code=new_rate" class="sref">new_ra1158e=clk" 11="L857" class="line" nam11="L>1158ef="+code=ra="line" name="L797"> 797 propagate PREf="+code=__cme="ificad71985href="drivers/clk/clk.c#L780" id="L7801159e=clk" 11code=clk" class="sref">c11cod>115 7116de=clk" 11ref="drivers/clk/clk.c#L11ref>11rea href="+code=clk" c>old_rate;
a>) {
 8L840" spesulades="sr"codeclk->ro="L785" class="line" name="L785lk" class="sref">clk="sr {
clk116ode=new_rate" class="sref">new_rat1162e=clk" 11        unsigned long 1162_count" clas="line" name="L797"> 797 abortdNata lass=" object85href="drivers/clk/clk.c#L780" id="L7801163e=clk" 11g ) {
 71164e=clk" 11class="sref">hw, 116ref="+code=rate" clasname="L807"> 807
1165"L837"> 837                /a1166e=clk" 11"sref">new_rate = 1166_count" clas="line" name="L797"> 797 onlyl="-">clk< rat="lineock"iame=" in usrehref="drivers/clk/clk.c#L780" id="L7801167e=clk" 11"sref">child->116ode=new_rate"ratee, if it exists */
116old_rate;
a>) {
 860        struct old_rate;
a>) {
clkclk->ro="L785" class="line" name="L785a href="+code=parent" class="sr1171e=clk" 11d="L770" class="line" na11d=">117ode=new_rate" class="sref">new_rat11h2e=clk" 11calculate the new rates 11cal>1172_count" clas="line" name="L797"> 797 propagate ABORTf="+code=__c"rat.seef">clk< c#L8/sihref="drivers/clk/clk.c#L780" id="L7801173e=clk" 11class="line" name="L772"11cla>117 href="+code=rate, if it exists a>) {
cl1174e=clk" 11="L773" class="line" nam11="L>117ref="+code=rate" class="sref">rate 8L840" r"class="sr"    top ef">ret = tABORTf="+code=__cL785a href="+code=parent" class="sr1175e=clk" 11"sref">clk, unsigned11"sr>117ound_rate" class="srename="L807"> 807
to11ode>117code=new_rate" class="sref">new_ra11h8e=clk" 11g  797 propagate ="sr r"clasulad719cdownstreamihref="drivers/clk/clk.c#L780" id="L7801179e=clk" 11        unsigned long 117r_count" clasps->->ro="L785" class="line" name="L785a href="+code=parent" class="sr118de=clk" 11href="drivers/clk/clk.c#11hre>118a"L837"> 837                /a1181e=clk" 11ne" name="L780"> 78011ne">11hode=n"L815"> 815
IS_ERR_OR_NU11las>118"L831" class=ps->;
;
                /11782>118"L852" class="line" name="L852"> 81184e=clk" 11href="drivers/clk/clk.c#11hre>118ref="+code=ra="line" name="L850"> 8)
 85                      break;
<1186e=clk" 11 class="sref">clk-&g11 cl>118hild_"L815"> 815EXPORTfSYMBOL_GPef="+code=child"EXPORTfSYMBOL_GPecode"lk->clkclkparent118code=new_rate" class="sref">new_ra1188e=clk" 11href="drivers/clk/clk.c#11hre>118walk down the whole tree agL8853"> 853
 * abort the ch L840" inie - inieializr ="lidata="line"ure/0an>a="line" c=chi"> 853
 853
ops->119"> 770 853
clk119g the topmost clock that has re"> 853
119"> 722
< hardwlaseass=th 853
119="L853" class="line" name="heelk.c#L7and ="sr and sees them both.ef="drivers/clk/clk.c#L780" id="L7801195e=clk" 11& 854 795             115">>11hhild_NULL" class="sref">L840" inieef="drivers/clkL840" iniecode" 83ass="sref">clk *clk *11hcode=ef="+code=clk" class="sref">cl11h8e=clk" 11href="drivers/clk/clk.c#11hre>11h if a driver /ULL" class="sref">i"> 761     i/clk= class="sref">roNULL;
11  <>11hr_count" clas"line" name="L831"> 83ass="sref">clk *12ode>12odNOTIFY_BAD" "line" name="L831"> 83_lk.c#ef="+code=clk" clas_lk.c#ef="a href="+code=clk_caltmpef="drivers/clktmp    ,ef="+code=clk_caltmp2ef="drivers/clktmp2s/cl href="+code=parent" class="sr12o1e=clk" 12of">ops->120ode=new_rate" class="sref">new_rat12o2e=clk" 12olk" class="sref">clk120"L831" class=ratene" name="L803"> 803
120 href="+code=NULL" cl="linec->notifier_countEINVAef="+code=child"EINVAe/clk.c#L816" id="L816" class="line12o4e=clk" 12oclk.c#L793" id="L793" c12ocl>120lass="line" name="L843"> 843  12o5e=clk" 12oamp;;
;
 795             12o">>120arent_rate" class="sref">parent_ra12o7e=clk" 12oers/clk/clk.c#L796" id=12oer>120ode=new_rate"="line" name="L797"> 797 check"to seedNata neock"methsthis 96" "iamalreadyl="gk.cer/sihref="drivers/clk/clk.c#L780" id="L78012o8e=clk" 12oref="drivers/clk/clk.c#12ore>120 if a driver /a>-a href="+code=tL840" lookupef="drivers/clkL840" lookup    top s/clk/clk.c#L785" idcl12o9e=clk" 12o 12o <>120r_count" class="sref">notifier_countpr_debug name="L814"> 8"r_debug     800alreadylinieializr/     cl121de=clk" 12vers/clk/clk.c#L809" id=12ver>121dNOTIFY_BAD" class="sref">NOTs="sref">notifier_countass="sref">pr_debug(roop" class="sref">top s/clk/clk.c#L785" idnotifier_countEEXISTf="+code=child"EEXIST/clk.c#L816" id="L816" class="line12v2e=clk" 12& 807
parent-12cla>121lass="line" name="L843"> 843  1215e=clk" 12/a>,  797 check"tha" c=c_opselasesanr.  SeedDocu97">ad71943roop" class="sref">top s/clk/clk.c#L785" idnew_ratseef="sr {
 816             126">>121code=new_rate" class=========!eclass="sref">roop" class="sref">top s/clk/clk.c#L785" idnew_ratroundf="sr {
top s/clk/clk.c#L785" idnew_ratr"class="sr {
cl12v8e=clk" 12vers/clk/clk.c#L817" id=12ver>121old_rate;
"r_warnss="name="L814"> 8"r_warnss=     800muk.simple97"> .roundf="sr clk.c#.veclass="sr     cl1219e=clk" 12href="drivers/clk/clk.c#12hre>121r_count" class="sref"ref">NOTs="sref">notifier_countass="sref">pr_debug(roop" class="sref">top s/clk/clk.c#L785" id12las>12lahref="+code=NULL" cllk.c#L789" id="NULL;
clk, 122ode=new_rate" class="name="L807"> 807
 822       12e=">122"L852" class="line" name="L852"> 81224e=clk" 12ref="drivers/clk/clk.c#L12ref>122ref="+code=rarateclass="sref">roop" class="sref">top s/clk/clk.c#L785" idnew_ratseef">clkclk 803
new_ratgeef">clkclkcl1225e=clk" 12href="drivers/clk/clk.c#12hre>122ound_rate" class="sre>old_rate;
"r_warnss="name="L814"> 8"r_warnss=     800muk.simple97"> .geef">clk< clk.c#.seef">clk<     cl12l6e=clk" 12d="L825" class="line" na12d=">122hild_node" class="sreNULL" cls="sref">notifier_countass="sref">pr_debug(roop" class="sref">top s/clk/clk.c#L785" id122code=new_rate" class=lk.c#L789" id="NULL;
122="L807" class="line" name="L807"> 807
 82812ne">1229NOTIFY_BAD" }c#L808" id="L808" class="line123de=clk" 12="L829" class="line" nam12="L>123a"L837"> 837                /a12=1e=clk" 12ref">clk, unsigned l12ref>123="L760" class="line" name="L797"> 797 throw a WARNdNatany e hrie/0an>="L785_>clk"elaseNULLihref="drivers/clk/clk.c#L780" id="L7801232e=clk" 12ref="drivers/clk/clk.c#L12ref>123=NOTIFY_BAD" ass= 761     i/clks/c" 4" class="sref">i"> 761     i/clk <c#="line" name="L
clk<" name="L814"> 8numf">clk<"ref" 4" class="sref">i"> 761     i/clk++avers/clk/clk.c#L780" id="L7801233e=clk" 12e" class="sref">hlist_no12e" >123 href="+code=NULL" cllk.c#L789" id="WARN"> 761     WARN     803
 8="L785_>clk"/a> [" class="sref">i"> 761     i/clk]evers/clk/clk.c#L780" id="L7801234e=clk" 12" class="sref">fail_clk<12" c>123ref="+code=rate" clas="+code=0" class="line" name=class="line" name="L80invalideNULLian>ame="L"L712si.="L785_>clk"     cl1235e=clk" 12sref">ret = 123ound_rate" class="sreNULL" cls="sref">notifier_countass="sref">pr_debug(roop" class="sref">top s/clk/clk.c#L785" idparent_ra1237e=clk" 12ss="sref">clk->123ode=new_rate"="line" name="L797"> 797ef="drivers/clk/clk.c#L780" id="L7801238e=clk" 12837" id="L837" class="li12837>123walk down the whole tree agaaaaaaaaa* Alloc"sr anelaray7ref"line" c=c *"L712sis/caan clunnecessaryeclass=ef="drivers/clk/clk.c#L780" id="L7801239e=clk" 12href="drivers/clk/clk.c#12hre>123ass="comment"> * abort the caaaaaaaa* look-ups7refe=k"L712si=ossiblrelk.c#L". tThis cmenc#L8 ass=neocksi="ssr/re"> 853
-> 853
clk-> 770 853
ret == 124g the topmost clock that hasaaaaaaaa* necessary.ef="drivers/clk/clk.c#L780" id="L7801243e=clk" 12lk" class="sref">fail_cl12lk">124"> 722124="L853" class="line" name="hhhhhhhhh* If e=ns/clklk.c#L""iame=" NULLiwe skipsthis c#Liasebeock. tThis allows53"> 853
 854children, c>124t the new rates notifying theeeeeeee*ref="drivers/clk/clk.c#L780" id="L7801247e=clk" 12d" class="sref">child124ode=new_rate"rate="line" name="L
clk<" name="L814"> 8numf">clk<"ref" lk/c 1 clk.cclk.ccne" name="L803"> 803
 8">clk<"ref""sef="+code=clk" class="sref">cl1248e=clk" 1247"> 847            1247">124old_rate;
 803
 8">clk<"ref" ==clk.c#L804" id=kzalloc name="L814"> 8kzalloccodec(sizeof"clk * 803
clk<" name="L814"> 8numf">clk<"ref"scf="+code=clk" class="sref">cl12/9e=clk" 12lk" class="sref">fail_cl12lk">124r_count" class="sref"ref">NOTs="sref">notifier_countGFP_KERNEef="+code=child"GFP_KERNEeate"a href="+code=parent" class="sr125de=clk" 12vers/clk/clk.c#L849" id=12ver>125ahref="+code=NULL" cl="line" name="L797"> 797ef="drivers/clk/clk.c#L780" id="L7801251e=clk" 12href="drivers/clk/clk.c#12hre>125"> 770 853
        /a>->125g the topmost clock that hasaaaaaaaaeeeeeeee* c=c inie"L712d  thustany access s/cc=cs/clklk.c#L"[] muk.scheck53"> 853
 722 853
 854 * walk down a subtre12t">>12vhild_node" class="srerate, if it exists */
clk<" name="L814"> 8">clk<"ref""" class="line" name="L768"> 71257e=clk" 12ne" name="L856"> 85612ne">125code=new_rate" class=========ass= 761     i/clks/c" 4" class="sref">i"> 761     i/clk <c#="line" name="L
clk<" name="L814"> 8numf">clk<"ref" 4" class="sref">i"> 761     i/clk++avers/clk/clk.c#L780" id="L7 71258e=clk" 12="L857" class="line" nam12="L>125
clk<" name="L814"> 8">clk<"ref"[" class="sref">i"> 761     i/clk]L8vers/clk/clk.c#L780" id="L7 71259e=clk" 12code=clk" class="sref">c12cod>125r_count" class="sref"ref">NOTs="sref"cccccccc, if it exists L840" lookupef="drivers/clkL840" lookup    top s/clk/clk.c#L785" id">clk<_>clk" name="L814"> 8="L785_>clk"/a> [" class="sref">i"> 761     i/clk]a href="+code=parent" class="sr126de=clk" 12ref="drivers/clk/clk.c#L12ref>12rea href="+cod}c#L808" id="L808" class="line1261e=clk" 12=clk" class="sref">clk126ode=new_rate" class="sref">new_rat1262e=clk" 12        unsigned long 126"L831" class=ps->top s/clk/clk.c#L785" id">clk< name="L814"> 8="L785ref" ==clk.c#L804" id=L840" inief">clkclk<    top a href="+code=parent" class="sr1263e=clk" 12g  81264e=clk" 12class="sref">hw, 126ref="+code=ra="line" name="L797"> 797ef="drivers/clk/clk.c#L780" id="L7801265e=clk" 12k.c#L764" id="L764" clas12k.c>126"> 854new_rate = 126t the new rates notifying theeeeeeee* lk.c#Lehas 38" yetlbee9 L840" inie"L712ds.c#L7clacssc=c in she crphans/="drivers/clk/clk.c#L780" id="L7801267e=clk" 12"sref">child->126ass="comment"> * change on teeeeeeee* lk.c.  If e=nchas vers.c# !( 853
126walk down the whole tree agaaaaaaaaa* e=nclk.c.re"> 853
 * abort the caaaaaaaa*re"> 853
 770clk< any tha" lasechildclk7ref="lineock"curclk127g the topmost clock that hasaaaaaaaa* beingl40" inie"L712d.s/="drivers/clk/clk.c#L780" id="L7801273e=clk" 12class="line" name="L772"12cla>127"> 722roop" class="sref">top s/clk/clk.c#L785" id="L785" class="line" name="L785"" class="line" name="L768"> 71275e=clk" 12"sref">clk, unsigned12"sr>127ound_rate" class="sre/clk.c#L785" id_lk.c#add_head" class="line" _lk.c#add_head    top s/clk/clk.c#L785" idchild#ef="+code=clk" claschild#ef="lass=" class="line" name="L768"> 71276e=clk" 12ref="drivers/clk/clk.c#L12ref>127hild_node" class="sreNULL" cls="sref"hlist_for_each_entryop" class="sref">top s/clk/clk.c#L785" id="L785" class="line" name="L785lk" class="sref">clkchildclk+code=clk" claschildren/a> a href="+code=parent" class="sr1277e=clk" 12ode=top" class="sref">to12ode>127code=new_ratesref"rate_for_each_entryop" class="sref">top s/clk/clk.c#L785" idL789" class="line" name="L789 clk.c#="line" name="L!( 71278e=clk" 12g old_rate;
_lk.c#add_head" class="line" _lk.c#add_head    top s/clk/clk.c#L785" idchild#ef="+code=clk" claschild#ef="lass="hlist_for_each_entryop"_roo5_lk.c class="sref">top<_roo5_lk.c/a> a href="+code=parent" class="sr1279e=clk" 12        unsigned long 127r_count" classref0"> 860        struct top s/clk/clk.c#L785" idchild#ef="+code=clk" claschild#ef="lass="hlist_for_each_entryop"_crphan_lk.c class="sref">top<_crphan_lk.c/a> a href="+code=parent" class="sr1281e=clk" 12ne" name="L780"> 78012ne">128ode=new_rate" class="sref">new_rat1282e=clk" 12lass="sref">IS_ERR_OR_NU12las>1282_count" clas="line" name="L797"> 797ef="drivers/clk/clk.c#L780" id="L78012h3e=clk" 12782                /12782>128"> 722 853
 853
 854 853
clk-&g12 cl>128t the new rates notifying theeeeeeee* .c#L7="sr is vers.o zero.s/="drivers/clk/clk.c#L780" id="L78012h7e=clk" 12" class="sref">parent128ass="comment"> * change on teeeeeeee*ref="drivers/clk/clk.c#L780" id="L7801288e=clk" 12href="drivers/clk/clk.c#12hre>128 if a driver /a>-a href="+code=top" class="sref">top s/clk/clk.c#L785" idnew_ratr"class="sr {
notifier_countop" class="sref">top s/clk/clk.c#L785" id="sr {
top s/clk/clk.c#L785" idnew_ratr"class="sr {
->ops->NOTs="sref">notifier_countasop<_geef="sr {
top s/clk/clk.c#L785" id">clk<" class="line" name="L785"a href="+code=parent" class="sr1291e=clk" 12ef">ops->1291_count" classrefarateclass="sref">roop" class="sref">top s/clk/clk.c#L785" id="L785" class="line" name="L785"" class="line" name="L768"> 71292e=clk" 12clk" class="sref">clk129=NOTIFY_BAD" class="s>notifier_countop" class="sref">top s/clk/clk.c#L785" id="sr {
top s/clk/clk.c#L785" id="L785" class="line" name="L785lk" class="sref">clk="sr {
1293_count" classrefhref="+code=parent" class="sr1294e=clk" 12/clk.c#L793" id="L793" c12/cl>129ref="+code=rate" class="sref">ratetop s/clk/clk.c#L785" id="sr {
 837                /a1296e=clk" 125"> 795             125">>1296_count" clas="line" name="L797"> 797ef="drivers/clk/clk.c#L780" id="L7801297e=clk" 12vers/clk/clk.c#L796" id=12ver>129ass="comment"> * change on teeeeeeee* waek"t
< lk.c7refcrphan neocksiand ="">clk< any tha" lasechildclk7reef="drivers/clk/clk.c#L780" id="L7801298e=clk" 12href="drivers/clk/clk.c#12hre>129walk down the whole tree agaaaaaaaaa* this c=ock53"> 853
12  <>129ass="comment"> * abort the caaaaaaaa*ref="drivers/clk/clk.c#L780" id="L78013ode=clk" 13ode=pan class="comment">13ode>13odNOTIFY_BAD" lk.c#L789" id="_lk.c#for_each_e hry_safr {
rotmpef="drivers/clktmp    ,eclass="sref">rotmp2ef="drivers/clktmp2s/cl="hlist_for_each_entryop"_crphan_lk.c class="sref">top<_crphan_lk.c/a> = class="sref">roohild#ef="+code=clk" claschild#ef="lass"" class="line" name="L768"> 713o1e=clk" 13of">ops->130ode=new_rate" class="ass= 761     i/clks/c" 4" class="sref">i"> 761     i/clk <c#="line" name="Lkrphan href="drivers/crphans/clclk/clk.c#L789" id="numf">clk<" name="L814"> 8numf">clk<"ref" 4" class="sref">i"> 761     i/clk++avers/clk/clk.c#L780" id="L7 713o2e=clk" 13olk" class="sref">clk130=NOTIFY_BAD" class="sssssssssratene" name="L803">strcmpef="drivers/clkstrcmp    top s/clk/clk.c#L785" idrokrphan href="drivers/crphans/clclk/clk.c#L789" id="">clk<_>clk" name="L814"> 8="L785_>clk"/a> [" class="sref">i"> 761     i/clk]a"sef="+code=clk" class="sref">cl13o3e=clk" 13o                      /13o  >130 href="+code=NULL" cl+code=rate" class="sref">rate->roop" class="sref">top a href="+code=parent" class="sr13o4e=clk" 13oclk.c#L793" id="L793" c13ocl>130ref="+code=rate" clas="+code=0" classbreak href="+code=parent" class="sr13o5e=clk" 13oamp; 795             13o">>130arent_rate" class="sref">parent_ra13o7e=clk" 13oers/clk/clk.c#L796" id=13oer>130ode=new_rate"="line" name="L797"> 797ef="drivers/clk/clk.c#L780" id="L78013o8e=clk" 13oref="drivers/clk/clk.c#13ore>130walk down the whole tree agaaaaaaaaa* opd719al7clatassm-spesific magicef="drivers/clk/clk.c#L780" id="L78013o9e=clk" 13o 13o <>130ass="comment"> * abort the caaaaaaaa*re"> 853
131"ef="2 853
 770 853
 722parent-13cla>131="L853" class="line" name="hhhhhhhhh*ref="drivers/clk/clk.c#L780" id="L7801315e=clk" 13/a>, -a href="+code=top" class="sref">top s/clk/clk.c#L785" idnew_ratinieef="drivers/clkiniecodeavers/clk/clk.c#L780" id="L7 71316e=clk" 13href="drivers/clk/clk.c#13hre>131hild_node" class="srea href="+code=top" class="sref">top s/clk/clk.c#L785" idnew_ratinieef="drivers/clkiniecodeclk->ops-> 816             136">>131code=new_rate" class="sref">new_ra13v8e=clk" 13vers/clk/clk.c#L817" id=13ver>131top<_debug_="gk.cer    top a href="+code=parent" class="sr1319e=clk" 13href="drivers/clk/clk.c#13hre>131r_couhref="+code=parent" class="sr132de=clk" 13lass="line" name="L819">13las>13lahref/clk.c#L785" id<clk, 132ode=new_rate"/clk.c#L785" idmutex_une" nL;
;
 822       13e=">132 href="+code=="line" name="L850"> 8)
 837                /a13l6e=clk" 13d="L825" class="line" na13d=">132t the new rates notifying tL8853"> 853
132ass="comment"> * change on t* L840" ="gk.cer -l="gk.certa neock"and ="line"a nookie.s/="drivers/clk/clk.c#L780" id="L7801328e=clk" 13that in case of an error13tha>132walk down the whole tree aga853"> 853
 82813ne">132ass="comment"> * abort the ch Same=as 40" ="gk.cer, exceptetha" ="li.40" fieldlinside hw sh#llipointis/ca53"> 853
 853
clk, unsigned l13ref>133"> 770 853
hlist_no13e" >133"> 722 853
fail_clk<13" c>133="L853" class="line" name="heedata.s/="drivers/clk/clk.c#L780" id="L7801335e=clk" 13sref">ret = 133"> 854clk->133ass="comment"> * change on t* ="dy large numbers refe=ocksitha" nerd s/cbel  whichsimple97">ss/="drivers/clk/clk.c#L780" id="L7801339e=clk" 13href="drivers/clk/clk.c#13hre>133ass="comment"> * abort the c*ta neock"L712si._ra; as such any  853
->s it"L712sioperad7198.  R"lines 053"> 853
clk-> 770 .s/="drivers/clk/clk.c#L780" id="L7801342e=clk" 13"sref">ret == 134g the topmost clock that has*ref="drivers/clk/clk.c#L780" id="L7801343e=clk" 13lk" class="sref">fail_cl13lk">134"> 72"line" name="L831"> 83ass="sref">clk * 83ass_ref="+code=recalcass_rea href="+code=clk_calref="+code=recalc_rate"avers/clk/clk.c#L780" id="L7801344e=clk" 13vers/clk/clk.c#L843" id=13ver>134="L85ef="+code=clk" class="sref">cl1345e=clk" 13href="drivers/clk/clk.c#13hre>134="L844" class/ULL" class="sref">)
children, c>134hild_node" cl"line" name="L831"> 83ass="sref">clk *clk *child134code=new_rate" class="sref">new_ra1348e=clk" 1347"> 847            1347">134clk *clk *fail_cl13lk">134r_count" clasa href="+code=top" class="sref">top s/clk/clk.c#L785" id135dNOTIFY_BAD" lk.c#L789" id="op" class="sref">top s/clk/clk.c#L785" idops->        /a>->135"L831" class=ps->top s/clk/clk.c#L785" idL789" class="line" name="L789 /clk/clk.c#L834" ref="+code=recalc_rate"s/clk/clk.c#L785" idinieef="drivers/clkiniecodes/clk/clk.c#L785" idL789" class="line" name="L789 href="+code=parent" class="sr1353e=clk" 13ref="drivers/clk/clk.c#L13ref>1353L831" class=ps->top s/clk/clk.c#L785" id">clk<_>clk" name="L814"> 8="L785_>clk"/a>  /clk/clk.c#L834" ref="+code=recalc_rate"s/clk/clk.c#L785" idinieef="drivers/clkiniecodes/clk/clk.c#L785" id">clk<_>clk" name="L814"> 8="L785_>clk"/a>  href="+code=parent" class="sr1354e=clk" 13href="drivers/clk/clk.c#13hre>1354_count" clasa href="+code=top" class="sref">top s/clk/clk.c#L785" idclk<" name="L814"> 8numf">clk<"ref" /clk/clk.c#L834" ref="+code=recalc_rate"s/clk/clk.c#L785" idinieef="drivers/clkiniecodes/clk/clk.c#L785" idclk<" name="L814"> 8numf">clk<"ref" href="+code=parent" class="sr1355e=clk" 13d="L854" class="line" na13d=">1355"L837"> 837                /a1356e=clk" 13t"> * walk down a subtre13t">>13vhild_node" cl" class="sref">)
->top a href="+code=parent" class="sr1357e=clk" 13ne" name="L856"> 85613ne">135ode=new_rate"rate="line" name="L)
 8ERR_PTR>)
c13cod>135r_couhref="+code=parent" class="sr136de=clk" 13ref="drivers/clk/clk.c#L13ref>13rea href="+cod="line" name="L850"> 8css="sref">clk *clk136ode=n}c#L808" id="L808" class="line1362e=clk" 13        unsigned long 136"L831 name="L850"> 8EXPORTfSYMBOL_GPef="+code=child"EXPORTfSYMBOL_GPecode"lk-> 81364e=clk" 13class="sref">hw, 136="L853" class="line" name="L8853"> 853
136"> 854 853
new_rate = 136t the new rates notifying thh @dev:+device tha" is7="gk.ceringlthis c=ock53"> 853
child->136ass="comment"> * change on th @hw: d 853
136walk down the whole tree aga853"> 853
 * abort the c* 40" ="gk.cer is >
< primaryeinterfacssass=lopuladinglthlineock"treremethe/cl53"> 853
 853
 770  but maylbe used inaconjne"719cmethsthe53"> 853
137g the topmost clock that has* =".c7refthlineock"API.  In she evlk< of aneerrss=n0" ="gk.cer will ="line"an53"> 853
137"> 722 ; lass="s muk.st".c7ass=aneerrss=n">  afcer sallingl40" ="gk.cer.s/="drivers/clk/clk.c#L780" id="L7801374e=clk" 13="L773" class="line" nam13="L>137="L853" class="line" name="heref="drivers/clk/clk.c#L780" id="L7801375e=clk" 13"sref">clk, unsigned13"sr>137ound_"line" name="L831"> 83ass="sref">clk *top<_r"gk.cer    < 83ass_ref="+code=recalcass_rea href="+code=clk_calref="+code=recalc_rate"avers/clk/clk.c#L780" id="L7801376e=clk" 13ref="drivers/clk/clk.c#L13ref>137hild_ef="+code=clk" class="sref">cl1377e=clk" 13ode=top" class="sref">to13ode>137code=new_rate/ULL" class="sref">i"> 761     i/clk,=a href="+code=t)
 83ass="sref">clk *clk *137r_couhref="+code=parent" class="sr138de=clk" 13href="drivers/clk/clk.c#13hre>138dNOTIFY_BAD" lk.c#L789" id="op" class="sref">top  ==clk.c#L804" id=kzalloc name="L814"> 8kzalloccodecsizeof"f="+code=clk_calass="sref">clk * 78013ne">138ode=new_rate"ratene" name="L803">ass="sref">clk *cl1382e=clk" 13lass="sref">IS_ERR_OR_NU13las>138=NOTIFY_BAD" class="s>notifier_countpr_err name="L814"> 8=r_errcode"l" class="linclass="line" name="L80eouldm38" alloc"sr=ref     notifier_countass="sref">pr_debug(                /13782>138 href="+code=NULL" cllk.c#L789" id="NULL;
 807c#L8_<clk-&g13 cl>138arent_rate" class="sref">parent_ra13h7e=clk" 13" class="sref">parent1387NOTIFY_BAD" lk.c#L789" id="op" class="sref">top s/clk/clk.c#L785" id-> 803
cl1389e=clk" 13      notifier_countpr_err name="L814"> 8=r_errcode"l" class="linclass="line" name="L80eouldm38" alloc"sr=ref/clk/="co     notifier_countass="sref">pr_debug(notifier_countENOMEMf="+code=child"ENOMEMa hr href="+code=parent" class="sr1391e=clk" 13ef">ops->139ode=new_rate" class="name="L807"> 807c#L8_clk139=NOTIFY_BAD" }c#L808" id="L808" class="line1393e=clk" 13                       /13   >1393L831" class=ps->top s/clk/clk.c#L785" id1394_count" clasa href="+code=top" class="sref">top s/clk/clk.c#L785" idref="+code=recalc_rate"e/clk/clk.c#L834" ref="+code=recalc_rate" href="+code=parent" class="sr1395e=clk" 13&top s/clk/clk.c#L785" idL789" class="line" name="L789 /clk/clk.c#L834" ref="+code=recalc_rate"s/clk/clk.c#L785" idinieef="drivers/clkiniecodes/clk/clk.c#L785" idL789" class="line" name="L789 href="+code=parent" class="sr1396e=clk" 135"> 795             135">>139hild_node" cl" class="sref">op" class="sref">top s/clk/clk.c#L785" idclk<" name="L814"> 8numf">clk<"ref" /clk/clk.c#L834" ref="+code=recalc_rate"s/clk/clk.c#L785" idinieef="drivers/clkiniecodes/clk/clk.c#L785" idclk<" name="L814"> 8numf">clk<"ref" href="+code=parent" class="sr1397e=clk" 13vers/clk/clk.c#L796" id=13ver>1397NOTIFY_BAD" lk.c#L789" id="ref="+code=recalc_rate"s/clk/clk.c#L785" idcss="sref">clk *top  href="+code=parent" class="sr1398e=clk" 13href="drivers/clk/clk.c#13hre>139walk href="+code=parent" class="sr1399e=clk" 13  13  <>139r_count" clasa" class="line" name="L8 alloc"sr=loc"l0eopy inacaefa="L785_>clk"eis _ iniedata=eref="drivers/clk/clk.c#L780" id="L78014ode=clk" 14ode=pan class="comment">14ode>14odNOTIFY_BAD" lk.c#L789" id="op" class="sref">top s/clk/clk.c#L785" id">clk<_>clk" name="L814"> 8="L785_>clk"/a>  /clk/clk.c#L834" kzalloc name="L814"> 8kzalloccodec(sizeof"char*)e* e" name="L803"> 803
clk<" name="L814"> 8numf">clk<"ref"scf="+code=clk" class="sref">cl14o1e=clk" 14of">ops->140ode=new_rate" class="FY_BAD" lk.c#L789" id="GFP_KERNEef="+code=child"GFP_KERNEeate"a href="+code=parent" class="sr14o2e=clk" 14olk" class="sref">clk140=NOTIhref="+code=parent" class="sr14o3e=clk" 14o                      /14o  >140 href="+code=/a>-ne" name="L803"> 803
 8="L785_>clk"/a> )sef="+code=clk" class="sref">cl14o4e=clk" 14oclk.c#L793" id="L793" c14ocl>140ref="+code=rate" clas>notifier_countpr_err name="L814"> 8=r_errcode"l" class="linclass="line" name="L80eouldm38" alloc"sr=ref/clk/="L785_>clk"     notifier_countass="sref">pr_debug(notifier_countENOMEMf="+code=child"ENOMEMa hr href="+code=parent" class="sr14o6e=clk" 14o"> 795             14o">>140hild_node" class="srename="L807"> 807c#L8_">clk<_>clk" name="L814"> 8c#L8_">clk<_>clk"a hr href="+code=parent" class="sr14o7e=clk" 14oers/clk/clk.c#L796" id=14oer>140ode=new_rate"}c#L808" id="L808" class="line14o8e=clk" 14oref="drivers/clk/clk.c#14ore>140walk href="+code=parent" class="sr14o9e=clk" 14o 14o <>140r_couhref="+code=parent" class="sr141de=clk" 14vers/clk/clk.c#L809" id=14ver>1410_count" clasa" class="line" name="L8 eopy eacheclass=809"  inacaefa="L785_>clk"eis _ iniedata=eref="drivers/clk/clk.c#L780" id="L78014v1e=clk" 14href="drivers/clk/clk.c#14hre>141ode=new_rate"ass= 761     i/clks/c" 4" class="sref">i"> 761     i/clk <c#="line" name="L
clk<" name="L814"> 8numf">clk<"ref" 4" class="sref">i"> 761     i/clk++asef="+code=clk" class="sref">cl14v2e=clk" 14&top s/clk/clk.c#L785" id">clk<_>clk" name="L814"> 8="L785_>clk"/a> [" class="sref">i"> 761     i/clk]e/clk/clk.c#L834" kcladupef="drivers/clkkcladupcode"lk->clk<_>clk" name="L814"> 8="L785_>clk"/a> [" class="sref">i"> 761     i/clk]cf="+code=clk" class="sref">cl1413e=clk" 14href="drivers/clk/clk.c#14hre>141 href="+code=NULL" cl+code=rate" clas class="FY_BAD" lk.c#L789" id="GFP_KERNEef="+code=child"GFP_KERNEeate"a href="+code=parent" class="sr14v4e=clk" 14class="sref">parent-14cla>141ref="+code=rate" clas/a>-ne" name="L803"> 803
 8="L785_>clk"/a> [" class="sref">i"> 761     i/clk]asef="+code=clk" class="sref">cl14v5e=clk" 14/a>, notifier_countpr_err name="L814"> 8=r_errcode"l" class="linclass="line" name="L80eouldm38" eopy ="L785_>clk"     notifier_countass="sref">pr_debug(notifier_countNULL;
 816             146">>141code=new_rate" class=========name="L807"> 807c#L8_">clk<_>clk"_eopy name="L814"> 8c#L8_">clk<_>clk"_eopya hr href="+code=parent" class="sr1418e=clk" 14vers/clk/clk.c#L817" id=14ver>14114las>14lahrefc#L808" id="L808" class="line1421e=clk" 14lass="sref">clk, 142ode=new_rate"/clk.c#L785" id)
->top a href="+code=parent" class="sr1422e=clk" 14href="drivers/clk/clk.c#14hre>142=NOTIFY_BAD" /a>-ne" name="L803">)
 822       14e=">142 href="+code=NULL" cl="line" name="L850"> 8css="sref">clk * 807c#L8_">clk<_>clk"_eopy name="L814"> 8c#L8_">clk<_>clk"_eopya hrhref="drivers/clk/clk.c#L819" 14l6e=clk" 14d="L825" class="line" na14d=">142hild_node" clwhile (-->notifier_counti"> 761     i/clk &lk//c"avers/clk/clk.c#L780" id="L7801427e=clk" 14y about rate changes in 14y a>142code=new_rate" class=lk/clk.c#L834" kfre href="+code=__fkfre codeclk->
 8="L785_>clk"/a> [" class="sref">i"> 761     i/clk]a href="+code=parent" class="sr1428e=clk" 14that in case of an error14tha>142->
 8="L785_>clk"/a> a href="+code=parent" class="sr1429e=clk" 14ne" name="L828"> 82814ne">142ass="cL807"> 807c#L8_">clk<_>clk" name="L814"> 8c#L8_">clk<_>clk"a hrhref="drivers/clk/clk.c#L819" 143de=clk" 14="L829" class="line" nam14="L>143dNOTIFY_BAD" lk.c#L789" id="kfre href="+code=__fkfre codeclk->
clk, unsigned l14ref>143"> 770L807"> 807c#L8_->hlist_no14e" >143"> 722L807"> 807c#L8_<fail_clk<14" c>143ref="+code=ra="line" name="L850"> 8ERR_PTR>)
ret = 143"> 85}c#L808" id="L808" class="line1436e=clk" 14href="drivers/clk/clk.c#14hre>143t the name="L850"> 8EXPORTfSYMBOL_GPef="+code=child"EXPORTfSYMBOL_GPecode"lk->top<_r"gk.cer    a href="+code=parent" class="sr1437e=clk" 14ss="sref">clk->143code=new_rate" class="sref">new_ra1438e=clk" 14837" id="L837" class="li14837>143walk down the whole tree agL8853"> 853
 * abort the c*top<_un="gk.cer - un="gk.cer a"curclk 853
-> 853
clk-> 770 853
ret == 144g the topmost clock that has* Curclkr/.s/="drivers/clk/clk.c#L780" id="L7801443e=clk" 14lk" class="sref">fail_cl14lk">144"> 722144="L85void name="L831"> 83ass_un="gk.cer class="sref">top<_un="gk.cer53  <
clk * 807EXPORTfSYMBOL_GPef="+code=child"EXPORTfSYMBOL_GPecode"lk->top<_un="gk.cer53  a href="+code=parent" class="sr1446e=clk" 14">children, c>144arent_rate" class="sref">parent_ra1447e=clk" 14d" class="sref">child144ass="comment"> * change on L88*+code=raren7="sr change notifi="s        88*ref="drivers/clk/clk.c#L780" id="L7801448e=clk" 1447"> 847            1447">144walk href="+code=parent" class="sr1449e=clk" 14lk" class="sref">fail_cl14lk">144ass="comment"> * abort the L8853"> 853
145"ef="2 853
 770 853
        /a>->145g the topmost clock that has* @nb: "line" notifi=" beock"*cmethsc#llback"info53"> 853
 722 853
 853
 854 853
 * walk down a subtre14t">>145t the new rates notifying thh untifyon. tThr c#llback8 lssoci"srdimethsthe notifi=" muk.snot53"> 853
 85614ne">145ass="comment"> * change on th re-enter into thlic=c fr56 853
c14cod>145ass="comment"> * abort the c*s/="drivers/clk/clk.c#L780" id="L780146de=clk" 14ref="drivers/clk/clk.c#L14ref>146"ef="2clk146"> 770146g the topmost clock that has* post-change ="sr refthlinek is ="athatvia "line"s/="drivers/clk/clk.c#L780" id="L7801463e=clk" 14g  722hw, 146="L853" class="line" name="c*s/="drivers/clk/clk.c#L780" id="L7801465e=clk" 14k.c#L764" id="L764" clas14k.c>146"> 854new_rate = 146t the new rates notifying thh thlinek in both "line" c=c_notifi=" data.old_="sr"and "line"s/="drivers/clk/clk.c#L780" id="L7801467e=clk" 14"sref">child->146ass="comment"> * change on th c=c_notifi=" data.new_="sr.s/="drivers/clk/clk.c#L780" id="L7801468e=clk" 14vers/clk/clk.c#L767" id=14ver>146walk down the whole tree aga853"> 853
 * abort the c* Abort-change notifi="s laseeffectf="ly thliopposisr refpr"-changes/="drivers/clk/clk.c#L780" id="L780147de=clk" 14href="drivers/clk/clk.c#14hre>147"ef="2 770147g the topmost clock that has* in via "line" c=c_notifi=" data.old_="sr.s/="drivers/clk/clk.c#L780" id="L7801473e=clk" 14class="line" name="L772"14cla>147"> 722clk, unsigned14"sr>147"> 854c#lled methe/ul cargu97">s, -ENOMEM upon53"> 853
to14ode>147ass="comment"> * change on th srcu_notifi=" chain ="gk.cer().s/="drivers/clk/clk.c#L780" id="L7801478e=clk" 14g 147r_cou/ULL" class="sref">nek_notifi=" ="gk.cer class="sref">top<_notifi=" ="gk.cer53  <
clk * 83notifi=" beockhref="+code=__fkotifi=" beockversef="+code=clk_calnbhref="+code=__fkbs/clavers/clk/clk.c#L780" id="L780148de=clk" 14href="drivers/clk/clk.c#14hre>148dNOTIef="+code=clk" class="sref">cl1481e=clk" 14ne" name="L780"> 78014ne">148ode=new_rate""line" name="L831"> 83ass_kotifi=" class="sref">top<_notifi="versef="+code=clk_calan href="drivers/cna hr href="+code=parent" class="sr1482e=clk" 14lass="sref">IS_ERR_OR_NU14las>148=NOTIFY_BAD" /ULL" class="sref">)
                /14782>148"L852" class="line" name="L852"> 81484e=clk" 14href="drivers/clk/clk.c#14hre>148ref="+code=ra/a>-ne" name="L803"> 803
nbhref="+code=__fkbs/clavers/clk/clk.c#L780" id="L7801485e=clk" 14        notifier_countEINVALf="+code=child"EINVALa hr href="+code=parent" class="sr1486e=clk" 14 class="sref">clk-&g14 cl>148arent_rate" class="sref">parent_ra14h7e=clk" 14" class="sref">parent1487NOTIFY_BAD" lk.c#L789" id="mutex_e" nL;
;
 8li.c_ass_each_amerycode"lk->top<_notifi=" li.cref",=a href="+code=tef="href="+code=__fkodes/clavers/clk/clk.c#L780" id="L7801491e=clk" 14ef">ops->149ode=new_rate" class="/a>-a href="+code=ton href="drivers/cna hrs/clk/clk.c#L785" idcss="sref">clk *top avers/clk/clk.c#L780" id="L7801492e=clk" 14clk" class="sref">clk149=NOTIFY_BAD" class="sssssssssbreak href="+code=parent" class="sr1493e=clk" 14                       /14   >149"L852" class="line" name="L852"> 81494e=clk" 14/clk.c#L793" id="L793" c14/cl>1494_count" clasa" class="line" name="L8 /a>c=c wasn"L712t in the notifi=" li.c, alloc"sr=/clkc=<_notifi="a8ref="drivers/clk/clk.c#L780" id="L7801495e=clk" 14&-a href="+code=ton href="drivers/cna hrs/clk/clk.c#L785" idcss="sref">clk *top asef="+code=clk" class="sref">cl1496e=clk" 145"> 795             145">>149hild_node" class="srea href="+code=ton href="drivers/cna hr ==clk.c#L804" id=kzalloc name="L814"> 8kzalloccodecsizeof""line" name="L831"> 83ass_kotifi=" class="sref">top<_notifi="vers),=a href="+code=tGFP_KERNEef="+code=child"GFP_KERNEeate"a href="+code=parent" class="sr1497e=clk" 14vers/clk/clk.c#L796" id=14ver>149code=new_rate" class=/a>-ne" name="L803"> n href="drivers/cna hravers/clk/clk.c#L780" id="L7801498e=clk" 14href="drivers/clk/clk.c#14hre>149 807<14  <>149r_couhref="+code=parent" class="sr15ode=clk" 15ode=pan class="comment">15ode>150dNOTIFY_BAD" class="slk.c#L789" id="on href="drivers/cna hrs/clk/clk.c#L785" idcss="sref">clk * 8css="sref">clk *ops->150ode=new_rate" class=" name="L850"> 8srcu_inie_notifi=" head="sref">clksrcu_inie_notifi=" headcode"hlist_for_each_entryon href="drivers/cna hrs/clk/clk.c#L785" idnotifi=" head="sref">clknotifi=" headcodea href="+code=parent" class="sr15o2e=clk" 15olk" class="sref">clk150=NOTIhref="+code=parent" class="sr15o3e=clk" 15o                      /15o  >150 href="+code=NULL" cllk.c#L789" id="li.c_add="sref">clkli.c_addcode"hlist_for_each_entryon href="drivers/cna hrs/clk/clk.c#L785" idno="href="+code=__fkodes/cl, hlist_for_each_entryop<_notifi=" li.c class="sref">top<_notifi=" li.cref"a href="+code=parent" class="sr15o4e=clk" 15oclk.c#L793" id="L793" c15ocl>150ref="+code=ra}c#L808" id="L808" class="line15o5e=clk" 15oamp; 837                /a15o6e=clk" 15o"> 795             15o">>150hild_node" cl" class="sref">)
clksrcu_notifi=" chain ="gk.cercode"hlist_for_each_entryon href="drivers/cna hrs/clk/clk.c#L785" idnotifi=" head="sref">clknotifi=" headcode,=a href="+code=tebhref="+code=__fkbs/cla href="+code=parent" class="sr15o7e=clk" 15oers/clk/clk.c#L796" id=15oer>150code=new_rate" class="sref">new_ra15o8e=clk" 15oref="drivers/clk/clk.c#15ore>150clk *15o <>150r_couhref="+code=parent" class="sr151de=clk" 15vers/clk/clk.c#L809" id=15ver>1510_cou"L807"> 807<;
;
 8)
parent-15cla>151ref="}c#L808" id="L808" class="line15v5e=clk" 15/a>,  807EXPORTfSYMBOL_GPef="+code=child"EXPORTfSYMBOL_GPecode"lk->top<_notifi=" ="gk.cer53  a href="+code=parent" class="sr15v6e=clk" 15href="drivers/clk/clk.c#15hre>151arent_rate" class="sref">parent_ra1517e=clk" 156"> 816             156">>151ass="comment"> * change on L88ef="drivers/clk/clk.c#L780" id="L7801518e=clk" 15vers/clk/clk.c#L817" id=15ver>151walk down the whole tree aga*"op<_notifi=" un="gk.cer - removeta nen7="sr change notifi="53"> 853
 * abort the c* @ccl: "line" c=c *53"> 853
15las>152"ef="2 853
clk, 152"> 770 853
 853
 822       15e=">152"> 722 854c#lled methe/ul cargu97">s;do="lrwisr, ="athss/="drivers/clk/clk.c#L780" id="L7801526e=clk" 15d="L825" class="line" na15d=">152t the new rates notifying thh alonglthli="line"valur re srcu_notifi=" chain un="gk.cer().s/="drivers/clk/clk.c#L780" id="L7801527e=clk" 15y about rate changes in 15y a>152ass="comment"> * change on thref="drivers/clk/clk.c#L780" id="L7801528e=clk" 15that in case of an error15tha>152nek_notifi=" un="gk.cer class="sref">top<_notifi=" un="gk.cer53  <
clk * 83notifi=" beockhref="+code=__fkotifi=" beockversef="+code=clk_calnbhref="+code=__fkbs/clavers/clk/clk.c#L780" id="L7801529e=clk" 15ne" name="L828"> 82815ne">152ass="ef="+code=clk" class="sref">cl153de=clk" 15="L829" class="line" nam15="L>153dNOTIFY_BAD" "line" name="L831"> 83ass_kotifi=" class="sref">top<_notifi="versef="+code=clk_calan href="drivers/cna hr ==clk.c#L804" id=NULef="+code=child"NULes/cl href="+code=parent" class="sr15=1e=clk" 15ref">clk, unsigned l15ref>153ode=new_rate"rULL" class="sref">)
hlist_no15e" >153 href="+code=/a>-ne" name="L803"> 803
nbhref="+code=__fkbs/clavers/clk/clk.c#L780" id="L7801534e=clk" 15" class="sref">fail_clk<15" c>153ref="+code=ra="+code=="line"->notifier_countEINVALf="+code=child"EINVALa hr href="+code=parent" class="sr1535e=clk" 15sref">ret = 1535"L837"> 837                /a1536e=clk" 15href="drivers/clk/clk.c#15hre>153hild_node" cl" class="sref">mutex_e" nL;
;
clk->153code=new_rate" class="sref">new_ra1538e=clk" 15837" id="L837" class="li15837>153 8li.c_ass_each_amerycode"lk->top<_notifi=" li.cref",=a href="+code=tef="href="+code=__fkodes/clavers/clk/clk.c#L780" id="L7801539e=clk" 15href="drivers/clk/clk.c#15hre>153r_count" class="sref"/a>-a href="+code=ton href="drivers/cna hrs/clk/clk.c#L785" idcss="sref">clk *top avers/clk/clk.c#L780" id="L780154de=clk" 15/a>->clk-> 77href="+code=parent" class="sr1542e=clk" 15"sref">ret == 154=NOTIFY_BAD" /a>-a href="+code=ton href="drivers/cna hrs/clk/clk.c#L785" idcss="sref">clk *top asef="+code=clk" class="sref">cl1543e=clk" 15lk" class="sref">fail_cl15lk">154 href="+code=NULL" cllk.c#L789" id="NULL;
tsrcu_notifi=" chain un="gk.cercode"hlist_for_each_entryon href="drivers/cna hrs/clk/clk.c#L785" idnotifi=" head="sref">clknotifi=" headcode,=a href="+code=tebhref="+code=__fkbs/cla href="+code=parent" class="sr1544e=clk" 15vers/clk/clk.c#L843" id=15ver>154ref="href="+code=parent" class="sr1545e=clk" 15href="drivers/clk/clk.c#15hre>154ound_rate" class="srelk.c#L789" id="op"="sref">clk *children, c>154arent_rate" class="sref">parent_ra1547e=clk" 15d" class="sref">child154code=new_rate" class=l" class="line" name="L8 XXX the notifi=" 5" i shouldmhandle=this bett="a8ref="drivers/clk/clk.c#L780" id="L7801548e=clk" 1547"> 847            1547">154-ne" name="L803"> n href="drivers/cna hrs/clk/clk.c#L785" idnotifi=" head="sref">clknotifi=" headcode./clk.c#L785" idhead="sref">clkheadcodeasef="+code=clk" class="sref">cl1549e=clk" 15lk" class="sref">fail_cl15lk">154r_count" class="sref"ass="srelk.c#L789" id="srcu_cleanup_notifi=" head="sref">clksrcu_cleanup_notifi=" headcode"hlist_for_each_entryon href="drivers/cna hrs/clk/clk.c#L785" idnotifi=" head="sref">clknotifi=" headcodea href="+code=parent" class="sr155de=clk" 15vers/clk/clk.c#L849" id=15ver>155dNOTIFY_BAD" class="sssssssssclk.c#L804" id=kfre href="+code=__fkfre codeclk->        /a>->155=NOTIhref="+code=parent" class="sr1553e=clk" 15ref="drivers/clk/clk.c#L15ref>155 href="+code=} elsesef="+code=clk" class="sref">cl1554e=clk" 15href="drivers/clk/clk.c#15hre>155ref="+code=rate" clas>notifier_count)
 * walk down a subtre15t">>155arent_rate" class="sref">parent_ra1557e=clk" 15ne" name="L856"> 85615ne">1557NOTIFY_BAD" lk.c#L789" id="mutex_une" nL;
;
c15cod>155r_count" clas="line" name="L850"> 8)
clk156"> 770L807"> 807EXPORTfSYMBOL_GPef="+code=child"EXPORTfSYMBOL_GPecode"lk->top<_notifi=" un="gk.cer53  a href="+code=parent" class="sr1562e=clk" 15        unsigned long 156=NOTIhref="+code=parent" class="sr1563e=clk" 15g  72#ifdef" name="L850"> 8CONFIG_OF class="sref">tCONFIG_OFNOTIhref="+code=parent" class="sr1564e=clk" 15class="sref">hw, 156="L853" class="line" name="L88ef="drivers/clk/clk.c#L780" id="L7801565e=clk" 15k.c#L764" id="L764" clas15k.c>156"> 854 853
new_rate = 156t the new rates notifying thh @ratk: Emeryiin global li.c7refceock"providerss/="drivers/clk/clk.c#L780" id="L7801567e=clk" 15"sref">child->156ass="comment"> * change on th @kode: Pointer to device tre  kode7refceock"providers/="drivers/clk/clk.c#L780" id="L7801568e=clk" 15vers/clk/clk.c#L767" id=15ver>156walk down the whole tree aga8 @get: Getfceock"c#llback.  R"lines NULe or a""line" c=c ass=ths53"> 853
 * abort the c*       gf="nfceock"specifi="53"> 853
 853
 770157g the"line" name="L831"> 83of_op<_provider href="drivers/cf_op<_provider_counef="+code=clk" class="sref">cl1573e=clk" 15class="line" name="L772"15cla>157 href="+code="line" name="L831"> 83li.c_head="sref">clkli.c_headhref=name="L831"> 83linnL;
clk, unsigned15"sr>1575href="+code="line" name="L831"> 83device_ef="href="+code=__fdevice_ef="versef="+code=clk_calnf="href="+code=__fkodes/cl href="+code=parent" class="sr1576e=clk" 15ref="drivers/clk/clk.c#L15ref>1576href="+code="line" name="L831"> 83 803
)
to15ode>1577NOTIFY_BAD" void f="+code=clk_caldatahref="+code=__fdata53   href="+code=parent" class="sr1578e=clk" 15g 157r_couhref="+code=parent" class="sr158de=clk" 15href="drivers/clk/clk.c#15hre>158dNOTIstad7cf="+code=clk" clLIST_HEADhref="+code=__fLIST_HEADcode"lk-> 78015ne">158ode=nstad7cf="+code=clk" clDEFINE_MUTEX class="line" nDEFINE_MUTEXcode"lk->;
IS_ERR_OR_NU15las>158=NOTIhref="+code=parent" class="sr1583e=clk" 15782                /15782>158"L852
)
cl1586e=clk" 15 class="sref">clk-&g15 cl>1586href="+code=="line" name="L850"> 8datahref="+code=__fdata53   href="+code=parent" class="sr15h7e=clk" 15" class="sref">parent1587NOTI}c#L808" id="L808" class="line1588e=clk" 15href="drivers/clk/clk.c#15hre>158walk 0L807"> 807EXPORTfSYMBOL_GPef="+code=child"EXPORTfSYMBOL_GPecode"lk->)

)
ops->159ode=nef="+code=clk" class="sref">cl1592e=clk" 15clk" class="sref">clk159=NOTIFY_BAD" "line" name="L831"> 83ass_onecell_datahref="+code=__fass_onecell_dataversef="+code=clk_calass_datahref="+code=__fass_dataverse/cclk.c#L804" id=datahref="+code=__fdata53   href="+code=parent" class="sr1593e=clk" 15                       /15   >159 href="+code=unsignhatint4" class="sref">idxhref="+code=__fidxverse/cclk.c#L804" id=assspec3
159ref="href="+code=parent" class="sr1595e=clk" 15&-a href="+code=tidxhref="+code=__fidxverse&lk//c="+code=clk_calass_datahref="+code=__fass_dataverss/clk/clk.c#L785" idcss_num class="sref">top<_numcodeasef="+code=clk" class="sref">cl1596e=clk" 155"> 795             155">>159hild_node" class="srea href="+code=tpr_err name="L814"> 8=r_errcode"l" class="linclass="line" name="L80invalid neock0index ame="d     notifier_countass="sref">pr_debug(notifier_countidxhref="+code=__fidxversa href="+code=parent" class="sr1597e=clk" 15vers/clk/clk.c#L796" id=15ver>159code=new_rate" class=="line" name="L850"> 8ERR_PTR>)
15  <>159r_couhref="+code=parent" class="sr16ode=clk" 16ode=pan class="comment">16ode>160dNOTIFY_BAD" ="line" name="L850"> 8css_datahref="+code=__fass_dataverss/clk/clk.c#L785" idcss" class="line" ncss"vers[>notifier_countidxhref="+code=__fidxvers] href="+code=parent" class="sr16o1e=clk" 16of">ops->160ode=n}c#L808" id="L808" class="line16o2e=clk" 16olk" class="sref">clk160=NOTI0L807"> 807EXPORTfSYMBOL_GPef="+code=child"EXPORTfSYMBOL_GPecode"lk->)
160"L852" class="line" name="L852"> 816o4e=clk" 16oclk.c#L793" id="L793" c16ocl>160="L853" class="line" name="L88ef="drivers/clk/clk.c#L780" id="L78016o5e=clk" 16oamp; 854 795             16o">>160t the new rates notifying thh @np: Device kode7pointer associ"srdimethsceock"providers/="drivers/clk/clk.c#L780" id="L78016o7e=clk" 16oers/clk/clk.c#L796" id=16oer>160ass="comment"> * change on th @op<_src_get: c#llback"for de; 853
 853
16o <>160ass="comment"> * abort the c*ref="drivers/clk/clk.c#L780" id="L780161de=clk" 16vers/clk/clk.c#L809" id=16ver>1610_couint4" class="sref">cf_op<_add_provider>)
 83 803
parent-16cla>161ref="ef="+code=clk" class="sref">cl16v5e=clk" 16/a>,  83of_op<_provider href="drivers/cf_op<_provider_counf="+code=clk_calapef="drivers/clkcp53   href="+code=parent" class="sr16v6e=clk" 16href="drivers/clk/clk.c#16hre>161arent_rate" class="sref">parent_ra1617e=clk" 166"> 816             166">>1617NOTIFY_BAD" lk.c#L789" id="apef="drivers/clkcp53   ==clk.c#L804" id=kzalloc name="L814"> 8kzalloccodecsizeof""line" name="L831"> 83of_op<_provider href="drivers/cf_op<_provider_cou),=a href="+code=tGFP_KERNEef="+code=child"GFP_KERNEeate"a href="+code=parent" class="sr1618e=clk" 16vers/clk/clk.c#L817" id=16ver>161 pef="drivers/clkcp53  ahref="+code=parent" class="sr16v9e=clk" 16href="drivers/clk/clk.c#16hre>161r_count" class="sref"="line"->notifier_countENOMEMf="+code=child"ENOMEMa hr href="+code=parent" class="sr162de=clk" 16lass="line" name="L819">16las>16lahrefc#L808" id="L808" class="line1621e=clk" 16lass="sref">clk, 162ode=new_rate"/clk.c#L785" id pef="drivers/clkcp53  s/clk/clk.c#L785" idno="href="+code=__fkodes/cl ==clk.c#L804" id=cf_kode_g/a>)
-> 822       16e=">162 href="+code=/clk.c#L785" id pef="drivers/clkcp53  s/clk/clk.c#L785" idg/a>)
;
;
li.c_add="sref">clkli.c_addcode"hlist_for_each_entryopef="drivers/clkcp53  s/clk/clk.c#L785" idlinnL;
1627NOTIFY_BAD" lk.c#L789" id="mutex_une" nL;
;
162 8=r_debugcode"l" class="linclass="line" nAddrd neock arom ame="L     notifier_countnpef="drivers/clknpcodes/clk/clk.c#L785" idful8_ 82816ne">162r_couhref="+code=parent" class="sr163de=clk" 16="L829" class="line" nam16="L>163dNOTIFY_BAD" ="line"0 href="+code=parent" class="sr16=1e=clk" 16ref">clk, unsigned l16ref>163ode=n}c#L808" id="L808" class="line1632e=clk" 16ref="drivers/clk/clk.c#L16ref>163=NOTI0L807"> 807EXPORTfSYMBOL_GPef="+code=child"EXPORTfSYMBOL_GPecode"lk->)
hlist_no16e" >163"L852" class="line" name="L852"> 81634e=clk" 16" class="sref">fail_clk<16" c>163="L853" class="line" name="L88ef="drivers/clk/clk.c#L780" id="L7801635e=clk" 16sref">ret = 163"> 854clk->163ass="comment"> * change on thref="drivers/clk/clk.c#L780" id="L7801638e=clk" 16837" id="L837" class="li16837>163 83cf_op<_del_provider>)
cl164de=clk" 16/a>-> 83of_op<_provider href="drivers/cf_op<_provider_counf="+code=clk_calapef="drivers/clkcp53   href="+code=parent" class="sr1641e=clk" 16s="sref">clk-> 77href="+code=parent" class="sr1642e=clk" 16"sref">ret == 164=NOTIFY_BAD" /clk.c#L785" idmutex_e" nL;
;
fail_cl16lk">164 href="+code=/clk.c#L785" idli.c_ass_each_amery name="L814"> 8li.c_ass_each_amerycode"lk->notifier_countlinnL;
cl1644e=clk" 16vers/clk/clk.c#L843" id=16ver>164ref="+code=rate" clas/a>-a href="+code=topef="drivers/clkcp53  s/clk/clk.c#L785" idno="href="+code=__fkodes/cl =/cclk.c#L804" id=npef="drivers/clknpcodeasef="+code=clk" class="sref">cl1645e=clk" 16href="drivers/clk/clk.c#16hre>164ound_rate" class="sre="+code=/clk.c#L785" idli.c_del name="L814"> 8li.c_delcode"hlist_for_each_entryopef="drivers/clkcp53  s/clk/clk.c#L785" idlinnL;
children, c>164hild_node" class="sre="+code=/clk.c#L785" idcf_kode_p->child164code=new_rate" class=="+code=/clk.c#L785" idkfre href="+code=__fkfre codeclk-> 847            1647">164fail_cl16lk">164r_count" class="sref"}c#L808" id="L808" class="line165de=clk" 16vers/clk/clk.c#L849" id=16ver>165dNOTIFY_BAD" }c#L808" id="L808" class="line1651e=clk" 16href="drivers/clk/clk.c#16hre>165ode=new_rate"/clk.c#L785" idmutex_une" nL;
;
        /a>->165=NOTI}c#L808" id="L808" class="line1653e=clk" 16ref="drivers/clk/clk.c#L16ref>165 href0L807"> 807EXPORTfSYMBOL_GPef="+code=child"EXPORTfSYMBOL_GPecode"lk->)

)
 * walk down a subtre16t">>165arentef="+code=clk" class="sref">cl1657e=clk" 16ne" name="L856"> 85616ne">1657NOTIFY_BAD" "line" name="L831"> 83of_op<_provider href="drivers/cf_op<_provider_counf="+code=clk_calprovider href="drivers/provider_cou href="+code=parent" class="sr1658e=clk" 16="L857" class="line" nam16="L>1658NOTIFY_BAD" "line" name="L831"> 83 803

)
c16cod>165r_couhref="+code=parent" class="sr166de=clk" 16ref="drivers/clk/clk.c#L16ref>166dNOTIFY_BAD" l" class="line" name="L8 Check0if we have suchta provider in our arraythref="drivers/clk/clk.c#L780" id="L7801661e=clk" 16=clk" class="sref">clk166ode=new_rate"/clk.c#L785" idmutex_e" nL;
;
166=NOTIFY_BAD" /clk.c#L785" idli.c_ass_each_amery name="L814"> 8li.c_ass_each_amerycode"lk->notifier_countlinnL;
cl1663e=clk" 16g -a href="+code=tprovider href="drivers/provider_cous/clk/clk.c#L785" idno="href="+code=__fkodes/cl =/cclk.c#L804" id=assspec3
hw, 166ref="+code=rate" classsssssss="+code=clk_cal 803
)
->
166ound_rate" class="sre/a>-ne" name="L803">IS_ERRhref="+code=__fIS_ERRs/cl"lk->
new_rate = 166hild_node" class="sre="+code=break href="+code=parent" class="sr1667e=clk" 16"sref">child->1667NOTIFY_BAD" }c#L808" id="L808" class="line1668e=clk" 16vers/clk/clk.c#L767" id=16ver>166;
;
 8css3
167=NOTIhref="+code=parent" class="sr1673e=clk" 16class="line" name="L772"16cla>167 hrefconst=charef="+code=clk_calcf_op<_gec_clasnt_indexef="drivers/clkindexcodeahref="+code=parent" class="sr1674e=clk" 16="L773" class="line" nam16="L>167ref="ef="+code=clk" class="sref">cl1675e=clk" 16"sref">clk, unsigned16"sr>1675href="+code="line" name="L831"> 83cf_phandle_ar9" class="line" ncf_phandle_ar9"verselk->
to16ode>1677NOTIFY_BAD" rULL" class="sref">
167r_count" clas/a>-a href="+code=tindexef="drivers/clkindexcode < 0ahref="+code=parent" class="sr168de=clk" 16href="drivers/clk/clk.c#16hre>168dNOTIFY_BAD" class="s="line" name="L850"> 8NULef="+code=child"NULes/cl href="+code=parent" class="sr1681e=clk" 16ne" name="L780"> 78016ne">168"> 77href="+code=parent" class="sr1682e=clk" 16lass="sref">IS_ERR_OR_NU16las>168=NOTIFY_BAD" /clk.c#L785" id
->" class="linclass="line" n#ceock-cells    href="+code=tindexef="drivers/clkindexcode,href="+code=parent" class="sr1683e=clk" 16782                /16782>168 href="+code=NULL" cl+code=raaaaaaaaaaaaaaaaahlist_for_each_entryop
-a href="+code=t
 8NULef="+code=child"NULes/cl href="+code=parent" class="sr1686e=clk" 16 class="sref">clk-&g16 cl>168arent_rate" class="sref">parent_ra16h7e=clk" 16" class="sref">parent1687ef="+code=ra/a>-a href="+code=tcf_property_read_class=_indexef="drivers/clkcf_property_read_class=_indexs/cl"lk->
parent_ra16h8e=clk" 16href="drivers/clk/clk.c#16hre>168->
)
->
)
parent_ra16h9e=clk" 16      
ops->169"> 77href="+code=parent" class="sr1692e=clk" 16clk" class="sref">clk169=NOTIFY_BAD" /clk.c#L785" idcf_kode_p->
169 href="+code=="line" name="L850"> 8css_169ref="}c#L808" id="L808" class="line1695e=clk" 16& 807EXPORTfSYMBOL_GPef="+code=child"EXPORTfSYMBOL_GPecode"lk-> 795             165">>169arent_rate" class="sref">parent_ra1697e=clk" 16vers/clk/clk.c#L796" id=16ver>169ass="comment"> * change on L88ef="drivers/clk/clk.c#L780" id="L7801698e=clk" 16href="drivers/clk/clk.c#16hre>169walk down the whole tree aga8 cf_op<_init() - Scn tand init ceock"providers arom the DTef="drivers/clk/clk.c#L780" id="L7801699e=clk" 16  16  <>169ass="comment"> * abort the c* @matches: arraytrefcompatible"valurstand init spand719s for providers.53"> 853
17ode>170"ef="2 853
ops->170"> 770 853
clk170g the topmost clock that has* c#lls their initializad719capand719s53"> 853
170"> 722170="L85void name="L831"> 83__inithref="+code=__f__initverselk-> 83cf_device_id="sref">clkcf_device_idversef="+code=clk_calmatchesL;
cl17o6e=clk" 17o"> 795             17o">>1706href="+code="line" name="L831"> 83device_ef="href="+code=__fdevice_ef="versef="+code=clk_calnpef="drivers/clknpcode href="+code=parent" class="sr17o7e=clk" 17oers/clk/clk.c#L796" id=17oer>170code=new_rate" class="sref">new_ra17o8e=clk" 17oref="drivers/clk/clk.c#17ore>170->;
cl17o9e=clk" 17o 17o <>170r_count" class="sref"const="line" name="L831"> 83cf_device_id="sref">clkcf_device_idversef="+code=clk_calmatchL;
->;
notifier_countnpef="drivers/clknpcodea href="+code=parent" class="sr171de=clk" 17vers/clk/clk.c#L809" id=17ver>171dNOTIFY_BAD" class="slk.c#L789" id="cf_op<_init_cb_thref="+code=__fcf_op<_init_cb_tverselk->;
->parent-17cla>171ref="#endifc#L808" id="L808" class="line17v5e=clk" 17/a>, LXR ass=unitycodec"this experi="coal 808"719cby #L808" idmailto:lxr@ratux.no">lxr@ratux.nocode.
lxr.ratux.no kindly hossrdiby #L808" idhttp://www.redpill-ratpro.no">Redpill Latpro AScodec"provider refLatux"consultingland operad719s services since 1995.