如何查找unregister_chrdev()调用是否成功 [英] how to find if unregister_chrdev() call was successful
问题描述
unregister_chrdev()调用用于返回0(如果成功),而返回<0.但是现在,在较新的内核版本中,该函数的返回值已更改为void,因此它不再返回任何东西.
unregister_chrdev() call from [linux\fs.h] used to return 0 if successful and <0 other wise. But now, in newer kernel versions, the return value of the function has been changed to void so it no longer returns any thing.
问题:有什么方法可以找出unregister_chrdev()调用是否成功?
Question: Is there any way to find out if the unregister_chrdev() call was successful or not?
推荐答案
void的返回是通过更改集完成的:e53252d97e670a38b1d2e9723b48077bba11ddda
The return of void was done by changeset: e53252d97e670a38b1d2e9723b48077bba11ddda
commit e53252d97e670a38b1d2e9723b48077bba11ddda
Author: Akinobu Mita
Date: Thu Jul 19 01:47:51 2007 -0700
unregister_chrdev() return void
unregister_chrdev() does not return meaningful value. This patch makes it
return void like most unregister_* functions.
实际上,如果您看过以前的代码(从2.6.12-rc2开始),您会看到它总是返回0,因此这是一个总是希望成功的函数.
In fact if you look at the code before (from 2.6.12-rc2 onwards) you can see it always returned 0 so this is a function that is always expected to succeed.
这篇关于如何查找unregister_chrdev()调用是否成功的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!