summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2022-08-18 00:44:33 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2022-08-18 00:47:01 +0800
commitd9f201ead47cb7b82178198e86e31ec09e5cad62 (patch)
tree004c9e3a382e826b19f91cbaca6e4c29c05d5e50
parent8b7e044e437a400fba86aed53669156e19b40aa4 (diff)
downloadhikey-modules-d9f201ead47cb7b82178198e86e31ec09e5cad62.tar.gz
patchsets: apply the right solution for regulator revert
The author suggested the fix here: https://lore.kernel.org/all/20220809142738.1.I91625242f137c707bb345c51c80c5ecee02eeff3@changeid/ and the hikey960 android build could boot again without the revert Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org> Change-Id: Iee9ea57bef0f249bbba4c625c45571223cf5e2e3
-rw-r--r--patchsets/0001-Revert-regulator-core-Allow-specifying-an-initial-lo.patch84
-rw-r--r--patchsets/0001-regulator-core-Fix-missing-error-return-from-regulat.patch36
-rwxr-xr-xpatchsets/apply.sh7
3 files changed, 39 insertions, 88 deletions
diff --git a/patchsets/0001-Revert-regulator-core-Allow-specifying-an-initial-lo.patch b/patchsets/0001-Revert-regulator-core-Allow-specifying-an-initial-lo.patch
deleted file mode 100644
index 525ea9e..0000000
--- a/patchsets/0001-Revert-regulator-core-Allow-specifying-an-initial-lo.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 63b42c9b1b027ea7d17c32eb4f05975ebceb1869 Mon Sep 17 00:00:00 2001
-From: Yongqin Liu <yongqin.liu@linaro.org>
-Date: Tue, 16 Aug 2022 17:15:16 +0800
-Subject: [PATCH 1/1] Revert "regulator: core: Allow specifying an initial load
- w/ the bulk API"
-
-This reverts commit 6eabfc018e8d1033e7fc1efce30a872e2dccb537.
----
- drivers/regulator/core.c | 20 ++++++++------------
- include/linux/regulator/consumer.h | 12 ++++--------
- 2 files changed, 12 insertions(+), 20 deletions(-)
-
-diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
-index 7150b1d0159e..398c8d6afd47 100644
---- a/drivers/regulator/core.c
-+++ b/drivers/regulator/core.c
-@@ -4784,26 +4784,22 @@ int regulator_bulk_get(struct device *dev, int num_consumers,
- consumers[i].consumer = regulator_get(dev,
- consumers[i].supply);
- if (IS_ERR(consumers[i].consumer)) {
-+ ret = PTR_ERR(consumers[i].consumer);
- consumers[i].consumer = NULL;
-- ret = dev_err_probe(dev, PTR_ERR(consumers[i].consumer),
-- "Failed to get supply '%s'",
-- consumers[i].supply);
- goto err;
- }
--
-- if (consumers[i].init_load_uA > 0) {
-- ret = regulator_set_load(consumers[i].consumer,
-- consumers[i].init_load_uA);
-- if (ret) {
-- i++;
-- goto err;
-- }
-- }
- }
-
- return 0;
-
- err:
-+ if (ret != -EPROBE_DEFER)
-+ dev_err(dev, "Failed to get supply '%s': %pe\n",
-+ consumers[i].supply, ERR_PTR(ret));
-+ else
-+ dev_dbg(dev, "Failed to get supply '%s', deferring\n",
-+ consumers[i].supply);
-+
- while (--i >= 0)
- regulator_put(consumers[i].consumer);
-
-diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
-index bc6cda706d1f..61f922e6fe35 100644
---- a/include/linux/regulator/consumer.h
-+++ b/include/linux/regulator/consumer.h
-@@ -171,13 +171,10 @@ struct regulator;
- /**
- * struct regulator_bulk_data - Data used for bulk regulator operations.
- *
-- * @supply: The name of the supply. Initialised by the user before
-- * using the bulk regulator APIs.
-- * @init_load_uA: After getting the regulator, regulator_set_load() will be
-- * called with this load. Initialised by the user before
-- * using the bulk regulator APIs.
-- * @consumer: The regulator consumer for the supply. This will be managed
-- * by the bulk API.
-+ * @supply: The name of the supply. Initialised by the user before
-+ * using the bulk regulator APIs.
-+ * @consumer: The regulator consumer for the supply. This will be managed
-+ * by the bulk API.
- *
- * The regulator APIs provide a series of regulator_bulk_() API calls as
- * a convenience to consumers which require multiple supplies. This
-@@ -185,7 +182,6 @@ struct regulator;
- */
- struct regulator_bulk_data {
- const char *supply;
-- int init_load_uA;
- struct regulator *consumer;
-
- /* private: Internal use */
---
-2.25.1
-
diff --git a/patchsets/0001-regulator-core-Fix-missing-error-return-from-regulat.patch b/patchsets/0001-regulator-core-Fix-missing-error-return-from-regulat.patch
new file mode 100644
index 0000000..eecb981
--- /dev/null
+++ b/patchsets/0001-regulator-core-Fix-missing-error-return-from-regulat.patch
@@ -0,0 +1,36 @@
+From 9b7eb2871ab7d9a4863864f7d7cb93f49dd04cdb Mon Sep 17 00:00:00 2001
+From: Douglas Anderson <dianders@chromium.org>
+Date: Tue, 9 Aug 2022 14:27:45 -0700
+Subject: [PATCH 1/1] regulator: core: Fix missing error return from
+ regulator_bulk_get()
+
+In commit 6eabfc018e8d ("regulator: core: Allow specifying an initial
+load w/ the bulk API") I changed the error handling but had a subtle
+that caused us to always return no error even if there was an
+error. Fix it.
+
+Fixes: 6eabfc018e8d ("regulator: core: Allow specifying an initial load w/ the bulk API")
+Signed-off-by: Douglas Anderson <dianders@chromium.org>
+---
+ drivers/regulator/core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
+index 7150b1d0159e..d8373cb04f90 100644
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -4784,10 +4784,10 @@ int regulator_bulk_get(struct device *dev, int num_consumers,
+ consumers[i].consumer = regulator_get(dev,
+ consumers[i].supply);
+ if (IS_ERR(consumers[i].consumer)) {
+- consumers[i].consumer = NULL;
+ ret = dev_err_probe(dev, PTR_ERR(consumers[i].consumer),
+ "Failed to get supply '%s'",
+ consumers[i].supply);
++ consumers[i].consumer = NULL;
+ goto err;
+ }
+
+--
+2.25.1
+
diff --git a/patchsets/apply.sh b/patchsets/apply.sh
index d63cf30..e17ac78 100755
--- a/patchsets/apply.sh
+++ b/patchsets/apply.sh
@@ -79,7 +79,6 @@ git am "${dir_parent}/0018-HACK-adv7511-Add-poweron-delay-to-allow-for-EDID-pro.
## HDMI monitor does not display, but the boot is finished from the screencap command
git am "${dir_parent}/0019-Revert-drm-bridge-adv7511-Register-and-attach-our-DS.patch"
-## Revert regulator: core: Allow specifying an initial load w/ the bulk API
-## https://lore.kernel.org/all/20220726103631.v2.4.Ie85f68215ada39f502a96dcb8a1f3ad977e3f68a@changeid/
-## 6eabfc018e8d regulator: core: Allow specifying an initial load w/ the bulk API
-git am "${dir_parent}/0001-Revert-regulator-core-Allow-specifying-an-initial-lo.patch"
+## regulator: core: Fix missing error return from regulator_bulk_get()
+## https://lore.kernel.org/all/20220809142738.1.I91625242f137c707bb345c51c80c5ecee02eeff3@changeid/
+git am "${dir_parent}/0001-regulator-core-Fix-missing-error-return-from-regulat.patch"