]> Git Repo - J-linux.git/blob - drivers/clk/meson/meson-clkc-utils.c
Merge tag 'vfs-6.13-rc7.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
[J-linux.git] / drivers / clk / meson / meson-clkc-utils.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (c) 2023 Neil Armstrong <[email protected]>
4  */
5
6 #include <linux/of_device.h>
7 #include <linux/clk-provider.h>
8 #include <linux/module.h>
9 #include "meson-clkc-utils.h"
10
11 struct clk_hw *meson_clk_hw_get(struct of_phandle_args *clkspec, void *clk_hw_data)
12 {
13         const struct meson_clk_hw_data *data = clk_hw_data;
14         unsigned int idx = clkspec->args[0];
15
16         if (idx >= data->num) {
17                 pr_err("%s: invalid index %u\n", __func__, idx);
18                 return ERR_PTR(-EINVAL);
19         }
20
21         return data->hws[idx];
22 }
23 EXPORT_SYMBOL_NS_GPL(meson_clk_hw_get, "CLK_MESON");
24
25 MODULE_DESCRIPTION("Amlogic Clock Controller Utilities");
26 MODULE_LICENSE("GPL");
27 MODULE_IMPORT_NS("CLK_MESON");
This page took 0.027237 seconds and 4 git commands to generate.