参照元

説明

引数

返り値

参考

実装

#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)

...

static struct clk *__of_clk_get_by_name(struct device_node *np,
                                        const char *dev_id,
                                        const char *name)
{
        struct clk *clk = ERR_PTR(-ENOENT);
        /* Walk up the tree of devices looking for a clock that matches */
        while (np) {
                int index = 0;

                /*
                 * For named clocks, first look up the name in the
                 * "clock-names" property.  If it cannot be found, then
                 * index will be an error code, and of_clk_get() will fail.
                 */
                if (name)
                        index = of_property_match_string(np, "clock-names", name);
                clk = __of_clk_get(np, index, dev_id, name);
                if (!IS_ERR(clk)) {
                        break;
                } else if (name && index >= 0) {
                        if (PTR_ERR(clk) != -EPROBE_DEFER)
                                pr_err("ERROR: could not get clock %s:%s(%i)\n",
                                        np->full_name, name ? name : "", index);
                        return clk;
                }
                /*
                 * No matching clock found on this node.  If the parent node
                 * has a "clock-ranges" property, then we can try one of its
                 * clocks.
                 */
                np = np->parent;
                if (np && !of_get_property(np, "clock-ranges", NULL))
                        break;
        }

        return clk;
}

...

#else /* defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK) */

static struct clk *__of_clk_get_by_name(struct device_node *np,
                                        const char *dev_id,
                                        const char *name)
{
        return ERR_PTR(-ENOENT);
}
#endif

コメント


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2016-05-24 (火) 16:55:27