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>
This commit is contained in:
Andre Przywara 2023-02-03 11:00:26 +00:00
parent 658b3154d5
commit 06eb3e366b

View file

@ -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) {