> > + chip = next_chip(NULL); > > The chip should probably be passed in as a function parameter. I could > see people being interested in using the GPIOs on the 2nd chip too. > You'll need to move the callback array into a per-chip structure too. Good point. I will update the code and re-send the patch.