[RFC BlueZ v0 09/16] heartrate: Remove boilerplate code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mikel Astiz <mikel.astiz@xxxxxxxxxxxx>

The helper fuctions to adapt btd_profile signatures with internal APIs
add boilerplate code of little use, so remove them.
---
 profiles/heartrate/heartrate.c | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/profiles/heartrate/heartrate.c b/profiles/heartrate/heartrate.c
index 1d902a8..81ca2a8 100644
--- a/profiles/heartrate/heartrate.c
+++ b/profiles/heartrate/heartrate.c
@@ -724,8 +724,9 @@ static const GDBusPropertyTable heartrate_device_properties[] = {
 	{ }
 };
 
-static int heartrate_adapter_register(struct btd_adapter *adapter)
+static int heartrate_adapter_probe(struct btd_server *server)
 {
+	struct btd_adapter *adapter = btd_server_get_adapter(server);
 	struct heartrate_adapter *hradapter;
 
 	hradapter = g_new0(struct heartrate_adapter, 1);
@@ -748,8 +749,9 @@ static int heartrate_adapter_register(struct btd_adapter *adapter)
 	return 0;
 }
 
-static void heartrate_adapter_unregister(struct btd_adapter *adapter)
+static void heartrate_adapter_remove(struct btd_server *server)
 {
+	struct btd_adapter *adapter = btd_server_get_adapter(server);
 	struct heartrate_adapter *hradapter;
 
 	hradapter = find_heartrate_adapter(adapter);
@@ -831,20 +833,6 @@ static void heartrate_device_unregister(struct btd_device *device)
 				device_get_path(device), HEART_RATE_INTERFACE);
 }
 
-static int heartrate_adapter_probe(struct btd_server *server)
-{
-	struct btd_adapter *adapter = btd_server_get_adapter(server);
-
-	return heartrate_adapter_register(adapter);
-}
-
-static void heartrate_adapter_remove(struct btd_server *server)
-{
-	struct btd_adapter *adapter = btd_server_get_adapter(server);
-
-	heartrate_adapter_unregister(adapter);
-}
-
 static int heartrate_device_probe(struct btd_service *service)
 {
 	struct btd_device *device = btd_service_get_device(service);
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux