diff options
author | Andre Przywara <andre.przywara@arm.com> | 2023-02-03 11:00:26 +0000 |
---|---|---|
committer | Andre Przywara <andre.przywara@arm.com> | 2023-02-03 13:31:28 +0000 |
commit | 06eb3e366b726efc55eddeaab171d7501ce41b5f (patch) | |
tree | 6b6d7d36b80425275184b10a2d924826eafc078a /drivers/allwinner | |
parent | 658b3154d5b06a467b65cb79d31da751ffc6f5a4 (diff) | |
download | arm-trusted-firmware-06eb3e366b726efc55eddeaab171d7501ce41b5f.tar.gz |
refactor(allwinner): use fdt_node_is_enabled() in AXP driver
The Allwinner AXP driver was using a private implementation of that
function, remove that in favour of our now common implementation.
Change-Id: I7bd311d73060d4bc83f93cff6bedf6c78dddd3ca
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'drivers/allwinner')
-rw-r--r-- | drivers/allwinner/axp/common.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/allwinner/axp/common.c b/drivers/allwinner/axp/common.c index f1250b0c9..79f908934 100644 --- a/drivers/allwinner/axp/common.c +++ b/drivers/allwinner/axp/common.c @@ -9,6 +9,7 @@ #include <libfdt.h> #include <common/debug.h> +#include <common/fdt_wrappers.h> #include <drivers/allwinner/axp.h> int axp_check_id(void) @@ -97,19 +98,9 @@ static int setup_regulator(const void *fdt, int node, return 0; } -static bool is_node_disabled(const void *fdt, int node) -{ - const char *cell; - cell = fdt_getprop(fdt, node, "status", NULL); - if (cell == NULL) { - return false; - } - return strcmp(cell, "okay") != 0; -} - static bool should_enable_regulator(const void *fdt, int node) { - if (is_node_disabled(fdt, node)) { + if (!fdt_node_is_enabled(fdt, node)) { return false; } if (fdt_getprop(fdt, node, "phandle", NULL) != NULL) { |