cregit-Linux how code gets into the kernel

Release 4.7 drivers/clk/clk-devres.c

Directory: drivers/clk
/*
 * 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

PersonTokensPropCommitsCommitProp
lars-peter clausenlars-peter clausen27100.00%1100.00%
Total27100.00%1100.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

PersonTokensPropCommitsCommitProp
lars-peter clausenlars-peter clausen95100.00%1100.00%
Total95100.00%1100.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

PersonTokensPropCommitsCommitProp
lars-peter clausenlars-peter clausen57100.00%1100.00%
Total57100.00%1100.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

PersonTokensPropCommitsCommitProp
lars-peter clausenlars-peter clausen3597.22%150.00%
mark brownmark brown12.78%150.00%
Total36100.00%2100.00%

EXPORT_SYMBOL(devm_clk_put);

Overall Contributors

PersonTokensPropCommitsCommitProp
lars-peter clausenlars-peter clausen23799.58%150.00%
mark brownmark brown10.42%150.00%
Total238100.00%2100.00%
Directory: drivers/clk
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}