|
From: Anton M. <an...@po...> - 2007-11-06 11:23:40
|
I am sorry for spaming, I forgot to write the subject in my previous email. Hi, everyone. The build on the 2.6.23 and newer kernels fails with the error =2E../linux-gpib-3.2.09/drivers/gpib/sys/osinit.c: In function =E2=80=98gpi= b_common_exit_module=E2=80=99: =2E../linux-gpib-3.2.09/drivers/gpib/sys/osinit.c:236: error: void value no= t 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. Also You can find the updated ebuild and patch at http://bugs.gentoo.org/sh= ow_bug.cgi?id=3D165399 =2D-- drivers/gpib/sys/osinit.c.original =C2=A02007-11-06 19:19:48.00000000= 0 +0900 +++ drivers/gpib/sys/osinit.c =C2=A0 2007-11-06 19:20:48.000000000 +0900 @@ -227,20 +227,12 @@ =C2=A0static void __exit gpib_common_exit_module( void ) =C2=A0{ =C2=A0 =C2=A0 =C2=A0 =C2=A0 int i; =2D =C2=A0 =C2=A0 =C2=A0 int retval; =C2=A0 =C2=A0 =C2=A0 =C2=A0 for(i =3D 0; i < GPIB_MAX_NUM_BOARDS; ++i) =C2=A0 =C2=A0 =C2=A0 =C2=A0 { =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 class_device_destro= y(gpib_class, MKDEV(IBMAJOR, i)); =C2=A0 =C2=A0 =C2=A0 =C2=A0 } =C2=A0 =C2=A0 =C2=A0 =C2=A0 class_destroy(gpib_class); =2D =C2=A0 =C2=A0 =C2=A0 retval =3D unregister_chrdev(IBMAJOR, "gpib"); =2D =C2=A0 =C2=A0 =C2=A0 if(retval) =2D =C2=A0 =C2=A0 =C2=A0 { =2D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 printk("gpib: unregist= er_chrdev() returned error %i\n", retval); =2D =C2=A0 =C2=A0 =C2=A0 }else =2D =C2=A0 =C2=A0 =C2=A0 { =2D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 printk("gpib: succesfu= lly removed \n"); =2D =C2=A0 =C2=A0 =C2=A0 } + =C2=A0 =C2=A0 =C2=A0 unregister_chrdev(IBMAJOR, "gpib"); =C2=A0} =C2=A0module_init( gpib_common_init_module ); |