summaryrefslogtreecommitdiffstats
path: root/serial/port.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-11-07 18:21:43 -0300
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-11-07 18:21:43 -0300
commitf449b80bffc98b01f4460905985a97416e5da8e2 (patch)
tree6a18099bf39d2c522ed1b6da8244e3819b9f6c13 /serial/port.c
parent4ea2af53fa86ea69ff0bd60504393590e03861f7 (diff)
Fix driver removal for serial port driver.
Because of the last changes serial port driver would not remove all ports registered on probe just the one registered with serial port uuid if registered.
Diffstat (limited to 'serial/port.c')
-rw-r--r--serial/port.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/serial/port.c b/serial/port.c
index 1f62b5e4..911c777e 100644
--- a/serial/port.c
+++ b/serial/port.c
@@ -463,23 +463,16 @@ int port_register(DBusConnection *conn, const char *path, bdaddr_t *src,
return 0;
}
-int port_unregister(const char *path, const char *uuid)
+int port_unregister(const char *path)
{
struct serial_device *device;
- struct serial_port *port;
device = find_device(devices, path);
if (!device)
return -ENOENT;
- port = find_port(device->ports, uuid);
- if (!port)
- return -ENOENT;
-
- device->ports = g_slist_remove(device->ports, port);
- serial_port_free(port);
- if (device->ports)
- return 0;
+ g_slist_foreach(device->ports, (GFunc) serial_port_free, NULL);
+ g_slist_free(device->ports);
g_dbus_unregister_interface(device->conn, path, SERIAL_PORT_INTERFACE);