|
From: Anton M. <an...@po...> - 2007-11-06 11:15:37
|
Hi, everyone.
The build on the 2.6.23 and newer kernels fails with the error
/home/antonmx/tmp/linux-gpib-3.2.09/drivers/gpib/sys/osinit.c: In function =
=E2=80=98gpib_common_exit_module=E2=80=99:
/home/antonmx/tmp/linux-gpib-3.2.09/drivers/gpib/sys/osinit.c:236: error: v=
oid value not ignored as it ought to be
This happens because prior to kernel 2.6.23 the function "unregister_chrdev=
" returned an integer value. Kernel 2.6.23 changes the function signature o=
f "unregister_chrdev" to return void instead of and integer. However, in th=
e earlier kernels (at least 2.6.22, I did not checked earlier) this functio=
n ALWAYS returned 0 (see file fs/char_dev.c) and therefore the "if ... then=
" construction in function "gpib_common_exit_module" from "linux-gpib-3.2.0=
9/drivers/gpib/sys/osinit.c" has no sence. Below you can find the patch whi=
ch solves the build problem and removes unneeded if-then.
=2D-- drivers/gpib/sys/osinit.c.original 2007-11-06 19:19:48.000000000 +09=
00
+++ drivers/gpib/sys/osinit.c 2007-11-06 19:20:48.000000000 +0900
@@ -227,20 +227,12 @@
static void __exit gpib_common_exit_module( void )
{
int i;
=2D int retval;
for(i =3D 0; i < GPIB_MAX_NUM_BOARDS; ++i)
{
class_device_destroy(gpib_class, MKDEV(IBMAJOR, i));
}
class_destroy(gpib_class);
=2D retval =3D unregister_chrdev(IBMAJOR, "gpib");
=2D if(retval)
=2D {
=2D printk("gpib: unregister_chrdev() returned error %i\n", r=
etval);
=2D }else
=2D {
=2D printk("gpib: succesfully removed \n");
=2D }
+ unregister_chrdev(IBMAJOR, "gpib");
}
module_init( gpib_common_init_module );
|