From: Johan Hovold Date: Thu, 21 Jan 2016 16:34:19 +0000 (+0100) Subject: greybus: connection: remove legacy protocol id from core X-Git-Tag: v4.14-rc1~2366^2~378^2~21^2~768 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63cf52f79b4c9f73657285031427ca748d11ce86;p=platform%2Fkernel%2Flinux-rpi.git greybus: connection: remove legacy protocol id from core Remove legacy protocol-id field that is only used by the legacy-protocol driver from the connection structure. Reviewed-by: Viresh Kumar Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h index 0e78f10..8e5284a 100644 --- a/drivers/staging/greybus/connection.h +++ b/drivers/staging/greybus/connection.h @@ -38,7 +38,6 @@ struct gb_connection { gb_request_handler_t handler; struct gb_protocol *protocol; - u8 protocol_id; u8 module_major; u8 module_minor; diff --git a/drivers/staging/greybus/legacy.c b/drivers/staging/greybus/legacy.c index c7f59e4f..340d8b5 100644 --- a/drivers/staging/greybus/legacy.c +++ b/drivers/staging/greybus/legacy.c @@ -15,6 +15,7 @@ struct legacy_connection { struct gb_connection *connection; bool initialized; + u8 protocol_id; }; struct legacy_data { @@ -38,8 +39,9 @@ static int legacy_connection_get_version(struct gb_connection *connection) return 0; } -static int legacy_connection_bind_protocol(struct gb_connection *connection) +static int legacy_connection_bind_protocol(struct legacy_connection *lc) { + struct gb_connection *connection = lc->connection; struct gb_protocol *protocol; u8 major, minor; @@ -52,14 +54,11 @@ static int legacy_connection_bind_protocol(struct gb_connection *connection) major = 0; minor = 1; - protocol = gb_protocol_get(connection->protocol_id, - major, - minor); + protocol = gb_protocol_get(lc->protocol_id, major, minor); if (!protocol) { dev_err(&connection->hd->dev, "protocol 0x%02x version %u.%u not found\n", - connection->protocol_id, - major, minor); + lc->protocol_id, major, minor); return -EPROTONOSUPPORT; } connection->protocol = protocol; @@ -92,7 +91,7 @@ static int legacy_connection_init(struct legacy_connection *lc) dev_dbg(&connection->bundle->dev, "%s - %s\n", __func__, connection->name); - ret = legacy_connection_bind_protocol(lc->connection); + ret = legacy_connection_bind_protocol(lc); if (ret) return ret; @@ -152,7 +151,7 @@ static int legacy_connection_create(struct legacy_connection *lc, return PTR_ERR(connection); lc->connection = connection; - lc->connection->protocol_id = desc->protocol_id; + lc->protocol_id = desc->protocol_id; return 0; }