summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2015-12-02 18:23:27 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2015-12-02 16:55:45 -0800
commit24456a09a830dc44ace4d0db8e29d1e367937b58 (patch)
treef4e6dbbcb8bcbbee265986ea11a3d8760c99d0db /drivers
parentd34a3643fe8d20b4e19779f82dfb29b5e6678a9d (diff)
greybus: svc: clean up deferred hotplug handler
Rename the hotplug request message, and clarify that the message size has already been verified by the primary handler. Also add a debug message that includes the interface id. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/greybus/svc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c
index 2c2dd8e66d7d..476914c88832 100644
--- a/drivers/staging/greybus/svc.c
+++ b/drivers/staging/greybus/svc.c
@@ -359,7 +359,7 @@ static void svc_process_hotplug(struct work_struct *work)
{
struct svc_hotplug *svc_hotplug = container_of(work, struct svc_hotplug,
work);
- struct gb_svc_intf_hotplug_request *hotplug = &svc_hotplug->data;
+ struct gb_svc_intf_hotplug_request *request;
struct gb_connection *connection = svc_hotplug->connection;
struct gb_svc *svc = connection->private;
struct gb_host_device *hd = connection->hd;
@@ -367,10 +367,11 @@ static void svc_process_hotplug(struct work_struct *work)
u8 intf_id, device_id;
int ret;
- /*
- * Grab the information we need.
- */
- intf_id = hotplug->intf_id;
+ /* The request message size has already been verified. */
+ request = &svc_hotplug->data;
+ intf_id = request->intf_id;
+
+ dev_dbg(&svc->dev, "%s - id = %u\n", __func__, intf_id);
intf = gb_interface_find(hd, intf_id);
if (intf) {
@@ -404,10 +405,10 @@ static void svc_process_hotplug(struct work_struct *work)
if (ret)
goto destroy_interface;
- intf->unipro_mfg_id = le32_to_cpu(hotplug->data.unipro_mfg_id);
- intf->unipro_prod_id = le32_to_cpu(hotplug->data.unipro_prod_id);
- intf->vendor_id = le32_to_cpu(hotplug->data.ara_vend_id);
- intf->product_id = le32_to_cpu(hotplug->data.ara_prod_id);
+ intf->unipro_mfg_id = le32_to_cpu(request->data.unipro_mfg_id);
+ intf->unipro_prod_id = le32_to_cpu(request->data.unipro_prod_id);
+ intf->vendor_id = le32_to_cpu(request->data.ara_vend_id);
+ intf->product_id = le32_to_cpu(request->data.ara_prod_id);
/*
* Create a device id for the interface: