On Thu, May 16, 2019 at 10:14:56PM +0000, Matt Sickler wrote: > >-----Original Message----- > >From: devel <driverdev-devel-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of > >Previously the next card number was assigned from a static int local variable, > >which was read and later incremented. This was not thread- safe, so now we > >use an atomic_t and atomic_fetch_add instead. > > Switching to atomic_fetch_add is definitely an improvement over what that code > was doing prior, but is that the proper solution? How do other parts of the > kernel handle giving devices unique ID numbers? You use an "ida" structure. That's the correct solution here, don't mess with an atomic variable, that's not needed. thanks, greg k-h _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel