*参照元 [#y517144e]
#backlinks

*説明 [#c28a37ba]
-パス: [[linux-4.4.1/drivers/clk/clkdev.c]]

-FIXME: これは何?
--説明


**引数 [#gf52ba5f]
-struct device_node *np
--
--[[linux-4.4.1/]]
-const char *dev_id
--
-const char *name
--


**返り値 [#fe9db928]
-struct clk *
--
--[[linux-4.4.1/clk]]


**参考 [#m5725c21]


*実装 [#r4ec00a0]
 #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);
 
-
--[[linux-4.4.1/clk]]
--[[linux-4.4.1/ERR_PTR()]]

         /* 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);
-
--[[linux-4.4.1/of_property_match_string()]]

                 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;
                 }
 
-
--[[linux-4.4.1/__of_clk_get()]]
--[[linux-4.4.1/IS_ERR()]]
--[[linux-4.4.1/PTR_ERR()]]
--[[linux-4.4.1/pr_err()]]

                 /*
                  * 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;
-
--[[linux-4.4.1/of_get_property()]]

         }
 
         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


*コメント [#m02170ef]


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS