Re: [PATCH 6/6] source: Register state callback for specified audio device

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

 



Hi Szymon,

On Tue, Mar 5, 2013 at 1:06 PM, Szymon Janc <szymon.janc@xxxxxxxxx> wrote:
> State callback will now be registered and called for specified device
> only. This will allow for more cleaner callback register/unregister
> in roles code.
> ---
>  profiles/audio/source.c    | 9 ++++++++-
>  profiles/audio/source.h    | 3 ++-
>  profiles/audio/transport.c | 5 +----
>  3 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/profiles/audio/source.c b/profiles/audio/source.c
> index 4ebe598..5c5568a 100644
> --- a/profiles/audio/source.c
> +++ b/profiles/audio/source.c
> @@ -70,6 +70,7 @@ struct source {
>
>  struct source_state_callback {
>         source_state_cb cb;
> +       struct audio_device *dev;
>         void *user_data;
>         unsigned int id;
>  };
> @@ -96,6 +97,10 @@ static void source_set_state(struct audio_device *dev, source_state_t new_state)
>
>         for (l = source_callbacks; l != NULL; l = l->next) {
>                 struct source_state_callback *cb = l->data;
> +
> +               if (cb->dev != dev)
> +                       return;
> +

The above code should be continue instead of return.
--
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