public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
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>
Subject: [PATCH u-boot-marvell 04/11] fdt_support: Remove FDT_STATUS_FAIL_ERROR_CODE
Date: Wed,  3 Nov 2021 03:02:37 +0100	[thread overview]
Message-ID: <20211103020244.25428-5-kabel@kernel.org> (raw)
In-Reply-To: <20211103020244.25428-1-kabel@kernel.org>

From: Marek Behún <marek.behun@nic.cz>

Since no one uses this feature and I am not aware of any parsers of this
in Linux, remove it.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
---
 arch/arm/cpu/armv7/ls102xa/fdt.c         |  6 +++---
 board/gateworks/gw_ventana/common.c      |  3 +--
 board/kontron/sl28/sl28.c                |  2 +-
 common/fdt_support.c                     | 20 +++++---------------
 drivers/pci/pcie_layerscape_fixup.c      |  8 ++++----
 drivers/pci/pcie_layerscape_gen4_fixup.c |  8 ++++----
 include/fdt_support.h                    | 18 ++++++++----------
 7 files changed, 26 insertions(+), 39 deletions(-)

diff --git a/arch/arm/cpu/armv7/ls102xa/fdt.c b/arch/arm/cpu/armv7/ls102xa/fdt.c
index 0daf8234fb..bf6cc6d4e7 100644
--- a/arch/arm/cpu/armv7/ls102xa/fdt.c
+++ b/arch/arm/cpu/armv7/ls102xa/fdt.c
@@ -184,13 +184,13 @@ void ft_cpu_setup(void *blob, struct bd_info *bd)
 #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
 	off = fdt_node_offset_by_compat_reg(blob, FSL_IFC_COMPAT,
 					    CONFIG_SYS_IFC_ADDR);
-	fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
+	fdt_set_node_status(blob, off, FDT_STATUS_DISABLED);
 #else
 	off = fdt_node_offset_by_compat_reg(blob, FSL_QSPI_COMPAT,
 					    QSPI0_BASE_ADDR);
-	fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
+	fdt_set_node_status(blob, off, FDT_STATUS_DISABLED);
 	off = fdt_node_offset_by_compat_reg(blob, FSL_DSPI_COMPAT,
 					    DSPI1_BASE_ADDR);
-	fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
+	fdt_set_node_status(blob, off, FDT_STATUS_DISABLED);
 #endif
 }
diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index 2be921f47a..7ec931c8a8 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -1681,8 +1681,7 @@ void ft_early_fixup(void *blob, int board_type)
 		 * disable serial2 node for GW54xx for compatibility with older
 		 * 3.10.x kernel that improperly had this node enabled in the DT
 		 */
-		fdt_set_status_by_alias(blob, "serial2", FDT_STATUS_DISABLED,
-					0);
+		fdt_set_status_by_alias(blob, "serial2", FDT_STATUS_DISABLED);
 
 		/* GW54xx-E adds WDOG2_B external reset */
 		if (rev < 'E')
diff --git a/board/kontron/sl28/sl28.c b/board/kontron/sl28/sl28.c
index c8ed7ac81a..e84b356918 100644
--- a/board/kontron/sl28/sl28.c
+++ b/board/kontron/sl28/sl28.c
@@ -75,7 +75,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	if (CONFIG_IS_ENABLED(SL28_SPL_LOADS_OPTEE_BL32)) {
 		node = fdt_node_offset_by_compatible(blob, -1, "linaro,optee-tz");
 		if (node)
-			fdt_set_node_status(blob, node, FDT_STATUS_OKAY, 0);
+			fdt_set_node_status(blob, node, FDT_STATUS_OKAY);
 	}
 
 	return 0;
diff --git a/common/fdt_support.c b/common/fdt_support.c
index be03a87d42..8ac905011c 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -1541,14 +1541,10 @@ unsigned int fdt_create_phandle(void *fdt, int nodeoffset)
  *
  * @fdt: ptr to device tree
  * @nodeoffset: node to update
- * @status: FDT_STATUS_OKAY, FDT_STATUS_DISABLED,
- *	    FDT_STATUS_FAIL, FDT_STATUS_FAIL_ERROR_CODE
- * @error_code: optional, only used if status is FDT_STATUS_FAIL_ERROR_CODE
+ * @status: FDT_STATUS_OKAY, FDT_STATUS_DISABLED, FDT_STATUS_FAIL
  */
-int fdt_set_node_status(void *fdt, int nodeoffset,
-			enum fdt_status status, unsigned int error_code)
+int fdt_set_node_status(void *fdt, int nodeoffset, enum fdt_status status)
 {
-	char buf[16];
 	int ret = 0;
 
 	if (nodeoffset < 0)
@@ -1564,10 +1560,6 @@ int fdt_set_node_status(void *fdt, int nodeoffset,
 	case FDT_STATUS_FAIL:
 		ret = fdt_setprop_string(fdt, nodeoffset, "status", "fail");
 		break;
-	case FDT_STATUS_FAIL_ERROR_CODE:
-		sprintf(buf, "fail-%d", error_code);
-		ret = fdt_setprop_string(fdt, nodeoffset, "status", buf);
-		break;
 	default:
 		printf("Invalid fdt status: %x\n", status);
 		ret = -1;
@@ -1582,16 +1574,14 @@ int fdt_set_node_status(void *fdt, int nodeoffset,
  *
  * @fdt: ptr to device tree
  * @alias: alias of node to update
- * @status: FDT_STATUS_OKAY, FDT_STATUS_DISABLED,
- *	    FDT_STATUS_FAIL, FDT_STATUS_FAIL_ERROR_CODE
- * @error_code: optional, only used if status is FDT_STATUS_FAIL_ERROR_CODE
+ * @status: FDT_STATUS_OKAY, FDT_STATUS_DISABLED, FDT_STATUS_FAIL
  */
 int fdt_set_status_by_alias(void *fdt, const char* alias,
-			    enum fdt_status status, unsigned int error_code)
+			    enum fdt_status status)
 {
 	int offset = fdt_path_offset(fdt, alias);
 
-	return fdt_set_node_status(fdt, offset, status, error_code);
+	return fdt_set_node_status(fdt, offset, status);
 }
 
 #if defined(CONFIG_VIDEO) || defined(CONFIG_LCD)
diff --git a/drivers/pci/pcie_layerscape_fixup.c b/drivers/pci/pcie_layerscape_fixup.c
index a58e7a3892..92105a7103 100644
--- a/drivers/pci/pcie_layerscape_fixup.c
+++ b/drivers/pci/pcie_layerscape_fixup.c
@@ -582,9 +582,9 @@ static void ft_pcie_rc_fix(void *blob, struct ls_pcie_rc *pcie_rc)
 		return;
 
 	if (pcie_rc->enabled && pcie->mode == PCI_HEADER_TYPE_BRIDGE)
-		fdt_set_node_status(blob, off, FDT_STATUS_OKAY, 0);
+		fdt_set_node_status(blob, off, FDT_STATUS_OKAY);
 	else
-		fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
+		fdt_set_node_status(blob, off, FDT_STATUS_DISABLED);
 }
 
 static void ft_pcie_ep_fix(void *blob, struct ls_pcie_rc *pcie_rc)
@@ -598,9 +598,9 @@ static void ft_pcie_ep_fix(void *blob, struct ls_pcie_rc *pcie_rc)
 		return;
 
 	if (pcie_rc->enabled && pcie->mode == PCI_HEADER_TYPE_NORMAL)
-		fdt_set_node_status(blob, off, FDT_STATUS_OKAY, 0);
+		fdt_set_node_status(blob, off, FDT_STATUS_OKAY);
 	else
-		fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
+		fdt_set_node_status(blob, off, FDT_STATUS_DISABLED);
 }
 
 static void ft_pcie_ls_setup(void *blob, struct ls_pcie_rc *pcie_rc)
diff --git a/drivers/pci/pcie_layerscape_gen4_fixup.c b/drivers/pci/pcie_layerscape_gen4_fixup.c
index e9ee15558e..39579b1269 100644
--- a/drivers/pci/pcie_layerscape_gen4_fixup.c
+++ b/drivers/pci/pcie_layerscape_gen4_fixup.c
@@ -193,9 +193,9 @@ static void ft_pcie_ep_layerscape_gen4_fix(void *blob, struct ls_pcie_g4 *pcie)
 	}
 
 	if (pcie->enabled && pcie->mode == PCI_HEADER_TYPE_NORMAL)
-		fdt_set_node_status(blob, off, FDT_STATUS_OKAY, 0);
+		fdt_set_node_status(blob, off, FDT_STATUS_OKAY);
 	else
-		fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
+		fdt_set_node_status(blob, off, FDT_STATUS_DISABLED);
 }
 
 static void ft_pcie_rc_layerscape_gen4_fix(void *blob, struct ls_pcie_g4 *pcie)
@@ -214,9 +214,9 @@ static void ft_pcie_rc_layerscape_gen4_fix(void *blob, struct ls_pcie_g4 *pcie)
 	}
 
 	if (pcie->enabled && pcie->mode == PCI_HEADER_TYPE_BRIDGE)
-		fdt_set_node_status(blob, off, FDT_STATUS_OKAY, 0);
+		fdt_set_node_status(blob, off, FDT_STATUS_OKAY);
 	else
-		fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
+		fdt_set_node_status(blob, off, FDT_STATUS_DISABLED);
 }
 
 static void ft_pcie_layerscape_gen4_setup(void *blob, struct ls_pcie_g4 *pcie)
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 90f5a4c28c..850c860bd4 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -299,36 +299,34 @@ enum fdt_status {
 	FDT_STATUS_OKAY,
 	FDT_STATUS_DISABLED,
 	FDT_STATUS_FAIL,
-	FDT_STATUS_FAIL_ERROR_CODE,
 };
-int fdt_set_node_status(void *fdt, int nodeoffset,
-			enum fdt_status status, unsigned int error_code);
+int fdt_set_node_status(void *fdt, int nodeoffset, enum fdt_status status);
 static inline int fdt_status_okay(void *fdt, int nodeoffset)
 {
-	return fdt_set_node_status(fdt, nodeoffset, FDT_STATUS_OKAY, 0);
+	return fdt_set_node_status(fdt, nodeoffset, FDT_STATUS_OKAY);
 }
 static inline int fdt_status_disabled(void *fdt, int nodeoffset)
 {
-	return fdt_set_node_status(fdt, nodeoffset, FDT_STATUS_DISABLED, 0);
+	return fdt_set_node_status(fdt, nodeoffset, FDT_STATUS_DISABLED);
 }
 static inline int fdt_status_fail(void *fdt, int nodeoffset)
 {
-	return fdt_set_node_status(fdt, nodeoffset, FDT_STATUS_FAIL, 0);
+	return fdt_set_node_status(fdt, nodeoffset, FDT_STATUS_FAIL);
 }
 
 int fdt_set_status_by_alias(void *fdt, const char *alias,
-			    enum fdt_status status, unsigned int error_code);
+			    enum fdt_status status);
 static inline int fdt_status_okay_by_alias(void *fdt, const char *alias)
 {
-	return fdt_set_status_by_alias(fdt, alias, FDT_STATUS_OKAY, 0);
+	return fdt_set_status_by_alias(fdt, alias, FDT_STATUS_OKAY);
 }
 static inline int fdt_status_disabled_by_alias(void *fdt, const char *alias)
 {
-	return fdt_set_status_by_alias(fdt, alias, FDT_STATUS_DISABLED, 0);
+	return fdt_set_status_by_alias(fdt, alias, FDT_STATUS_DISABLED);
 }
 static inline int fdt_status_fail_by_alias(void *fdt, const char *alias)
 {
-	return fdt_set_status_by_alias(fdt, alias, FDT_STATUS_FAIL, 0);
+	return fdt_set_status_by_alias(fdt, alias, FDT_STATUS_FAIL);
 }
 
 /* Helper to read a big number; size is in cells (not bytes) */
-- 
2.32.0


  parent reply	other threads:[~2021-11-03  2:03 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03  2:02 [PATCH u-boot-marvell 00/11] Some mvebu comphy + mox + fdt_support changes Marek Behún
2021-11-03  2:02 ` [PATCH u-boot-marvell 01/11] include/linux/byteorder: Fix compilation of __constant_cpu_to_be32() Marek Behún
2021-11-12 12:40   ` Stefan Roese
2021-11-03  2:02 ` [PATCH u-boot-marvell 02/11] treewide: Use fdt_create_phandle() where appropriate Marek Behún
2021-11-12 12:40   ` Stefan Roese
2021-11-03  2:02 ` [PATCH u-boot-marvell 03/11] fdt_support: Remove fdt_alloc_phandle() in favor of fdt_generate_phandle() Marek Behún
2021-11-12 12:42   ` Stefan Roese
2021-11-12 17:26     ` Marek Behún
2021-11-03  2:02 ` Marek Behún [this message]
2021-11-12 12:43   ` [PATCH u-boot-marvell 04/11] fdt_support: Remove FDT_STATUS_FAIL_ERROR_CODE Stefan Roese
2021-11-03  2:02 ` [PATCH u-boot-marvell 05/11] fdt_support: Fix comment for fdt_create_phandle() Marek Behún
2021-11-12 12:44   ` Stefan Roese
2021-11-03  2:02 ` [PATCH u-boot-marvell 06/11] fdt_support: Add some useful functions Marek Behún
2021-11-12 13:14   ` Stefan Roese
2021-11-03  2:02 ` [PATCH u-boot-marvell 07/11] arm: mvebu: turris_mox: Find DT nodes by compatible or alias instead of path Marek Behún
2021-11-12 13:15   ` Stefan Roese
2021-11-03  2:02 ` [PATCH u-boot-marvell 08/11] arm: mvebu: turris_mox: Enable eth1 in U-Boot if a network module is present Marek Behún
2021-11-12 13:16   ` Stefan Roese
2021-11-03  2:02 ` [PATCH u-boot-marvell 09/11] phy: marvell: a3700: Convert to official DT bindings in COMPHY driver Marek Behún
2021-11-12 13:29   ` Stefan Roese
2021-11-12 17:27     ` Marek Behún
2021-11-15  6:47       ` Stefan Roese
2021-11-03  2:02 ` [PATCH u-boot-marvell 10/11] arm: mvebu: turris_mox: Fix unstable board topology reading Marek Behún
2021-11-12 13:30   ` Stefan Roese
2021-11-03  2:02 ` [PATCH u-boot-marvell 11/11] fdt_support: Add fdt_delete_disabled_nodes() and use in Turris MOX Marek Behún
2021-11-12 13:31   ` Stefan Roese
2021-11-11 15:36 ` [PATCH u-boot-marvell 00/11] Some mvebu comphy + mox + fdt_support changes Marek Behún
2021-11-12  9:49   ` 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=20211103020244.25428-5-kabel@kernel.org \
    --to=kabel@kernel.org \
    --cc=marek.behun@nic.cz \
    --cc=pali@kernel.org \
    --cc=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /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