mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-23 12:14:32 +08:00
cmd: clk: simplify clk command
CONFIG_DM is always true. The clk command is only built if CONFIG_CLK=y. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
parent
56efea8805
commit
6015f59086
14
cmd/clk.c
14
cmd/clk.c
@ -4,15 +4,12 @@
|
||||
*/
|
||||
#include <command.h>
|
||||
#include <clk.h>
|
||||
#if defined(CONFIG_DM) && defined(CONFIG_CLK)
|
||||
#include <dm.h>
|
||||
#include <dm/device.h>
|
||||
#include <dm/root.h>
|
||||
#include <dm/device-internal.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DM) && defined(CONFIG_CLK)
|
||||
static void show_clks(struct udevice *dev, int depth, int last_flag)
|
||||
{
|
||||
int i, is_last;
|
||||
@ -79,13 +76,6 @@ static int soc_clk_dump(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int soc_clk_dump(void)
|
||||
{
|
||||
puts("Not implemented\n");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int do_clk_dump(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
@ -101,7 +91,6 @@ static int do_clk_dump(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if CONFIG_IS_ENABLED(DM) && CONFIG_IS_ENABLED(CLK)
|
||||
static int do_clk_setfreq(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
@ -131,13 +120,10 @@ static int do_clk_setfreq(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
printf("set_rate returns %u\n", freq);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct cmd_tbl cmd_clk_sub[] = {
|
||||
U_BOOT_CMD_MKENT(dump, 1, 1, do_clk_dump, "", ""),
|
||||
#if CONFIG_IS_ENABLED(DM) && CONFIG_IS_ENABLED(CLK)
|
||||
U_BOOT_CMD_MKENT(setfreq, 3, 1, do_clk_setfreq, "", ""),
|
||||
#endif
|
||||
};
|
||||
|
||||
static int do_clk(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
|
Loading…
Reference in New Issue
Block a user