sysdev: detect multiple driver registrations
I've just found how easy it is to accidentally register a sysdev_driver for
two different classes. When this happens, bad things happen as the
sysdev_driver structure keeps has the list entry for the driver
registration.
The following patch makes a WARN_ON() if this happens, although I think
BUG_ON or returning -EAGAIN could also be valid responses to this.
Signed-off-by: Ben Dooks <[email protected]>
Cc: Kay Sievers <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>