Patch for slmodem's slusb
أحمد المحمودي <[email protected]> Tue, 13 Dec 2011 07:01:49 +0200
| Newsgroups | gmane.linux.linmodem |
|---|---|
| Message-ID | <[email protected]> |
--WChQLJJJfbwij+9x
Content-Type: multipart/mixed; boundary="2/5bycvrmDh4d1IB"
Content-Disposition: inline
--2/5bycvrmDh4d1IB
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Hello,
I just added a patch for slusb that does the following:
* Fix device_create call for linux kernel >=3D 2.6.27
* Also fixed device_create call for linux kernel >=3D 2.6.25 (two=20
arguments were switched together !!!)
* Used proper indentation to make things clear
Actually the first two fixes makes me wonder how (or even whether)=20
slusb actually worked for anyone using linux kernel 2.6.25 or later !
--=20
=E2=80=8E=D8=A3=D8=AD=D9=85=D8=AF =D8=A7=D9=84=D9=85=D8=AD=D9=85=D9=88=D8=
=AF=D9=8A (Ahmed El-Mahmoudy)
Digital design engineer
GPG KeyID: 0xEDDDA1B7
GPG Fingerprint: 8206 A196 2084 7E6D 0DF8 B176 BC19 6A94 EDDD A1B7
--2/5bycvrmDh4d1IB
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment; filename="device_create_changes.diff"
Content-Transfer-Encoding: quoted-printable
Description: Fix device_create call for linux kernel >=3D 2.6.27
* Also fixed device_create call for linux kernel >=3D 2.6.25 (two argument=
s were switched together !!!)
* Used proper indentation to make things clear
Author: =D8=A3=D8=AD=D9=85=D8=AF =D8=A7=D9=84=D9=85=D8=AD=D9=85=D9=88=D8=AF=
=D9=8A (Ahmed El-Mahmoudy) <[email protected]>
Bug-Debian: http://bugs.debian.org/651781
Forwarded: yes
--- a/drivers/st7554.c
+++ b/drivers/st7554.c
@@ -219,19 +219,23 @@
#define CLASS_DEVICE_DESTROY(class, dev) class_simple_device_remove(dev)
#define CLASS_CREATE(owner, name) class_simple_create(owner, name)
static struct class_simple *st7554_class;
-#else
-#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,25)
-#define CLASS_DEVICE_CREATE(class, dev, device, fmt, rest) device_create(c=
lass, dev, device, fmt, rest)
+#else /* ! FOUND_CLASS_SIMPLE */
+# if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,25)
+# if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,27)
+#define CLASS_DEVICE_CREATE(class, dev, device, fmt, rest) device_create(c=
lass, device, dev, NULL, fmt, rest)
+# else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) */
+#define CLASS_DEVICE_CREATE(class, dev, device, fmt, rest) device_create(c=
lass, device, dev, fmt, rest)
+# endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,27) */
#define CLASS_DEVICE_DESTROY(class, dev) device_destroy(class, dev)
-#else
+# else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) */
#include <linux/moduleparam.h>
#define CLASS_DEVICE_CREATE(class, dev, device, fmt, rest) class_device_cr=
eate(class, dev, device, fmt, rest)
#define CLASS_DEVICE_DESTROY(class, dev) class_device_destroy(class, dev)
-#endif
+# endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,25) */
#define CLASS_DESTROY(class) class_destroy(class)
#define CLASS_CREATE(owner, name) class_create(owner, name)
static struct class *st7554_class;
-#endif
+#endif /* FOUND_CLASS_SIMPLE */
=20
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
static DECLARE_MUTEX(open_sem);
--2/5bycvrmDh4d1IB--
--WChQLJJJfbwij+9x
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEcBAEBCAAGBQJO5tw9AAoJELwZapTt3aG32SMH/RX+MbD5U4NBnGZhyLXl8KYH
IIm0kxBlHlNVZULdqNsb9iaTWuL+bVDeA1T7v8j8DzSP/6uHbaFEvlVsekvK1bLi
YRQkaodFkRCkLHKVbp58fggUQpawp5+cuuQ0VzpKaKIMvKbOgx0lVbZ4IN4LXwG3
5P4742B9wehUqsprUoWIhhAWSp0SqJtQFKRBrIJJ8dBhWgdeGksm0p4/Xhwkltdq
BenPXvGxxjNNsHJcmbBsyV+Ra9wvgxH5M00ErmL/S5Hz2q3GlZr/qLSB/4/aA4MX
N/U7bz4zyzkDfQyrG62bfi8491i+nba+mPFLxD8oA+nqqA8O1Tclg+sV5Do7R+A=
=BbMc
-----END PGP SIGNATURE-----
--WChQLJJJfbwij+9x--