]> git.baikalelectronics.ru Git - kernel.git/commit
char: add WARN_ON() in misc_deregister()
authorAkinobu Mita <akinobu.mita@gmail.com>
Tue, 10 Aug 2010 00:20:35 +0000 (17:20 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 10 Aug 2010 03:45:06 +0000 (20:45 -0700)
commit05bddf91bc03900ed233e030322b66cb0dbd0779
treee0a977fef2f05b0863c99738eb170ba852c97e1f
parent6649ac8cca4d924ad75b456732779281c780cf05
char: add WARN_ON() in misc_deregister()

misc_deregister() returns an error only when it attempts to unregister
the device that is not registered. This is the driver's bug.

Most of the drivers don't check the return value of misc_deregister().
(It is not bad thing because most of kernel *_unregister() API always
succeed and do not return value)

So it is better to indicate the error by WARN_ON() in misc_deregister().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/misc.c