On 2013-04-09 02:20, H Hartley Sweeten wrote:
-/* settling delay times in usec for different gains */ -static const int gaindelay[] = { 10, 20, 40, 80 };
if (insn->n > 0) { - BUG_ON(gain >= ARRAY_SIZE(gaindelay)); - udelay(gaindelay[gain]); + int delay = (gain == 0) ? 10 : + (gain == 1) ? 20 : + (gain == 2) ? 40 : 80; + + udelay(delay); }
You could use: int delay = 10 << gain; although that would be harder to tweak later. -- -=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@xxxxxxxxx> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel