Release 4.11 drivers/clk/clk-devres.c
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/export.h>
#include <linux/gfp.h>
static void devm_clk_release(struct device *dev, void *res)
{
clk_put(*(struct clk **)res);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Lars-Peter Clausen | 27 | 100.00% | 1 | 100.00% |
Total | 27 | 100.00% | 1 | 100.00% |
struct clk *devm_clk_get(struct device *dev, const char *id)
{
struct clk **ptr, *clk;
ptr = devres_alloc(devm_clk_release, sizeof(*ptr), GFP_KERNEL);
if (!ptr)
return ERR_PTR(-ENOMEM);
clk = clk_get(dev, id);
if (!IS_ERR(clk)) {
*ptr = clk;
devres_add(dev, ptr);
} else {
devres_free(ptr);
}
return clk;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Lars-Peter Clausen | 95 | 100.00% | 1 | 100.00% |
Total | 95 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(devm_clk_get);
static int devm_clk_match(struct device *dev, void *res, void *data)
{
struct clk **c = res;
if (!c || !*c) {
WARN_ON(!c || !*c);
return 0;
}
return *c == data;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Lars-Peter Clausen | 57 | 100.00% | 1 | 100.00% |
Total | 57 | 100.00% | 1 | 100.00% |
void devm_clk_put(struct device *dev, struct clk *clk)
{
int ret;
ret = devres_release(dev, devm_clk_release, devm_clk_match, clk);
WARN_ON(ret);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Lars-Peter Clausen | 35 | 97.22% | 1 | 50.00% |
Mark Brown | 1 | 2.78% | 1 | 50.00% |
Total | 36 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(devm_clk_put);
struct clk *devm_get_clk_from_child(struct device *dev,
struct device_node *np, const char *con_id)
{
struct clk **ptr, *clk;
ptr = devres_alloc(devm_clk_release, sizeof(*ptr), GFP_KERNEL);
if (!ptr)
return ERR_PTR(-ENOMEM);
clk = of_clk_get_by_name(np, con_id);
if (!IS_ERR(clk)) {
*ptr = clk;
devres_add(dev, ptr);
} else {
devres_free(ptr);
}
return clk;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Kuninori Morimoto | 100 | 100.00% | 1 | 100.00% |
Total | 100 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(devm_get_clk_from_child);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Lars-Peter Clausen | 237 | 69.10% | 1 | 33.33% |
Kuninori Morimoto | 105 | 30.61% | 1 | 33.33% |
Mark Brown | 1 | 0.29% | 1 | 33.33% |
Total | 343 | 100.00% | 3 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.