[PATCH 10/22] staging: comedi: das800: cleanup das800_probe()

Ian Abbott abbotti at mev.co.uk
Thu Jun 18 09:17:57 UTC 2015


On 18/06/15 08:35, Sudip Mukherjee wrote:
> On Wed, Jun 17, 2015 at 03:22:04PM -0700, H Hartley Sweeten wrote:
>> Make this function return a pointer to the boardinfo instead of an index.
>> Since it's not typical, add a comment to clarify why this legacy driver
>> does a probe.
>>
>> Consolidate the dev_dbg() messages when a probed boardinfo is used and
>> remove the extra dev_dbg() message when the boardinfo is not found.
>>
>> Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
>> ---
>>   drivers/staging/comedi/drivers/das800.c | 63 ++++++++++++++++++---------------
>>   1 file changed, 34 insertions(+), 29 deletions(-)
>>
>> diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c
>> index 39d304a..9f553f7 100644
>> --- a/drivers/staging/comedi/drivers/das800.c
>> +++ b/drivers/staging/comedi/drivers/das800.c
>> @@ -604,54 +604,62 @@ static int das800_do_insn_bits(struct comedi_device *dev,
>>   	return insn->n;
>>   }
>>
>> -static int das800_probe(struct comedi_device *dev)
>> +static const struct das800_board *das800_probe(struct comedi_device *dev)
>>   {
>> -	const struct das800_board *thisboard = dev->board_ptr;
>> -	int board = thisboard ? thisboard - das800_boards : -EINVAL;
>> +	const struct das800_board *board = dev->board_ptr;
>> +	int index = board ? board - das800_boards : -EINVAL;
> you are also changing the name from thisboard to board, which is not
> mentioned in the commit message.

Yes, patch 10 seems to have some stuff that belongs in patch 11.  Also, 
renaming two variables (board and thisboard) where one of the new names 
(index and board) is the same as one of the old names is a bit confusing!

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti at mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-


More information about the devel mailing list