]> Git Repo - linux.git/commit
sysdev: detect multiple driver registrations
authorBen Dooks <[email protected]>
Tue, 4 Mar 2008 23:09:06 +0000 (15:09 -0800)
committerGreg Kroah-Hartman <[email protected]>
Sun, 20 Apr 2008 02:10:24 +0000 (19:10 -0700)
commitda009f39f85a3ee9deeb10f0f05ddd4efdd67020
treeba04c23e0d5a831705f0f9bfe1a9be10aff99a78
parent6c847402e1c69c1cfe2bddeadc8391bacbb3d0a5
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]>
drivers/base/sys.c
This page took 0.052849 seconds and 4 git commands to generate.