summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2018-09-28 23:37:19 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-02 15:18:36 -0700
commit869d3acd488c282421468b60b5c6ed205c1da1b0 (patch)
tree250b822d353aa2c58ca470d817eda69ce0e70c06 /drivers
parent7a7e50b36dea2f1f516fa977c561d27dfde37dca (diff)
downloadlinux-869d3acd488c282421468b60b5c6ed205c1da1b0.tar.gz
linux-869d3acd488c282421468b60b5c6ed205c1da1b0.tar.bz2
linux-869d3acd488c282421468b60b5c6ed205c1da1b0.zip
staging: most: usb: add release function for DCI device
This patch adds the missing release function for the DCI device that frees the container structure it is embedded in. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/most/usb/usb.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/staging/most/usb/usb.c b/drivers/staging/most/usb/usb.c
index 7869e8463438..c0293d8d5934 100644
--- a/drivers/staging/most/usb/usb.c
+++ b/drivers/staging/most/usb/usb.c
@@ -1015,6 +1015,13 @@ static const struct attribute_group *dci_attr_groups[] = {
NULL,
};
+static void release_dci(struct device *dev)
+{
+ struct most_dci_obj *dci = to_dci_obj(dev);
+
+ kfree(dci);
+}
+
/**
* hdm_probe - probe function of USB device driver
* @interface: Interface of the attached USB device
@@ -1146,6 +1153,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id)
mdev->dci->dev.init_name = "dci";
mdev->dci->dev.parent = &mdev->iface.dev;
mdev->dci->dev.groups = dci_attr_groups;
+ mdev->dci->dev.release = release_dci;
if (device_register(&mdev->dci->dev)) {
mutex_unlock(&mdev->io_mutex);
most_deregister_interface(&mdev->iface);
@@ -1198,7 +1206,6 @@ static void hdm_disconnect(struct usb_interface *interface)
cancel_work_sync(&mdev->poll_work_obj);
device_unregister(&mdev->dci->dev);
- kfree(mdev->dci);
most_deregister_interface(&mdev->iface);
kfree(mdev->busy_urbs);