[U-Boot,v2,03/53] reset: Add default request ops

Message ID 20180810060711.6547-4-jagan@amarulasolutions.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series
  • clk: Add Allwinner CLK, RESET support
Related show

Commit Message

Jagan Teki Aug. 10, 2018, 6:06 a.m.
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@chromium.org>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 drivers/reset/reset-uclass.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Patch

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;