mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-07 21:33:54 +00:00
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:
parent
658b3154d5
commit
06eb3e366b
1 changed files with 2 additions and 11 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue