Diff between 53b82c067921d91884b8e3c1b89199ec8a79b6da and 5237734e5ca8f1a6f22725d6d8ae65e0cc384b2b

Changed Files

File Additions Deletions Status
src/adapter.c +7 -7 modified

Full Patch

diff --git a/src/adapter.c b/src/adapter.c
index 96e2f02..e8a983a 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -125,6 +125,8 @@ struct discovery {
 };
 
 struct btd_adapter {
+	unsigned int ref_count;
+
 	uint16_t dev_id;
 
 	uint32_t current_settings;
@@ -163,8 +165,6 @@ struct btd_adapter {
 
 	gboolean off_requested;		/* DEVDOWN ioctl was called */
 
-	gint ref;
-
 	GSList *pin_callbacks;
 
 	GSList *drivers;
@@ -1967,9 +1967,9 @@ static void adapter_free(gpointer user_data)
 
 struct btd_adapter *btd_adapter_ref(struct btd_adapter *adapter)
 {
-	adapter->ref++;
+	adapter->ref_count++;
 
-	DBG("%p: ref=%d", adapter, adapter->ref);
+	DBG("%p: ref_count=%u", adapter, adapter->ref_count);
 
 	return adapter;
 }
@@ -1978,11 +1978,11 @@ void btd_adapter_unref(struct btd_adapter *adapter)
 {
 	gchar *path;
 
-	adapter->ref--;
+	adapter->ref_count--;
 
-	DBG("%p: ref=%d", adapter, adapter->ref);
+	DBG("%p: ref_count=%u", adapter, adapter->ref_count);
 
-	if (adapter->ref > 0)
+	if (adapter->ref_count > 0)
 		return;
 
 	if (!adapter->path) {