rfkill: detect bogus double-registering (v2)
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sat, 2 Aug 2008 18:10:57 +0000 (15:10 -0300)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 22 Aug 2008 20:29:56 +0000 (16:29 -0400)
commit02589f60510030a3c1496e7a8c511e4f674ef5ff
tree24650fdd0e2a0ad8145693164fa27e847379aacc
parentc94c93da90a9e46a73a5733ff8454fb4b14733fb
rfkill: detect bogus double-registering (v2)

Detect and abort with -EEXIST if rfkill_register is called twice on the
same rfkill struct.  And WARN_ON(it) for good measure.

While at it, flag when we are adding the first switch of a type, we will
need that information later.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/rfkill/rfkill.c