2012-12-18 18:49:43

by Andre Guedes

[permalink] [raw]
Subject: [PATCH BlueZ 1/8] hog: Rename hog_device.c file to hog.c

Since hog_manager.c and hog_device.h were merged into hog_device.c,
now the whole HoG logic is in this file. So, calling this file hog.c
instead of hog_device.c is more suitable.
---
Makefile.plugins | 2 +-
profiles/input/{hog_device.c => hog.c} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename profiles/input/{hog_device.c => hog.c} (100%)

diff --git a/Makefile.plugins b/Makefile.plugins
index 41b6876..73055ef 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -59,7 +59,7 @@ builtin_sources += profiles/input/manager.h profiles/input/manager.c \
profiles/input/device.h profiles/input/device.c

builtin_modules += hog
-builtin_sources += profiles/input/hog_device.c profiles/input/uhid_copy.h \
+builtin_sources += profiles/input/hog.c profiles/input/uhid_copy.h \
profiles/input/suspend.h profiles/input/suspend-dummy.c

builtin_modules += health
diff --git a/profiles/input/hog_device.c b/profiles/input/hog.c
similarity index 100%
rename from profiles/input/hog_device.c
rename to profiles/input/hog.c
--
1.8.0.1



2012-12-19 22:01:02

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH BlueZ 8/8] hog: Rename hog_device_unregister

Hi Andre,

On Wed, Dec 19, 2012, Andre Guedes wrote:
> This patch renames hog_device_unregister function to hog_unregister_
> device.
> ---
> profiles/input/hog.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

All patches in this set have been applied. Thanks.

Johan

2012-12-19 13:38:13

by Andre Guedes

[permalink] [raw]
Subject: Re: [PATCH BlueZ 8/8] hog: Rename hog_device_unregister

Hi Lizardo,

On Tue, Dec 18, 2012 at 5:13 PM, Anderson Lizardo
<[email protected]> wrote:
> Hi Guedes,
>
> On Tue, Dec 18, 2012 at 2:49 PM, Andre Guedes
> <[email protected]> wrote:
>> This patch renames hog_device_unregister function to hog_device_
>> unregister.
>
> Minor typo: "hog_device_ unregister" -> "hog_unregister_device".

Thanks.

Johan, I'm fixing the typo and I'm going to send a new patch right away.

Regards,

Andre

2012-12-19 13:42:06

by Andre Guedes

[permalink] [raw]
Subject: [PATCH BlueZ 8/8] hog: Rename hog_device_unregister

This patch renames hog_device_unregister function to hog_unregister_
device.
---
profiles/input/hog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index fa8069c..b6ac61d 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -753,7 +753,7 @@ static struct hog_device *hog_register_device(struct btd_device *device,
return hogdev;
}

-static int hog_device_unregister(struct hog_device *hogdev)
+static int hog_unregister_device(struct hog_device *hogdev)
{
struct uhid_event ev;

@@ -860,7 +860,7 @@ static void remove_device(gpointer a, gpointer b)
return;

devices = g_slist_remove(devices, hogdev);
- hog_device_unregister(hogdev);
+ hog_unregister_device(hogdev);
}

static void hog_remove(struct btd_profile *p, struct btd_device *device)
--
1.8.0.1


2012-12-18 20:13:01

by Anderson Lizardo

[permalink] [raw]
Subject: Re: [PATCH BlueZ 8/8] hog: Rename hog_device_unregister

Hi Guedes,

On Tue, Dec 18, 2012 at 2:49 PM, Andre Guedes
<[email protected]> wrote:
> This patch renames hog_device_unregister function to hog_device_
> unregister.

Minor typo: "hog_device_ unregister" -> "hog_unregister_device".

Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil

2012-12-18 18:49:50

by Andre Guedes

[permalink] [raw]
Subject: [PATCH BlueZ 8/8] hog: Rename hog_device_unregister

This patch renames hog_device_unregister function to hog_device_
unregister.
---
profiles/input/hog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index fa8069c..b6ac61d 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -753,7 +753,7 @@ static struct hog_device *hog_register_device(struct btd_device *device,
return hogdev;
}

-static int hog_device_unregister(struct hog_device *hogdev)
+static int hog_unregister_device(struct hog_device *hogdev)
{
struct uhid_event ev;

@@ -860,7 +860,7 @@ static void remove_device(gpointer a, gpointer b)
return;

devices = g_slist_remove(devices, hogdev);
- hog_device_unregister(hogdev);
+ hog_unregister_device(hogdev);
}

static void hog_remove(struct btd_profile *p, struct btd_device *device)
--
1.8.0.1


2012-12-18 18:49:49

by Andre Guedes

[permalink] [raw]
Subject: [PATCH BlueZ 7/8] hog: Rename hog_device_register

This patch renames hog_device_register function to hog_register_device.
---
profiles/input/hog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index 8d8f804..fa8069c 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -716,7 +716,7 @@ static void hog_free_device(struct hog_device *hogdev)
g_free(hogdev);
}

-static struct hog_device *hog_device_register(struct btd_device *device,
+static struct hog_device *hog_register_device(struct btd_device *device,
struct gatt_primary *prim)
{
struct hog_device *hogdev;
@@ -841,7 +841,7 @@ static int hog_probe(struct btd_profile *p, struct btd_device *device,
if (strcmp(prim->uuid, HOG_UUID) != 0)
continue;

- hogdev = hog_device_register(device, prim);
+ hogdev = hog_register_device(device, prim);
if (hogdev == NULL)
continue;

--
1.8.0.1


2012-12-18 18:49:48

by Andre Guedes

[permalink] [raw]
Subject: [PATCH BlueZ 6/8] hog: Rename hog_device_free

This patch renames hog_device_free function to hog_free_device.
---
profiles/input/hog.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index c68a089..8d8f804 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -707,7 +707,7 @@ static void report_free(void *data)
g_free(report);
}

-static void hog_device_free(struct hog_device *hogdev)
+static void hog_free_device(struct hog_device *hogdev)
{
btd_device_unref(hogdev->device);
g_slist_free_full(hogdev->reports, report_free);
@@ -731,7 +731,7 @@ static struct hog_device *hog_device_register(struct btd_device *device,
if (hogdev->uhid_fd < 0) {
error("Failed to open uHID device: %s(%d)", strerror(errno),
errno);
- hog_device_free(hogdev);
+ hog_free_device(hogdev);
return NULL;
}

@@ -772,7 +772,7 @@ static int hog_device_unregister(struct hog_device *hogdev)
close(hogdev->uhid_fd);
hogdev->uhid_fd = -1;

- hog_device_free(hogdev);
+ hog_free_device(hogdev);

return 0;
}
--
1.8.0.1


2012-12-18 18:49:47

by Andre Guedes

[permalink] [raw]
Subject: [PATCH BlueZ 5/8] hog: Rename hog_device_new

This patch renames hog_device_new function to hog_new_device.
---
profiles/input/hog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index 186f6b1..c68a089 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -680,7 +680,7 @@ static void attio_disconnected_cb(gpointer user_data)
hogdev->attrib = NULL;
}

-static struct hog_device *hog_device_new(struct btd_device *device,
+static struct hog_device *hog_new_device(struct btd_device *device,
uint16_t id)
{
struct hog_device *hogdev;
@@ -723,7 +723,7 @@ static struct hog_device *hog_device_register(struct btd_device *device,
GIOCondition cond = G_IO_IN | G_IO_ERR | G_IO_NVAL;
GIOChannel *io;

- hogdev = hog_device_new(device, prim->range.start);
+ hogdev = hog_new_device(device, prim->range.start);
if (!hogdev)
return NULL;

--
1.8.0.1


2012-12-18 18:49:46

by Andre Guedes

[permalink] [raw]
Subject: [PATCH BlueZ 4/8] hog: Rename hog_device_set_control_point

This patch renames hog_device_set_control_point function to
set_control_point.
---
profiles/input/hog.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index 00ec151..186f6b1 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -777,8 +777,7 @@ static int hog_device_unregister(struct hog_device *hogdev)
return 0;
}

-static int hog_device_set_control_point(struct hog_device *hogdev,
- gboolean suspend)
+static int set_control_point(struct hog_device *hogdev, gboolean suspend)
{
uint8_t value = suspend ? 0x00 : 0x01;

@@ -802,7 +801,7 @@ static void set_suspend(gpointer data, gpointer user_data)
struct hog_device *hogdev = data;
gboolean suspend = GPOINTER_TO_INT(user_data);

- hog_device_set_control_point(hogdev, suspend);
+ set_control_point(hogdev, suspend);
}

static void suspend_callback(void)
--
1.8.0.1


2012-12-18 18:49:45

by Andre Guedes

[permalink] [raw]
Subject: [PATCH BlueZ 3/8] hog: Rename hog_device_remove

This patch renames hog_device_remove function to hog_remove.
---
profiles/input/hog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index 1cb580e..00ec151 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -864,7 +864,7 @@ static void remove_device(gpointer a, gpointer b)
hog_device_unregister(hogdev);
}

-static void hog_device_remove(struct btd_profile *p, struct btd_device *device)
+static void hog_remove(struct btd_profile *p, struct btd_device *device)
{
const gchar *path = device_get_path(device);

@@ -877,7 +877,7 @@ static struct btd_profile hog_profile = {
.name = "input-hog",
.remote_uuids = BTD_UUIDS(HOG_UUID),
.device_probe = hog_probe,
- .device_remove = hog_device_remove,
+ .device_remove = hog_remove,
};

static int hog_init(void)
--
1.8.0.1


2012-12-18 18:49:44

by Andre Guedes

[permalink] [raw]
Subject: [PATCH BlueZ 2/8] hog: Rename hog_device_probe

This patch renames hog_device_probe function to hog_probe.
---
profiles/input/hog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index e2a3488..1cb580e 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -823,7 +823,7 @@ static void resume_callback(void)
g_slist_foreach(devices, set_suspend, GINT_TO_POINTER(suspend));
}

-static int hog_device_probe(struct btd_profile *p, struct btd_device *device,
+static int hog_probe(struct btd_profile *p, struct btd_device *device,
GSList *uuids)
{
const char *path = device_get_path(device);
@@ -876,7 +876,7 @@ static void hog_device_remove(struct btd_profile *p, struct btd_device *device)
static struct btd_profile hog_profile = {
.name = "input-hog",
.remote_uuids = BTD_UUIDS(HOG_UUID),
- .device_probe = hog_device_probe,
+ .device_probe = hog_probe,
.device_remove = hog_device_remove,
};

--
1.8.0.1