- Change spin_lock + local_irq_save into spin_lock_irqsave
- Change spin_unlock + local_irq_restore into spin_unlock_irqrestore
- Return ENOTTY if ioctl is not recognized as a cris ioctl.
- Make init functions static.
unsigned char value;
unsigned long flags;
unsigned char value;
unsigned long flags;
+ spin_lock_irqsave(&i2c_lock, flags);
- /*
- * we don't like to be interrupted
- */
- local_irq_save(flags);
* end byte stream
*/
i2c_stop();
* end byte stream
*/
i2c_stop();
- /*
- * enable interrupt again
- */
- local_irq_restore(flags);
} while (error && cntr--);
i2c_delay(CLOCK_LOW_TIME);
} while (error && cntr--);
i2c_delay(CLOCK_LOW_TIME);
- spin_unlock(&i2c_lock);
+ spin_unlock_irqrestore(&i2c_lock, flags);
int error, cntr = 3;
unsigned long flags;
int error, cntr = 3;
unsigned long flags;
+ spin_lock_irqsave(&i2c_lock, flags);
do {
error = 0;
memset(data, 0, nbytes);
do {
error = 0;
memset(data, 0, nbytes);
- /*
- * we don't like to be interrupted
- */
- local_irq_save(flags);
/*
* generate start condition
*/
/*
* generate start condition
*/
* end sequence
*/
i2c_stop();
* end sequence
*/
i2c_stop();
- /*
- * enable interrupt again
- */
- local_irq_restore(flags);
} while (error && cntr--);
} while (error && cntr--);
- spin_unlock(&i2c_lock);
+ spin_unlock_irqrestore(&i2c_lock, flags);
int error, cntr = 3;
unsigned long flags;
int error, cntr = 3;
unsigned long flags;
+ spin_lock_irqsave(&i2c_lock, flags);
- /*
- * we don't like to be interrupted
- */
- local_irq_save(flags);
* end byte stream
*/
i2c_stop();
* end byte stream
*/
i2c_stop();
- /*
- * enable interrupt again
- */
- local_irq_restore(flags);
} while(error && cntr--);
i2c_delay(CLOCK_LOW_TIME);
} while(error && cntr--);
i2c_delay(CLOCK_LOW_TIME);
- spin_unlock(&i2c_lock);
+ spin_unlock_irqrestore(&i2c_lock, flags);
int error, cntr = 3;
unsigned long flags;
int error, cntr = 3;
unsigned long flags;
+ spin_lock_irqsave(&i2c_lock, flags);
- /*
- * we don't like to be interrupted
- */
- local_irq_save(flags);
/*
* generate start condition
*/
/*
* generate start condition
*/
* end sequence
*/
i2c_stop();
* end sequence
*/
i2c_stop();
- /*
- * enable interrupt again
- */
- local_irq_restore(flags);
} while(error && cntr--);
} while(error && cntr--);
- spin_unlock(&i2c_lock);
+ spin_unlock_irqrestore(&i2c_lock, flags);
unsigned int cmd, unsigned long arg)
{
if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) {
unsigned int cmd, unsigned long arg)
{
if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) {
}
switch (_IOC_NR(cmd)) {
}
switch (_IOC_NR(cmd)) {
.release = i2c_release,
};
.release = i2c_release,
};
-int __init
-i2c_init(void)
+static int __init i2c_init(void)
{
static int res;
static int first = 1;
{
static int res;
static int first = 1;
-int __init
-i2c_register(void)
+static int __init i2c_register(void)
int res;
res = i2c_init();
int res;
res = i2c_init();
/* register char device */
res = register_chrdev(I2C_MAJOR, i2c_name, &i2c_fops);
/* register char device */
res = register_chrdev(I2C_MAJOR, i2c_name, &i2c_fops);
printk(KERN_ERR "i2c: couldn't get a major number.\n");
return res;
}
printk(KERN_ERR "i2c: couldn't get a major number.\n");
return res;
}
/* this makes sure that i2c_init is called during boot */
/* this makes sure that i2c_init is called during boot */
module_init(i2c_register);
/****************** END OF FILE i2c.c ********************************/
module_init(i2c_register);
/****************** END OF FILE i2c.c ********************************/