rfkill: detect bogus double-registering (v2)
commit64d12dcedaeeadba7a01dea1da0ed4786f1dd546
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 24 Mar 2009 06:52:57 +0000 (24 03:52 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 24 Mar 2009 06:52:57 +0000 (24 03:52 -0300)
treed6ddd1d9f497b81b7e09b6c53b965afe183b4c1e
parentb3fa1152a4d04fc674265a48562f4f4aacc025f4
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