rfkill: detect bogus double-registering (v2)
commit488ab2261ecfc1430428333e2c76db6c0832ac56
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 11 Nov 2008 01:46:32 +0000 (10 23:46 -0200)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 11 Nov 2008 01:46:32 +0000 (10 23:46 -0200)
tree369c8ff5b2de5bfa3597297b58105d2e4c926408
parentc20a02f2c3014a2d5f42d2d3600e937a3cf35706
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