sema_init fail in 2.6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, i recently porting my driver from 2.4.35 to 2.6.X kernel.
I meet some strange behaviour with sema_init. This is the code snippet

/**
 * this code is compiled & working in 2.4 kernel.
 * Compiled in 2.6 but fail in module initialization.
 */
static struct semaphore sem_fail;

static init __init my_module_init_fail(void)
{
        sema_init (&sem_fail, 1);
}

/**
 * this code compiled & work in 2.6
 */
struct semaphore *sem;

static init __init my_module_init(void)
{
        sem = (struct semaphore *) kmalloc (sizeof (struct semaphore
), GFP_KERNEL);
        sema_init (sem, 1);
}

Any idea?
Thx

-- 
Iwan Budi Kusnanto

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux