greybus: connection: kill gb_hd_connections_exit
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 3 Nov 2015 11:11:26 +0000 (12:11 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 5 Nov 2015 04:20:23 +0000 (20:20 -0800)
Connections are destroyed as part of interface tear down. If we fail to
do that properly it's a bug that should be fixed rather than papered
over by a fall-back clean up function.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/connection.c
drivers/staging/greybus/connection.h
drivers/staging/greybus/core.c

index 294e72e8e1c0bcd18436b2d2e039e13c477e8d3c..de774b9882133296d899f42d7e4a74f805298c36 100644 (file)
@@ -489,14 +489,6 @@ void gb_connection_latency_tag_disable(struct gb_connection *connection)
 }
 EXPORT_SYMBOL_GPL(gb_connection_latency_tag_disable);
 
-void gb_hd_connections_exit(struct greybus_host_device *hd)
-{
-       struct gb_connection *connection;
-
-       list_for_each_entry(connection, &hd->connections, hd_links)
-               gb_connection_destroy(connection);
-}
-
 int gb_connection_bind_protocol(struct gb_connection *connection)
 {
        struct gb_protocol *protocol;
index af425a2dc5d237f33e15ed7afe10f16523646419..06c7711da422787aca3a65248d0a5e57b915c771 100644 (file)
@@ -58,7 +58,6 @@ struct gb_connection *gb_connection_create_range(struct greybus_host_device *hd,
                           u16 cport_id, u8 protocol_id, u32 ida_start,
                           u32 ida_end);
 void gb_connection_destroy(struct gb_connection *connection);
-void gb_hd_connections_exit(struct greybus_host_device *hd);
 
 void greybus_data_rcvd(struct greybus_host_device *hd, u16 cport_id,
                        u8 *data, size_t length);
index be75456a835de299dabfb7a58f8a97d4f2b9dcd7..726bf6480af33c90ff2ef3bc691b86567cb4b042 100644 (file)
@@ -242,12 +242,6 @@ void greybus_remove_hd(struct greybus_host_device *hd)
        if (hd->initial_svc_connection)
                gb_connection_destroy(hd->initial_svc_connection);
 
-       /*
-        * Make sure there are no leftovers that can potentially corrupt sysfs.
-        */
-       if (WARN_ON(!list_empty(&hd->connections)))
-               gb_hd_connections_exit(hd);
-
        kref_put_mutex(&hd->kref, free_hd, &hd_mutex);
 }
 EXPORT_SYMBOL_GPL(greybus_remove_hd);