All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mikel Astiz <mikel.astiz.oss@gmail.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ 1/2] core/service: Rename service_shutdown to service_remove
Date: Mon, 8 Jul 2013 19:15:50 +0200	[thread overview]
Message-ID: <CANT-zCVneDv-FGBjk0MkUi-LPvoEL8mR1qWqWk=9i0TJHTas2A@mail.gmail.com> (raw)
In-Reply-To: <1373297311-14722-1-git-send-email-luiz.dentz@gmail.com>

Hi Luiz,

On Mon, Jul 8, 2013 at 5:28 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> This rename service_shutdown to service_remove to make it more similar to
> other internal APIs such as device_remove which only do object
> cleanup/free and do not have any disconnect logic.

I personally don't like hiding unrefs in such a way but it's indeed
more consistent with device_remove() so if this is the convention to
be adopted, ack from my side.

Note however that adapter_remove() doesn't automatically call
btd_adapter_unref() so in this case it would need to be updated too.

Cheers,
Mikel

> ---
>  src/device.c  | 3 +--
>  src/service.c | 3 ++-
>  src/service.h | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/device.c b/src/device.c
> index edd377c..afb0cfc 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -967,9 +967,8 @@ static void remove_service(gpointer data)
>         struct btd_service *service = data;
>         struct btd_device *device = btd_service_get_device(service);
>
> -       service_shutdown(service);
>         device->pending = g_slist_remove(device->pending, service);
> -       btd_service_unref(service);
> +       service_remove(service);
>  }
>
>  static gboolean do_disconnect(gpointer user_data)
> diff --git a/src/service.c b/src/service.c
> index 83e1c1a..52a8291 100644
> --- a/src/service.c
> +++ b/src/service.c
> @@ -168,12 +168,13 @@ int service_probe(struct btd_service *service)
>         return err;
>  }
>
> -void service_shutdown(struct btd_service *service)
> +void service_remove(struct btd_service *service)
>  {
>         change_state(service, BTD_SERVICE_STATE_UNAVAILABLE, 0);
>         service->profile->device_remove(service);
>         service->device = NULL;
>         service->profile = NULL;
> +       btd_service_unref(service);
>  }
>
>  int btd_service_connect(struct btd_service *service)
> diff --git a/src/service.h b/src/service.h
> index 6ee8f17..5230115 100644
> --- a/src/service.h
> +++ b/src/service.h
> @@ -46,7 +46,7 @@ struct btd_service *service_create(struct btd_device *device,
>                                                 struct btd_profile *profile);
>
>  int service_probe(struct btd_service *service);
> -void service_shutdown(struct btd_service *service);
> +void service_remove(struct btd_service *service);
>
>  /* Connection control API */
>  int btd_service_connect(struct btd_service *service);
> --
> 1.8.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2013-07-08 17:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 15:28 [PATCH BlueZ 1/2] core/service: Rename service_shutdown to service_remove Luiz Augusto von Dentz
2013-07-08 15:28 ` [PATCH BlueZ 2/2] core/device: Fix crash while freeing services list Luiz Augusto von Dentz
2013-07-08 17:22   ` Mikel Astiz
2013-07-08 17:15 ` Mikel Astiz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANT-zCVneDv-FGBjk0MkUi-LPvoEL8mR1qWqWk=9i0TJHTas2A@mail.gmail.com' \
    --to=mikel.astiz.oss@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.