Re: [PATCH 11/16] avctp: Convert register/unregister to accept btd_adapter

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

 



Hi,

On Wed, Dec 12, 2012 at 8:52 AM, Anderson Lizardo
<anderson.lizardo@xxxxxxxxxxxxx> wrote:
> Hi Szymon,
>
> On Wed, Dec 12, 2012 at 6:28 AM, Szymon Janc <szymon.janc@xxxxxxxxx> wrote:
>> @@ -1129,13 +1129,18 @@ static void avctp_confirm_cb(GIOChannel *chan, gpointer data)
>>
>>         DBG("AVCTP: incoming connect from %s", address);
>>
>> -       session = avctp_get_internal(&src, &dst);
>> +       device = adapter_find_device(manager_find_adapter(&src), address);
>> +       if (!device)
>> +               return;
>> +
>> +       session = avctp_get_internal(device);
>>         if (session == NULL)
>>                 return;
>>
>> -       dev = manager_get_device(&src, &dst, FALSE);
>> +       dev = manager_get_device(&src, device_get_address(device), FALSE);
>>         if (!dev) {
>> -               dev = manager_get_device(&src, &dst, TRUE);
>> +               dev = manager_get_device(&src, device_get_address(device),
>> +                                                                       TRUE);
>>                 if (!dev) {
>>                         error("Unable to get audio device object for %s",
>>                                         address);
>
> The snippet above looks strange. You already have the device, why call
> manager_get_device() again? Looks like to me a bunch of this code can
> be removed and the error message above could be moved to the if()
> after adapter_find_device().

Ignore that, now I see "manager_get_device()" returns a audio device,
not btd_device :)

Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
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