]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
clk: imx8: fix build warning
authorPeng Fan <peng.fan@nxp.com>
Sat, 15 Dec 2018 12:19:46 +0000 (12:19 +0000)
committerStefano Babic <sbabic@denx.de>
Wed, 9 Jan 2019 16:03:29 +0000 (17:03 +0100)
When build clk driver in spl, met the warning:
"
drivers/clk/imx/clk-imx8.c:21:25: warning: ‘imx8_clk_names’ defined but not used [-Wunused-variable]
 static struct imx8_clks imx8_clk_names[] = {
                         ^~~~~~~~~~~~~~
"

Fix with wrapping the array with CONFIG_CMD_CLK.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/clk/imx/clk-imx8.c

index fcb8090d35753d79b87a00e82cefcb56f6b18b3f..d03fcc2fddbe618e8fe9811c8a25b40087be99ec 100644 (file)
@@ -18,6 +18,7 @@ struct imx8_clks {
        const char *name;
 };
 
+#if CONFIG_IS_ENABLED(CMD_CLK)
 static struct imx8_clks imx8_clk_names[] = {
        { IMX8QXP_A35_DIV, "A35_DIV" },
        { IMX8QXP_I2C0_CLK, "I2C0" },
@@ -39,6 +40,7 @@ static struct imx8_clks imx8_clk_names[] = {
        { IMX8QXP_ENET1_REF_DIV, "ENET1_REF" },
        { IMX8QXP_ENET1_PTP_CLK, "ENET1_PTP" },
 };
+#endif
 
 static ulong imx8_clk_get_rate(struct clk *clk)
 {