1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #include <linux/clk-provider.h>
- #include <linux/device.h>
- #include "clk-uniphier.h"
- struct clk_hw *uniphier_clk_register_fixed_rate(struct device *dev,
- const char *name,
- const struct uniphier_clk_fixed_rate_data *data)
- {
- struct clk_fixed_rate *fixed;
- struct clk_init_data init;
- int ret;
-
- fixed = devm_kzalloc(dev, sizeof(*fixed), GFP_KERNEL);
- if (!fixed)
- return ERR_PTR(-ENOMEM);
- init.name = name;
- init.ops = &clk_fixed_rate_ops;
- init.parent_names = NULL;
- init.num_parents = 0;
- fixed->fixed_rate = data->fixed_rate;
- fixed->hw.init = &init;
- ret = devm_clk_hw_register(dev, &fixed->hw);
- if (ret)
- return ERR_PTR(ret);
- return &fixed->hw;
- }
|