Subject: [PATCH 05/15] ARM: S5PC100: Use common functions for gpiolib implementation

From: [email-masked] (Maurus Cuelenaere)
Date: Mon, 17 May 2010 15:59:41 +0200

Op 17-05-10 13:14, Kukjin Kim schreef:
> Marek Szyprowski wrote:
>   
> <snip>
>> -
>>  static __init int s5pc1xx_gpiolib_init(void)
>>  {
>> -	struct s3c_gpio_chip *chips;
>> +	struct s3c_gpio_chip *chip;
>>  	int nr_chips;
>>
>> -		chips = s5pc100_gpio_chips;
>> -		nr_chips = ARRAY_SIZE(s5pc100_gpio_chips);
>> +	chip = s5pc100_gpio_chips;
>> +	nr_chips = ARRAY_SIZE(s5pc100_gpio_chips);
>> +
>> +	for (; nr_chips > 0; nr_chips--, chip++)
>> +		s5pc100_gpiolib_link(chip);
>>
>> -	s5pc1xx_gpiolib_add(chips, nr_chips, s5pc1xx_gpiolib_link);
>> +	samsung_gpiolib_add_4bit_chips(s5pc100_gpio_chips,
>> +				       ARRAY_SIZE(s5pc100_gpio_chips));
>>     
> nr_chips?
>   

You can't use nr_chips as it has been decremented to 0 in the for loop
above it.

-- 
Maurus Cuelenaere