Re: Bug#613906: sl-modem-source: sl-modem fails to compile with kernel 2.6.37-1-686 (fwd)

أحمد المحمودي <[email protected]>
Newsgroups gmane.linux.linmodem
Message-ID <[email protected]>
Hello,

  I found a patch for this on Gentoo (thanks to a previous post by 
  Antonio on this mailing list). The patch is attached with this email 
  (ioctl.diff).

  Also, I have made another patch (semaphore.diff) for another compile 
  failure that occured with st7554.c, please find that patch in the 
  attachments.

-- 
 ‎أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0xEDDDA1B7
 GPG Fingerprint: 8206 A196 2084 7E6D 0DF8  B176 BC19 6A94 EDDD A1B7
ioctl.diff (text/x-diff, 1.2 KB)
Description: Fix compilation of slamr module with 2.6.36
  ioctl got deprecated since kernel 2.6.36
Origin: http://bugs.gentoo.org/attachment.cgi?id=259296
Bug-Gentoo: http://bugs.gentoo.org/show_bug.cgi?id=302456
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613906
Bug-Ubuntu: https://bugs.launchpad.net/bugs/737650
--- a/drivers/amrmo_init.c	2011-01-06 20:12:59.000000000 +0100
+++ b/drivers/amrmo_init.c	2011-01-06 20:12:34.000000000 +0100
@@ -437,11 +437,11 @@ static unsigned int amrmo_poll(struct fi
 
 
 
-static int amrmo_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long parg)
+static long amrmo_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long parg)
 {
 	struct amrmo_struct *amrmo = (struct amrmo_struct *)file->private_data;
         unsigned long flags;
-	int ret;
+	long ret;
 	unsigned stat;
 	unsigned long arg=0;
 
@@ -514,7 +514,7 @@ static struct file_operations amrmo_fops
         .read =    amrmo_read,
         .write =   amrmo_write,
         .poll =    amrmo_poll,
-        .ioctl =   amrmo_ioctl,
+        .unlocked_ioctl =   amrmo_unlocked_ioctl,
         .open =    amrmo_open,
         .release = amrmo_release,
 };
semaphore.diff (text/x-diff, 852 B)
Description: Fix compilation of slusb with 2.6.37
 *_MUTEX got deprecated since kernel 2.6.37
Author: أحمد المحمودي (Ahmed El-Mahmoudy) <[email protected]>
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613906
Bug-Ubuntu: https://bugs.launchpad.net/bugs/737650
--- a/drivers/st7554.c
+++ b/drivers/st7554.c
@@ -233,7 +233,11 @@
 static struct class *st7554_class;
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 static DECLARE_MUTEX(open_sem);
+#else
+static DEFINE_SEMAPHORE(open_sem);
+#endif
 
 /* --------------------------------------------------------------------- */
 
@@ -1234,7 +1238,11 @@
 	memset(s, 0, sizeof(*s));
 
 	spin_lock_init(&s->lock);
+#ifdef init_MUTEX
 	init_MUTEX (&s->sem);
+#else
+  sema_init (&s->sem, 1);
+#endif
 	init_waitqueue_head(&s->wait);
 
 	s->name = "ST7554 USB Modem";
signature.asc (application/pgp-signature, 490 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEbBAEBCAAGBQJNhvxpAAoJELwZapTt3aG3udsH+M5Bl8tSgSE/LwrTV+CXSn5c
Ab0QeSEX2YXQ8yxxYY2MOZp46Vfbdgl3hJPKOVA1IpnYFj/aDuFPZ38hbDMYw2HH
f2+tnVjRaX8v08dNqMOF6vievXmhFJ3MHlYgS2tDp0RJN+mZ1SCVJJL7HfJSIlry
sa3njH/S6ph4AUiR4HVEvpx73ipipvBToyShZnJOZ9WFAMQDHeeEkMClGohaqkcG
sppsIVSZdKbjRYodd/l1eVzorE1s7nG8R/6kDPnMZhsfZiBy/Yhg3wJqeq8YZN9U
CKj7AnJxrwQYVjJkJeE8ryLHUvTgyAbZrxD06xoqfhjItu0AA/TgdoB8dng8Yw==
=YiML
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.