mirror of https://gitee.com/openkylin/linux.git
[PATCH] struct path: convert char-drivers
Signed-off-by: Josef Sipek <jsipek@fsl.cs.sunysb.edu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
6c648be6f4
commit
a7113a9662
|
@ -82,7 +82,7 @@ static inline u32 cs5535_lowhigh_base(int reg)
|
|||
static ssize_t cs5535_gpio_write(struct file *file, const char __user *data,
|
||||
size_t len, loff_t *ppos)
|
||||
{
|
||||
u32 m = iminor(file->f_dentry->d_inode);
|
||||
u32 m = iminor(file->f_path.dentry->d_inode);
|
||||
int i, j;
|
||||
u32 base = gpio_base + cs5535_lowhigh_base(m);
|
||||
u32 m0, m1;
|
||||
|
@ -117,7 +117,7 @@ static ssize_t cs5535_gpio_write(struct file *file, const char __user *data,
|
|||
static ssize_t cs5535_gpio_read(struct file *file, char __user *buf,
|
||||
size_t len, loff_t *ppos)
|
||||
{
|
||||
u32 m = iminor(file->f_dentry->d_inode);
|
||||
u32 m = iminor(file->f_path.dentry->d_inode);
|
||||
u32 base = gpio_base + cs5535_lowhigh_base(m);
|
||||
int rd_bit = 1 << (m & 0x0f);
|
||||
int i;
|
||||
|
|
|
@ -201,7 +201,7 @@ static int dsp56k_upload(u_char __user *bin, int len)
|
|||
static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count,
|
||||
loff_t *ppos)
|
||||
{
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
int dev = iminor(inode) & 0x0f;
|
||||
|
||||
switch(dev)
|
||||
|
@ -264,7 +264,7 @@ static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count,
|
|||
static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count,
|
||||
loff_t *ppos)
|
||||
{
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
int dev = iminor(inode) & 0x0f;
|
||||
|
||||
switch(dev)
|
||||
|
@ -420,7 +420,7 @@ static int dsp56k_ioctl(struct inode *inode, struct file *file,
|
|||
#if 0
|
||||
static unsigned int dsp56k_poll(struct file *file, poll_table *wait)
|
||||
{
|
||||
int dev = iminor(file->f_dentry->d_inode) & 0x0f;
|
||||
int dev = iminor(file->f_path.dentry->d_inode) & 0x0f;
|
||||
|
||||
switch(dev)
|
||||
{
|
||||
|
|
|
@ -122,7 +122,7 @@ static void dtlk_timer_tick(unsigned long data);
|
|||
static ssize_t dtlk_read(struct file *file, char __user *buf,
|
||||
size_t count, loff_t * ppos)
|
||||
{
|
||||
unsigned int minor = iminor(file->f_dentry->d_inode);
|
||||
unsigned int minor = iminor(file->f_path.dentry->d_inode);
|
||||
char ch;
|
||||
int i = 0, retries;
|
||||
|
||||
|
@ -174,7 +174,7 @@ static ssize_t dtlk_write(struct file *file, const char __user *buf,
|
|||
}
|
||||
#endif
|
||||
|
||||
if (iminor(file->f_dentry->d_inode) != DTLK_MINOR)
|
||||
if (iminor(file->f_path.dentry->d_inode) != DTLK_MINOR)
|
||||
return -EINVAL;
|
||||
|
||||
while (1) {
|
||||
|
|
|
@ -2700,7 +2700,7 @@ static
|
|||
ssize_t
|
||||
ip2_ipl_read(struct file *pFile, char __user *pData, size_t count, loff_t *off )
|
||||
{
|
||||
unsigned int minor = iminor(pFile->f_dentry->d_inode);
|
||||
unsigned int minor = iminor(pFile->f_path.dentry->d_inode);
|
||||
int rc = 0;
|
||||
|
||||
#ifdef IP2DEBUG_IPL
|
||||
|
|
|
@ -4194,7 +4194,7 @@ static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, lof
|
|||
void *p;
|
||||
loff_t off = *offp;
|
||||
|
||||
brdnr = iminor(fp->f_dentry->d_inode);
|
||||
brdnr = iminor(fp->f_path.dentry->d_inode);
|
||||
if (brdnr >= stli_nrbrds)
|
||||
return -ENODEV;
|
||||
brdp = stli_brds[brdnr];
|
||||
|
@ -4258,7 +4258,7 @@ static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t cou
|
|||
void *p;
|
||||
loff_t off = *offp;
|
||||
|
||||
brdnr = iminor(fp->f_dentry->d_inode);
|
||||
brdnr = iminor(fp->f_path.dentry->d_inode);
|
||||
|
||||
if (brdnr >= stli_nrbrds)
|
||||
return -ENODEV;
|
||||
|
|
|
@ -296,7 +296,7 @@ static int lp_wait_ready(int minor, int nonblock)
|
|||
static ssize_t lp_write(struct file * file, const char __user * buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
unsigned int minor = iminor(file->f_dentry->d_inode);
|
||||
unsigned int minor = iminor(file->f_path.dentry->d_inode);
|
||||
struct parport *port = lp_table[minor].dev->port;
|
||||
char *kbuf = lp_table[minor].lp_buffer;
|
||||
ssize_t retv = 0;
|
||||
|
@ -415,7 +415,7 @@ static ssize_t lp_read(struct file * file, char __user * buf,
|
|||
size_t count, loff_t *ppos)
|
||||
{
|
||||
DEFINE_WAIT(wait);
|
||||
unsigned int minor=iminor(file->f_dentry->d_inode);
|
||||
unsigned int minor=iminor(file->f_path.dentry->d_inode);
|
||||
struct parport *port = lp_table[minor].dev->port;
|
||||
ssize_t retval = 0;
|
||||
char *kbuf = lp_table[minor].lp_buffer;
|
||||
|
|
|
@ -774,7 +774,7 @@ static loff_t memory_lseek(struct file * file, loff_t offset, int orig)
|
|||
{
|
||||
loff_t ret;
|
||||
|
||||
mutex_lock(&file->f_dentry->d_inode->i_mutex);
|
||||
mutex_lock(&file->f_path.dentry->d_inode->i_mutex);
|
||||
switch (orig) {
|
||||
case 0:
|
||||
file->f_pos = offset;
|
||||
|
@ -789,7 +789,7 @@ static loff_t memory_lseek(struct file * file, loff_t offset, int orig)
|
|||
default:
|
||||
ret = -EINVAL;
|
||||
}
|
||||
mutex_unlock(&file->f_dentry->d_inode->i_mutex);
|
||||
mutex_unlock(&file->f_path.dentry->d_inode->i_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ void nsc_gpio_dump(struct nsc_gpio_ops *amp, unsigned index)
|
|||
ssize_t nsc_gpio_write(struct file *file, const char __user *data,
|
||||
size_t len, loff_t *ppos)
|
||||
{
|
||||
unsigned m = iminor(file->f_dentry->d_inode);
|
||||
unsigned m = iminor(file->f_path.dentry->d_inode);
|
||||
struct nsc_gpio_ops *amp = file->private_data;
|
||||
struct device *dev = amp->dev;
|
||||
size_t i;
|
||||
|
@ -104,7 +104,7 @@ ssize_t nsc_gpio_write(struct file *file, const char __user *data,
|
|||
ssize_t nsc_gpio_read(struct file *file, char __user * buf,
|
||||
size_t len, loff_t * ppos)
|
||||
{
|
||||
unsigned m = iminor(file->f_dentry->d_inode);
|
||||
unsigned m = iminor(file->f_path.dentry->d_inode);
|
||||
int value;
|
||||
struct nsc_gpio_ops *amp = file->private_data;
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ static inline void pp_enable_irq (struct pp_struct *pp)
|
|||
static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
|
||||
loff_t * ppos)
|
||||
{
|
||||
unsigned int minor = iminor(file->f_dentry->d_inode);
|
||||
unsigned int minor = iminor(file->f_path.dentry->d_inode);
|
||||
struct pp_struct *pp = file->private_data;
|
||||
char * kbuffer;
|
||||
ssize_t bytes_read = 0;
|
||||
|
@ -189,7 +189,7 @@ static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
|
|||
static ssize_t pp_write (struct file * file, const char __user * buf,
|
||||
size_t count, loff_t * ppos)
|
||||
{
|
||||
unsigned int minor = iminor(file->f_dentry->d_inode);
|
||||
unsigned int minor = iminor(file->f_path.dentry->d_inode);
|
||||
struct pp_struct *pp = file->private_data;
|
||||
char * kbuffer;
|
||||
ssize_t bytes_written = 0;
|
||||
|
|
|
@ -1048,7 +1048,7 @@ random_write(struct file * file, const char __user * buffer,
|
|||
if (p == buffer) {
|
||||
return (ssize_t)ret;
|
||||
} else {
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
inode->i_mtime = current_fs_time(inode->i_sb);
|
||||
mark_inode_dirty(inode);
|
||||
return (ssize_t)(p - buffer);
|
||||
|
|
|
@ -75,7 +75,7 @@ static int raw_open(struct inode *inode, struct file *filp)
|
|||
filp->f_flags |= O_DIRECT;
|
||||
filp->f_mapping = bdev->bd_inode->i_mapping;
|
||||
if (++raw_devices[minor].inuse == 1)
|
||||
filp->f_dentry->d_inode->i_mapping =
|
||||
filp->f_path.dentry->d_inode->i_mapping =
|
||||
bdev->bd_inode->i_mapping;
|
||||
filp->private_data = bdev;
|
||||
mutex_unlock(&raw_mutex);
|
||||
|
|
|
@ -979,7 +979,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
|
|||
}
|
||||
|
||||
if (ret > 0) {
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
inode->i_atime = current_fs_time(inode->i_sb);
|
||||
}
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ static ssize_t tanbac_tb0219_read(struct file *file, char __user *buf, size_t le
|
|||
unsigned int minor;
|
||||
char value;
|
||||
|
||||
minor = iminor(file->f_dentry->d_inode);
|
||||
minor = iminor(file->f_path.dentry->d_inode);
|
||||
switch (minor) {
|
||||
case 0:
|
||||
value = get_led();
|
||||
|
@ -200,7 +200,7 @@ static ssize_t tanbac_tb0219_write(struct file *file, const char __user *data,
|
|||
int retval = 0;
|
||||
char c;
|
||||
|
||||
minor = iminor(file->f_dentry->d_inode);
|
||||
minor = iminor(file->f_path.dentry->d_inode);
|
||||
switch (minor) {
|
||||
case 0:
|
||||
type = TYPE_LED;
|
||||
|
|
|
@ -285,7 +285,7 @@ static ssize_t
|
|||
tipar_write (struct file *file, const char __user *buf, size_t count,
|
||||
loff_t * ppos)
|
||||
{
|
||||
unsigned int minor = iminor(file->f_dentry->d_inode) - TIPAR_MINOR;
|
||||
unsigned int minor = iminor(file->f_path.dentry->d_inode) - TIPAR_MINOR;
|
||||
ssize_t n;
|
||||
|
||||
parport_claim_or_block(table[minor].dev);
|
||||
|
@ -313,7 +313,7 @@ static ssize_t
|
|||
tipar_read(struct file *file, char __user *buf, size_t count, loff_t * ppos)
|
||||
{
|
||||
int b = 0;
|
||||
unsigned int minor = iminor(file->f_dentry->d_inode) - TIPAR_MINOR;
|
||||
unsigned int minor = iminor(file->f_path.dentry->d_inode) - TIPAR_MINOR;
|
||||
ssize_t retval = 0;
|
||||
ssize_t n = 0;
|
||||
|
||||
|
|
|
@ -1629,7 +1629,7 @@ static ssize_t tty_read(struct file * file, char __user * buf, size_t count,
|
|||
struct tty_ldisc *ld;
|
||||
|
||||
tty = (struct tty_struct *)file->private_data;
|
||||
inode = file->f_dentry->d_inode;
|
||||
inode = file->f_path.dentry->d_inode;
|
||||
if (tty_paranoia_check(tty, inode, "tty_read"))
|
||||
return -EIO;
|
||||
if (!tty || (test_bit(TTY_IO_ERROR, &tty->flags)))
|
||||
|
@ -1732,7 +1732,7 @@ static inline ssize_t do_tty_write(
|
|||
cond_resched();
|
||||
}
|
||||
if (written) {
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
inode->i_mtime = current_fs_time(inode->i_sb);
|
||||
ret = written;
|
||||
}
|
||||
|
@ -1763,7 +1763,7 @@ static ssize_t tty_write(struct file * file, const char __user * buf, size_t cou
|
|||
loff_t *ppos)
|
||||
{
|
||||
struct tty_struct * tty;
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
ssize_t ret;
|
||||
struct tty_ldisc *ld;
|
||||
|
||||
|
@ -2170,7 +2170,7 @@ static void release_dev(struct file * filp)
|
|||
unsigned long flags;
|
||||
|
||||
tty = (struct tty_struct *)filp->private_data;
|
||||
if (tty_paranoia_check(tty, filp->f_dentry->d_inode, "release_dev"))
|
||||
if (tty_paranoia_check(tty, filp->f_path.dentry->d_inode, "release_dev"))
|
||||
return;
|
||||
|
||||
check_tty_count(tty, "release_dev");
|
||||
|
@ -2680,7 +2680,7 @@ static unsigned int tty_poll(struct file * filp, poll_table * wait)
|
|||
int ret = 0;
|
||||
|
||||
tty = (struct tty_struct *)filp->private_data;
|
||||
if (tty_paranoia_check(tty, filp->f_dentry->d_inode, "tty_poll"))
|
||||
if (tty_paranoia_check(tty, filp->f_path.dentry->d_inode, "tty_poll"))
|
||||
return 0;
|
||||
|
||||
ld = tty_ldisc_ref_wait(tty);
|
||||
|
@ -2696,7 +2696,7 @@ static int tty_fasync(int fd, struct file * filp, int on)
|
|||
int retval;
|
||||
|
||||
tty = (struct tty_struct *)filp->private_data;
|
||||
if (tty_paranoia_check(tty, filp->f_dentry->d_inode, "tty_fasync"))
|
||||
if (tty_paranoia_check(tty, filp->f_path.dentry->d_inode, "tty_fasync"))
|
||||
return 0;
|
||||
|
||||
retval = fasync_helper(fd, filp, on, &tty->fasync);
|
||||
|
|
|
@ -72,7 +72,7 @@ static loff_t vcs_lseek(struct file *file, loff_t offset, int orig)
|
|||
int size;
|
||||
|
||||
down(&con_buf_sem);
|
||||
size = vcs_size(file->f_dentry->d_inode);
|
||||
size = vcs_size(file->f_path.dentry->d_inode);
|
||||
switch (orig) {
|
||||
default:
|
||||
up(&con_buf_sem);
|
||||
|
@ -98,7 +98,7 @@ static loff_t vcs_lseek(struct file *file, loff_t offset, int orig)
|
|||
static ssize_t
|
||||
vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
||||
{
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
unsigned int currcons = iminor(inode);
|
||||
struct vc_data *vc;
|
||||
long pos;
|
||||
|
@ -271,7 +271,7 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
|||
static ssize_t
|
||||
vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
|
||||
{
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
unsigned int currcons = iminor(inode);
|
||||
struct vc_data *vc;
|
||||
long pos;
|
||||
|
|
|
@ -442,7 +442,7 @@ static ssize_t viotap_write(struct file *file, const char *buf,
|
|||
if (op == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
get_dev_info(file->f_dentry->d_inode, &devi);
|
||||
get_dev_info(file->f_path.dentry->d_inode, &devi);
|
||||
|
||||
/*
|
||||
* We need to make sure we can send a request. We use
|
||||
|
@ -532,7 +532,7 @@ static ssize_t viotap_read(struct file *file, char *buf, size_t count,
|
|||
if (op == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
get_dev_info(file->f_dentry->d_inode, &devi);
|
||||
get_dev_info(file->f_path.dentry->d_inode, &devi);
|
||||
|
||||
/*
|
||||
* We need to make sure we can send a request. We use
|
||||
|
@ -612,7 +612,7 @@ static int viotap_ioctl(struct inode *inode, struct file *file,
|
|||
if (op == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
get_dev_info(file->f_dentry->d_inode, &devi);
|
||||
get_dev_info(file->f_path.dentry->d_inode, &devi);
|
||||
|
||||
down(&reqSem);
|
||||
|
||||
|
@ -777,7 +777,7 @@ static int viotap_open(struct inode *inode, struct file *file)
|
|||
if (op == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
get_dev_info(file->f_dentry->d_inode, &devi);
|
||||
get_dev_info(file->f_path.dentry->d_inode, &devi);
|
||||
|
||||
/* Note: We currently only support one mode! */
|
||||
if ((devi.devno >= viotape_numdev) || (devi.mode)) {
|
||||
|
@ -822,7 +822,7 @@ static int viotap_release(struct inode *inode, struct file *file)
|
|||
return -ENOMEM;
|
||||
init_completion(&op->com);
|
||||
|
||||
get_dev_info(file->f_dentry->d_inode, &devi);
|
||||
get_dev_info(file->f_path.dentry->d_inode, &devi);
|
||||
|
||||
if (devi.devno >= viotape_numdev) {
|
||||
ret = -ENODEV;
|
||||
|
|
|
@ -506,7 +506,7 @@ static ssize_t gpio_read(struct file *file, char __user *buf, size_t len,
|
|||
unsigned int pin;
|
||||
char value = '0';
|
||||
|
||||
pin = iminor(file->f_dentry->d_inode);
|
||||
pin = iminor(file->f_path.dentry->d_inode);
|
||||
if (pin >= giu_nr_pins)
|
||||
return -EBADF;
|
||||
|
||||
|
@ -530,7 +530,7 @@ static ssize_t gpio_write(struct file *file, const char __user *data,
|
|||
char c;
|
||||
int retval = 0;
|
||||
|
||||
pin = iminor(file->f_dentry->d_inode);
|
||||
pin = iminor(file->f_path.dentry->d_inode);
|
||||
if (pin >= giu_nr_pins)
|
||||
return -EBADF;
|
||||
|
||||
|
|
Loading…
Reference in New Issue