From ee930fffee469d076998274a2ca55e13dc1efb67 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 10 May 2024 08:50:54 +0000
Subject: [PATCH] enable tun/tap/iptables

---
 u-boot/drivers/power/regulator/regulator-uclass.c |   92 ----------------------------------------------
 1 files changed, 0 insertions(+), 92 deletions(-)

diff --git a/u-boot/drivers/power/regulator/regulator-uclass.c b/u-boot/drivers/power/regulator/regulator-uclass.c
index 4679249..0c692bb 100644
--- a/u-boot/drivers/power/regulator/regulator-uclass.c
+++ b/u-boot/drivers/power/regulator/regulator-uclass.c
@@ -8,7 +8,6 @@
 #include <common.h>
 #include <errno.h>
 #include <dm.h>
-#include <dm/device-internal.h>
 #include <dm/uclass-internal.h>
 #include <power/pmic.h>
 #include <power/regulator.h>
@@ -413,16 +412,10 @@
 	if (regulator_name_is_unique(dev, uc_pdata->name))
 		return 0;
 
-#ifdef CONFIG_USING_KERNEL_DTB
-	printf("Pre-reloc: %s\n", uc_pdata->name);
-
-	return 0;
-#else
 	debug("'%s' of dev: '%s', has nonunique value: '%s\n",
 	      property, dev->name, uc_pdata->name);
 
 	return -EINVAL;
-#endif
 }
 
 static int regulator_pre_probe(struct udevice *dev)
@@ -505,90 +498,6 @@
 	return ret;
 }
 
-#ifdef CONFIG_USING_KERNEL_DTB
-/*
- * Skip probed pre-reloc regulators.
- *
- * Some regulator like fixed/gpio regultor applies a default output state
- * when probed. It maybe reverse the state which was set by the pre-reloc
- * regulator. Example: vcc3v3_pcie.
- */
-int regulators_enable_boot_on(bool verbose)
-{
-	struct dm_regulator_uclass_platdata *uc_pdata;
-	struct udevice *dev;
-	struct uclass *uc;
-	char **pre_probed = NULL;
-	int i = 0, num = 0;
-	int ret;
-	bool skip;
-
-	ret = uclass_get(UCLASS_REGULATOR, &uc);
-	if (ret)
-		return ret;
-
-	/* find probed pre-reloc regulators */
-	for (uclass_find_first_device(UCLASS_REGULATOR, &dev);
-	     dev;
-	     uclass_find_next_device(&dev)) {
-		if (!(dev->flags & DM_FLAG_KNRL_DTB) &&
-		    (dev->flags & DM_FLAG_ACTIVATED))
-			num++;
-	}
-	if (num) {
-		pre_probed = calloc(num, sizeof(char *));
-		if (!pre_probed)
-			return -ENOMEM;
-
-		for (uclass_find_first_device(UCLASS_REGULATOR, &dev);
-		     dev;
-		     uclass_find_next_device(&dev)) {
-			if (!(dev->flags & DM_FLAG_KNRL_DTB) &&
-			    (dev->flags & DM_FLAG_ACTIVATED)) {
-				uc_pdata = dev_get_uclass_platdata(dev);
-				pre_probed[i++] = (char *)uc_pdata->name;
-			}
-		}
-	}
-
-	/* Skip kernel regulators whose name matches probed pre-reloc regulators */
-	for (uclass_find_first_device(UCLASS_REGULATOR, &dev);
-	     dev;
-	     uclass_find_next_device(&dev)) {
-		uc_pdata = dev_get_uclass_platdata(dev);
-		debug("%s: %s%s\n", __func__, uc_pdata->name,
-		      dev->flags & DM_FLAG_KNRL_DTB ? "" : "*");
-		if (dev->flags & DM_FLAG_KNRL_DTB) {
-			for (i = 0, skip = false; i < num; i++) {
-				if (!strcmp(pre_probed[i], uc_pdata->name)) {
-					skip = true;
-					break;
-				}
-			}
-			if (skip)
-				continue;
-		}
-
-		/* Probe and init */
-		ret = device_probe(dev);
-		if (ret)
-			continue;
-		ret = regulator_autoset(dev);
-		if (ret == -EMEDIUMTYPE)
-			ret = 0;
-		if (verbose)
-			regulator_show(dev, ret);
-		if (ret == -ENOSYS)
-			ret = 0;
-	}
-
-	if (pre_probed)
-		free(pre_probed);
-
-	return ret;
-}
-
-#else
 int regulators_enable_boot_on(bool verbose)
 {
 	struct udevice *dev;
@@ -613,7 +522,6 @@
 
 	return ret;
 }
-#endif
 
 UCLASS_DRIVER(regulator) = {
 	.id		= UCLASS_REGULATOR,

--
Gitblit v1.6.2