From 6910fa2dd6dc0d81c6ec4a2f36d6e21bd27b4479 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@hovoldconsulting.com>
Date: Wed, 22 Jun 2016 11:42:02 +0200
Subject: [PATCH] greybus: hd: add flag argument to cport_enable callback

Add a flag argument to the host-device cport_enable callback that can be
used to provide hints about the connection being created (e.g.
connection priority).

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
---
 drivers/staging/greybus/connection.c | 3 ++-
 drivers/staging/greybus/hd.h         | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c
index 20a87b9ee6741..232af8d131115 100644
--- a/drivers/staging/greybus/connection.c
+++ b/drivers/staging/greybus/connection.c
@@ -286,7 +286,8 @@ static int gb_connection_hd_cport_enable(struct gb_connection *connection)
 	if (!hd->driver->cport_enable)
 		return 0;
 
-	ret = hd->driver->cport_enable(hd, connection->hd_cport_id);
+	ret = hd->driver->cport_enable(hd, connection->hd_cport_id,
+					connection->flags);
 	if (ret) {
 		dev_err(&hd->dev, "%s: failed to enable host cport: %d\n",
 				connection->name, ret);
diff --git a/drivers/staging/greybus/hd.h b/drivers/staging/greybus/hd.h
index 5136d0c9ecc80..d5d8c67551f28 100644
--- a/drivers/staging/greybus/hd.h
+++ b/drivers/staging/greybus/hd.h
@@ -19,7 +19,8 @@ struct gb_hd_driver {
 	int (*cport_allocate)(struct gb_host_device *hd, int cport_id,
 				unsigned long flags);
 	void (*cport_release)(struct gb_host_device *hd, u16 cport_id);
-	int (*cport_enable)(struct gb_host_device *hd, u16 cport_id);
+	int (*cport_enable)(struct gb_host_device *hd, u16 cport_id,
+				unsigned long flags);
 	int (*cport_disable)(struct gb_host_device *hd, u16 cport_id);
 	int (*cport_flush)(struct gb_host_device *hd, u16 cport_id);
 	int (*cport_ping)(struct gb_host_device *hd, u16 cport_id);
-- 
2.30.2