rfkill: detect bogus double-registering (v2)
commitfafea10ff90cb485d076f9dda3fb9f74180d6ccf
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Fri, 13 May 2011 12:21:19 +0000 (13 09:21 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Fri, 13 May 2011 12:21:19 +0000 (13 09:21 -0300)
treefdef969f385dd8bb17c886efb0e2c5b5da77e8c8
parent1f4c79cdb3fd856edde28af25576bcd8341eef78
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>
Cc: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
net/rfkill/rfkill.c