2016-03-01 20:30:37

by Wolfram Sang

[permalink] [raw]
Subject: Re: [RFC PATCH 8/9] i2c: i2c-mux: Allow for NULL select callback

On Thu, Feb 18, 2016 at 05:53:13PM +0200, Daniel Baluta wrote:
> From: Adriana Reus <[email protected]>
>
> Add a check in i2c_mux_master_xfer before calling the select callback.
> This is necessary so that NULL callbacks can be safely registered.
>
> Signed-off-by: Adriana Reus <[email protected]>
> Signed-off-by: Daniel Baluta <[email protected]>

Hmm, rather than supporting that in the core, I'd prefer to have the
driver pass an empty function instead. Then, in the driver, we can have
a comment explaining the special situation.


Attachments:
(No filename) (556.00 B)
signature.asc (819.00 B)
Download all attachments

2016-03-01 20:38:39

by Daniel Baluta

[permalink] [raw]
Subject: Re: [RFC PATCH 8/9] i2c: i2c-mux: Allow for NULL select callback

On Tue, Mar 1, 2016 at 10:30 PM, Wolfram Sang <[email protected]> wrote:
> On Thu, Feb 18, 2016 at 05:53:13PM +0200, Daniel Baluta wrote:
>> From: Adriana Reus <[email protected]>
>>
>> Add a check in i2c_mux_master_xfer before calling the select callback.
>> This is necessary so that NULL callbacks can be safely registered.
>>
>> Signed-off-by: Adriana Reus <[email protected]>
>> Signed-off-by: Daniel Baluta <[email protected]>
>
> Hmm, rather than supporting that in the core, I'd prefer to have the
> driver pass an empty function instead. Then, in the driver, we can have
> a comment explaining the special situation.

Agree. This seems a better idea forcing the user to explain the situation :).