Re: [RFC 6/8] iio: bmc150: introduce bmc150_accel_trigger

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

 



On Mon, Nov 24, 2014 at 10:26 PM, Hartmut Knaack <knaack.h@xxxxxx> wrote:
> Octavian Purdila schrieb am 24.11.2014 11:42:
>> On Mon, Nov 24, 2014 at 1:06 AM, Hartmut Knaack <knaack.h@xxxxxx> wrote:
>>>> +
>>>> +static void bmc150_accel_unregister_triggers(struct bmc150_accel_data *data,
>>>> +                                          int from)
>>>> +{
>>>> +     int i;
>>>> +
>>>> +     for (i = from; i >= 0; i++) {
>>>> +             if (data->triggers[i].indio_trig) {
>>>> +                     iio_trigger_unregister(data->triggers[i].indio_trig);
>>>> +                     data->triggers[i].indio_trig = NULL;
>>> Better use devm_iio_trigger_free()?
>>
>> Wouldn't that be called anyway a little bit later?
>
> I thought it would be cleaner/safer to release it using the opposite of devm_iio_trigger_alloc(), instead of changing its reference to NULL.

I thought bmc150_accel_unregister_triggers could be called twice, but
reviewing the code again I see that can't happen. I guess I can remove
the NULL assignment altogether.
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux