[PARPORT] memset


Tim Waugh (tim@cyberelk.demon.co.uk)
Thu, 18 Mar 1999 09:18:12 +0000 (GMT)


Hi Guys,

I'm unable to get the memset unresolved-symbol thing to happen with my
compiler, so could people who are having trouble with it try this? It's
about the only change between 2.2.3-tmw2 and 2.2.3-tmw3 that does anything
with structures.

Thanks,
Tim.
*/

--- drivers/misc/parport_ieee1284.c~ Thu Mar 18 09:05:53 1999
+++ drivers/misc/parport_ieee1284.c Thu Mar 18 09:16:13 1999
@@ -498,7 +498,7 @@
 /* Callback stuff for parport_negotiate. */
 
 struct negotiation_done {
- struct semaphore sem;
+ struct semaphore *sem;
         int ret;
 };
 
@@ -506,7 +506,7 @@
 {
         struct negotiation_done *done = handle;
         done->ret = ret;
- up (&done->sem);
+ up (done->sem);
 }
 
 /* Negotiate an IEEE 1284 mode.
@@ -517,7 +517,8 @@
  */
 int parport_negotiate (struct parport *port, int mode)
 {
- struct negotiation_done done = { MUTEX_LOCKED };
+ struct semaphore sem = MUTEX_LOCKED;
+ struct negotiation_done done = { &sem };
         int error;
 
         error = parport_negotiate_later (port, mode, negotiation_callback,
@@ -526,7 +527,7 @@
         if (error)
                 return error;
 
- down_interruptible (&done.sem);
+ down_interruptible (&sem);
         return done.ret;
 }
 
@@ -554,7 +555,7 @@
 
 struct callback_info
 {
- struct semaphore sem;
+ struct semaphore *sem;
         size_t count;
 };
 
@@ -563,7 +564,7 @@
         struct callback_info *cb_info = info;
         
         cb_info->count = count;
- up (&cb_info->sem);
+ up (cb_info->sem);
         return;
 }
 
@@ -571,7 +572,8 @@
 ssize_t write_block (struct parport *port, const void *buffer, size_t len,
                      parport_write_block_fn fn)
 {
- struct callback_info info = { MUTEX_LOCKED };
+ struct semaphore sem = MUTEX_LOCKED;
+ struct callback_info info = { &sem };
         int error;
         /* Start the writing operation. */
         error = fn (port, buffer, len, callback, &info);
@@ -580,7 +582,7 @@
                 return error;
 
         /* Wait for completion. */
- down_interruptible (&info.sem);
+ down_interruptible (&sem);
         return info.count;
 }
 
@@ -589,7 +591,8 @@
 ssize_t read_block (struct parport *port, void *buffer, size_t len,
                     parport_read_block_fn fn)
 {
- struct callback_info info = { MUTEX_LOCKED };
+ struct semaphore sem = MUTEX_LOCKED;
+ struct callback_info info = { &sem };
         int error;
 
         /* Start the reading operation. */
@@ -599,7 +602,7 @@
                 return error;
 
         /* Wait for completion. */
- down_interruptible (&info.sem);
+ down_interruptible (&sem);
         return info.count;
 }
 #endif /* IEEE1284 support */

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Sun 28 Mar 1999 - 17:01:48 EST