From: "Marek Behún" <kabel@kernel.org>
To: Stefan Roese <sr@denx.de>
Cc: u-boot@lists.denx.de, "Pali Rohár" <pali@kernel.org>,
"Marek Behún" <marek.behun@nic.cz>,
"Aaron Williams" <awilliams@marvell.com>,
"Ramon Fried" <rfried.dev@gmail.com>,
"Vladimir Oltean" <vladimir.oltean@nxp.com>
Subject: [PATCH u-boot-marvell RESEND 02/11] treewide: Use fdt_create_phandle() where appropriate
Date: Fri, 26 Nov 2021 14:57:06 +0100 [thread overview]
Message-ID: <20211126135715.26485-3-kabel@kernel.org> (raw)
In-Reply-To: <20211126135715.26485-1-kabel@kernel.org>
From: Marek Behún <marek.behun@nic.cz>
Replace fdt_alloc_phandle() with subsequent fdt_set_phandle() by
fdt_create_phandle().
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
---
board/Marvell/octeon_ebb7304/board.c | 5 ++---
drivers/misc/fsl_portals.c | 10 ++++------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/board/Marvell/octeon_ebb7304/board.c b/board/Marvell/octeon_ebb7304/board.c
index e8e2d547c1..c6c7c13483 100644
--- a/board/Marvell/octeon_ebb7304/board.c
+++ b/board/Marvell/octeon_ebb7304/board.c
@@ -205,7 +205,7 @@ static int fdt_fix_mix(const void *fdt)
int env_lmac = -1;
int lmac_fdt_node = -1;
int mix_fdt_node = -1;
- int lmac_phandle;
+ unsigned int lmac_phandle;
char *compat;
/* Get the lmac for this environment variable */
@@ -229,8 +229,7 @@ static int fdt_fix_mix(const void *fdt)
}
}
- lmac_phandle = fdt_alloc_phandle((void *)fdt);
- fdt_set_phandle((void *)fdt, lmac_fdt_node, lmac_phandle);
+ lmac_phandle = fdt_create_phandle((void *)fdt, lmac_fdt_node);
/* Get the fdt mix node corresponding to this lmac */
mix_fdt_node = get_mix_fdt_node(fdt, env_node, env_lmac);
diff --git a/drivers/misc/fsl_portals.c b/drivers/misc/fsl_portals.c
index 632430e420..02bc3f86ca 100644
--- a/drivers/misc/fsl_portals.c
+++ b/drivers/misc/fsl_portals.c
@@ -106,7 +106,7 @@ static int fdt_qportal(void *blob, int off, int id, char *name,
enum fsl_dpaa_dev dev, int create)
{
int childoff, dev_off, ret = 0;
- u32 dev_handle;
+ unsigned int dev_handle;
#ifdef CONFIG_FSL_CORENET
int num;
u32 liodns[2];
@@ -142,11 +142,9 @@ static int fdt_qportal(void *blob, int off, int id, char *name,
if (childoff > 0) {
dev_handle = fdt_get_phandle(blob, dev_off);
if (dev_handle <= 0) {
- dev_handle = fdt_alloc_phandle(blob);
- ret = fdt_set_phandle(blob, dev_off,
- dev_handle);
- if (ret < 0)
- return ret;
+ dev_handle = fdt_create_phandle(blob, dev_off);
+ if (!dev_handle)
+ return -FDT_ERR_NOPHANDLES;
}
ret = fdt_setprop(blob, childoff, "dev-handle",
--
2.32.0
next prev parent reply other threads:[~2021-11-26 13:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-26 13:57 [PATCH u-boot-marvell RESEND 00/11] Some mvebu comphy + mox + fdt_support changes Marek Behún
2021-11-26 13:57 ` [PATCH u-boot-marvell RESEND 01/11] include/linux/byteorder: Fix compilation of __constant_cpu_to_be32() Marek Behún
2021-11-26 13:57 ` Marek Behún [this message]
2021-11-26 13:57 ` [PATCH u-boot-marvell RESEND 03/11] fdt_support: Remove fdt_alloc_phandle() in favor of fdt_generate_phandle() Marek Behún
2021-12-03 3:31 ` Simon Glass
2021-11-26 13:57 ` [PATCH u-boot-marvell RESEND 04/11] fdt_support: Remove FDT_STATUS_FAIL_ERROR_CODE Marek Behún
2021-12-03 3:31 ` Simon Glass
2021-11-26 13:57 ` [PATCH u-boot-marvell RESEND 05/11] fdt_support: Fix comment for fdt_create_phandle() Marek Behún
2021-11-26 13:57 ` [PATCH u-boot-marvell RESEND 06/11] fdt_support: Add some useful functions Marek Behún
2021-11-26 13:57 ` [PATCH u-boot-marvell RESEND 07/11] arm: mvebu: turris_mox: Find DT nodes by compatible or alias instead of path Marek Behún
2021-11-26 13:57 ` [PATCH u-boot-marvell RESEND 08/11] arm: mvebu: turris_mox: Enable eth1 in U-Boot if a network module is present Marek Behún
2021-11-26 13:57 ` [PATCH u-boot-marvell RESEND 09/11] phy: marvell: a3700: Convert to official DT bindings in COMPHY driver Marek Behún
2021-11-30 6:18 ` Stefan Roese
2021-11-26 13:57 ` [PATCH u-boot-marvell RESEND 10/11] arm: mvebu: turris_mox: Fix unstable board topology reading Marek Behún
2021-11-26 13:57 ` [PATCH u-boot-marvell RESEND 11/11] fdt_support: Add fdt_delete_disabled_nodes() and use in Turris MOX Marek Behún
2021-12-16 11:15 ` [PATCH u-boot-marvell RESEND 00/11] Some mvebu comphy + mox + fdt_support changes Pali Rohár
2021-12-18 13:46 ` Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211126135715.26485-3-kabel@kernel.org \
--to=kabel@kernel.org \
--cc=awilliams@marvell.com \
--cc=marek.behun@nic.cz \
--cc=pali@kernel.org \
--cc=rfried.dev@gmail.com \
--cc=sr@denx.de \
--cc=u-boot@lists.denx.de \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox