rfkill: detect bogus double-registering (v2)
commit340288feab081705392f4fdca41e6345a50e4837
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 19 Oct 2008 21:00:11 +0000 (19 19:00 -0200)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 19 Oct 2008 21:00:11 +0000 (19 19:00 -0200)
tree7c6aaff3bfcb15a5c6e0f1100c3a8c74cb386c8a
parent9e283a74a98c0c6ba55e1fd9cb2ef50a3204da35
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