[U-Boot] [PATCH v3 02/58] reset: Add default request ops

Jagan Teki jagan at amarulasolutions.com
Sun Aug 19 13:56:19 UTC 2018


Missing request ops from respective uclass driver
generating "synchronous abort" in Allwinner platform,
may be in arm. So add default request ops and give a
chance to uclass driver to think whether they really
need request or not.

Cc: Simon Glass <sjg at chromium.org>
Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 drivers/reset/reset-uclass.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c
index 3899537635..99881b8b99 100644
--- a/drivers/reset/reset-uclass.c
+++ b/drivers/reset/reset-uclass.c
@@ -14,6 +14,11 @@ static inline struct reset_ops *reset_dev_ops(struct udevice *dev)
 	return (struct reset_ops *)dev->driver->ops;
 }
 
+static int reset_request_default(struct reset_ctl *reset_ctl)
+{
+	return 0;
+}
+
 static int reset_of_xlate_default(struct reset_ctl *reset_ctl,
 				  struct ofnode_phandle_args *args)
 {
@@ -69,7 +74,10 @@ int reset_get_by_index(struct udevice *dev, int index,
 		return ret;
 	}
 
-	ret = ops->request(reset_ctl);
+	if (ops->request)
+		ret = ops->request(reset_ctl);
+	else
+		ret = reset_request_default(reset_ctl);
 	if (ret) {
 		debug("ops->request() failed: %d\n", ret);
 		return ret;
-- 
2.18.0.321.gffc6fa0e3



More information about the U-Boot mailing list