aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-23 17:07:38 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-22 23:31:31 -0500
commit496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch)
tree8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /drivers/char
parent57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff)
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/dsp56k.c8
-rw-r--r--drivers/char/dtlk.c4
-rw-r--r--drivers/char/lp.c8
-rw-r--r--drivers/char/mem.c4
-rw-r--r--drivers/char/nsc_gpio.c4
-rw-r--r--drivers/char/pcmcia/cm4000_cs.c2
-rw-r--r--drivers/char/ppdev.c6
-rw-r--r--drivers/char/ps3flash.c2
-rw-r--r--drivers/char/raw.c2
-rw-r--r--drivers/char/sonypi.c2
-rw-r--r--drivers/char/tb0219.c4
11 files changed, 23 insertions, 23 deletions
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c
index 052797b32bd3..01a5ca7425d7 100644
--- a/drivers/char/dsp56k.c
+++ b/drivers/char/dsp56k.c
@@ -181,7 +181,7 @@ static int dsp56k_upload(u_char __user *bin, int len)
181static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count, 181static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count,
182 loff_t *ppos) 182 loff_t *ppos)
183{ 183{
184 struct inode *inode = file->f_path.dentry->d_inode; 184 struct inode *inode = file_inode(file);
185 int dev = iminor(inode) & 0x0f; 185 int dev = iminor(inode) & 0x0f;
186 186
187 switch(dev) 187 switch(dev)
@@ -244,7 +244,7 @@ static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count,
244static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count, 244static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count,
245 loff_t *ppos) 245 loff_t *ppos)
246{ 246{
247 struct inode *inode = file->f_path.dentry->d_inode; 247 struct inode *inode = file_inode(file);
248 int dev = iminor(inode) & 0x0f; 248 int dev = iminor(inode) & 0x0f;
249 249
250 switch(dev) 250 switch(dev)
@@ -306,7 +306,7 @@ static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t co
306static long dsp56k_ioctl(struct file *file, unsigned int cmd, 306static long dsp56k_ioctl(struct file *file, unsigned int cmd,
307 unsigned long arg) 307 unsigned long arg)
308{ 308{
309 int dev = iminor(file->f_path.dentry->d_inode) & 0x0f; 309 int dev = iminor(file_inode(file)) & 0x0f;
310 void __user *argp = (void __user *)arg; 310 void __user *argp = (void __user *)arg;
311 311
312 switch(dev) 312 switch(dev)
@@ -408,7 +408,7 @@ static long dsp56k_ioctl(struct file *file, unsigned int cmd,
408#if 0 408#if 0
409static unsigned int dsp56k_poll(struct file *file, poll_table *wait) 409static unsigned int dsp56k_poll(struct file *file, poll_table *wait)
410{ 410{
411 int dev = iminor(file->f_path.dentry->d_inode) & 0x0f; 411 int dev = iminor(file_inode(file)) & 0x0f;
412 412
413 switch(dev) 413 switch(dev)
414 { 414 {
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
index 85156dd0caee..65a8d96c0e93 100644
--- a/drivers/char/dtlk.c
+++ b/drivers/char/dtlk.c
@@ -125,7 +125,7 @@ static char dtlk_write_tts(char);
125static ssize_t dtlk_read(struct file *file, char __user *buf, 125static ssize_t dtlk_read(struct file *file, char __user *buf,
126 size_t count, loff_t * ppos) 126 size_t count, loff_t * ppos)
127{ 127{
128 unsigned int minor = iminor(file->f_path.dentry->d_inode); 128 unsigned int minor = iminor(file_inode(file));
129 char ch; 129 char ch;
130 int i = 0, retries; 130 int i = 0, retries;
131 131
@@ -177,7 +177,7 @@ static ssize_t dtlk_write(struct file *file, const char __user *buf,
177 } 177 }
178#endif 178#endif
179 179
180 if (iminor(file->f_path.dentry->d_inode) != DTLK_MINOR) 180 if (iminor(file_inode(file)) != DTLK_MINOR)
181 return -EINVAL; 181 return -EINVAL;
182 182
183 while (1) { 183 while (1) {
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index a741e418b456..dafd9ac6428f 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -294,7 +294,7 @@ static int lp_wait_ready(int minor, int nonblock)
294static ssize_t lp_write(struct file * file, const char __user * buf, 294static ssize_t lp_write(struct file * file, const char __user * buf,
295 size_t count, loff_t *ppos) 295 size_t count, loff_t *ppos)
296{ 296{
297 unsigned int minor = iminor(file->f_path.dentry->d_inode); 297 unsigned int minor = iminor(file_inode(file));
298 struct parport *port = lp_table[minor].dev->port; 298 struct parport *port = lp_table[minor].dev->port;
299 char *kbuf = lp_table[minor].lp_buffer; 299 char *kbuf = lp_table[minor].lp_buffer;
300 ssize_t retv = 0; 300 ssize_t retv = 0;
@@ -413,7 +413,7 @@ static ssize_t lp_read(struct file * file, char __user * buf,
413 size_t count, loff_t *ppos) 413 size_t count, loff_t *ppos)
414{ 414{
415 DEFINE_WAIT(wait); 415 DEFINE_WAIT(wait);
416 unsigned int minor=iminor(file->f_path.dentry->d_inode); 416 unsigned int minor=iminor(file_inode(file));
417 struct parport *port = lp_table[minor].dev->port; 417 struct parport *port = lp_table[minor].dev->port;
418 ssize_t retval = 0; 418 ssize_t retval = 0;
419 char *kbuf = lp_table[minor].lp_buffer; 419 char *kbuf = lp_table[minor].lp_buffer;
@@ -679,7 +679,7 @@ static long lp_ioctl(struct file *file, unsigned int cmd,
679 struct timeval par_timeout; 679 struct timeval par_timeout;
680 int ret; 680 int ret;
681 681
682 minor = iminor(file->f_path.dentry->d_inode); 682 minor = iminor(file_inode(file));
683 mutex_lock(&lp_mutex); 683 mutex_lock(&lp_mutex);
684 switch (cmd) { 684 switch (cmd) {
685 case LPSETTIMEOUT: 685 case LPSETTIMEOUT:
@@ -707,7 +707,7 @@ static long lp_compat_ioctl(struct file *file, unsigned int cmd,
707 struct timeval par_timeout; 707 struct timeval par_timeout;
708 int ret; 708 int ret;
709 709
710 minor = iminor(file->f_path.dentry->d_inode); 710 minor = iminor(file_inode(file));
711 mutex_lock(&lp_mutex); 711 mutex_lock(&lp_mutex);
712 switch (cmd) { 712 switch (cmd) {
713 case LPSETTIMEOUT: 713 case LPSETTIMEOUT:
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index c6fa3bc2baa8..e23b4a247b72 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -708,7 +708,7 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
708{ 708{
709 loff_t ret; 709 loff_t ret;
710 710
711 mutex_lock(&file->f_path.dentry->d_inode->i_mutex); 711 mutex_lock(&file_inode(file)->i_mutex);
712 switch (orig) { 712 switch (orig) {
713 case SEEK_CUR: 713 case SEEK_CUR:
714 offset += file->f_pos; 714 offset += file->f_pos;
@@ -725,7 +725,7 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
725 default: 725 default:
726 ret = -EINVAL; 726 ret = -EINVAL;
727 } 727 }
728 mutex_unlock(&file->f_path.dentry->d_inode->i_mutex); 728 mutex_unlock(&file_inode(file)->i_mutex);
729 return ret; 729 return ret;
730} 730}
731 731
diff --git a/drivers/char/nsc_gpio.c b/drivers/char/nsc_gpio.c
index 808d44e9a32a..b07b119ae57f 100644
--- a/drivers/char/nsc_gpio.c
+++ b/drivers/char/nsc_gpio.c
@@ -41,7 +41,7 @@ void nsc_gpio_dump(struct nsc_gpio_ops *amp, unsigned index)
41ssize_t nsc_gpio_write(struct file *file, const char __user *data, 41ssize_t nsc_gpio_write(struct file *file, const char __user *data,
42 size_t len, loff_t *ppos) 42 size_t len, loff_t *ppos)
43{ 43{
44 unsigned m = iminor(file->f_path.dentry->d_inode); 44 unsigned m = iminor(file_inode(file));
45 struct nsc_gpio_ops *amp = file->private_data; 45 struct nsc_gpio_ops *amp = file->private_data;
46 struct device *dev = amp->dev; 46 struct device *dev = amp->dev;
47 size_t i; 47 size_t i;
@@ -104,7 +104,7 @@ ssize_t nsc_gpio_write(struct file *file, const char __user *data,
104ssize_t nsc_gpio_read(struct file *file, char __user * buf, 104ssize_t nsc_gpio_read(struct file *file, char __user * buf,
105 size_t len, loff_t * ppos) 105 size_t len, loff_t * ppos)
106{ 106{
107 unsigned m = iminor(file->f_path.dentry->d_inode); 107 unsigned m = iminor(file_inode(file));
108 int value; 108 int value;
109 struct nsc_gpio_ops *amp = file->private_data; 109 struct nsc_gpio_ops *amp = file->private_data;
110 110
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index a7584860e9a7..c115217c79ae 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -1400,7 +1400,7 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
1400{ 1400{
1401 struct cm4000_dev *dev = filp->private_data; 1401 struct cm4000_dev *dev = filp->private_data;
1402 unsigned int iobase = dev->p_dev->resource[0]->start; 1402 unsigned int iobase = dev->p_dev->resource[0]->start;
1403 struct inode *inode = filp->f_path.dentry->d_inode; 1403 struct inode *inode = file_inode(filp);
1404 struct pcmcia_device *link; 1404 struct pcmcia_device *link;
1405 int size; 1405 int size;
1406 int rc; 1406 int rc;
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 1cd49241e60e..ae0b42b66e55 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -107,7 +107,7 @@ static inline void pp_enable_irq (struct pp_struct *pp)
107static ssize_t pp_read (struct file * file, char __user * buf, size_t count, 107static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
108 loff_t * ppos) 108 loff_t * ppos)
109{ 109{
110 unsigned int minor = iminor(file->f_path.dentry->d_inode); 110 unsigned int minor = iminor(file_inode(file));
111 struct pp_struct *pp = file->private_data; 111 struct pp_struct *pp = file->private_data;
112 char * kbuffer; 112 char * kbuffer;
113 ssize_t bytes_read = 0; 113 ssize_t bytes_read = 0;
@@ -189,7 +189,7 @@ static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
189static ssize_t pp_write (struct file * file, const char __user * buf, 189static ssize_t pp_write (struct file * file, const char __user * buf,
190 size_t count, loff_t * ppos) 190 size_t count, loff_t * ppos)
191{ 191{
192 unsigned int minor = iminor(file->f_path.dentry->d_inode); 192 unsigned int minor = iminor(file_inode(file));
193 struct pp_struct *pp = file->private_data; 193 struct pp_struct *pp = file->private_data;
194 char * kbuffer; 194 char * kbuffer;
195 ssize_t bytes_written = 0; 195 ssize_t bytes_written = 0;
@@ -324,7 +324,7 @@ static enum ieee1284_phase init_phase (int mode)
324 324
325static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 325static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
326{ 326{
327 unsigned int minor = iminor(file->f_path.dentry->d_inode); 327 unsigned int minor = iminor(file_inode(file));
328 struct pp_struct *pp = file->private_data; 328 struct pp_struct *pp = file->private_data;
329 struct parport * port; 329 struct parport * port;
330 void __user *argp = (void __user *)arg; 330 void __user *argp = (void __user *)arg;
diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c
index 588063ac9517..8cafa9ccd43f 100644
--- a/drivers/char/ps3flash.c
+++ b/drivers/char/ps3flash.c
@@ -312,7 +312,7 @@ static int ps3flash_flush(struct file *file, fl_owner_t id)
312 312
313static int ps3flash_fsync(struct file *file, loff_t start, loff_t end, int datasync) 313static int ps3flash_fsync(struct file *file, loff_t start, loff_t end, int datasync)
314{ 314{
315 struct inode *inode = file->f_path.dentry->d_inode; 315 struct inode *inode = file_inode(file);
316 int err; 316 int err;
317 mutex_lock(&inode->i_mutex); 317 mutex_lock(&inode->i_mutex);
318 err = ps3flash_writeback(ps3flash_dev); 318 err = ps3flash_writeback(ps3flash_dev);
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index 54a3a6d09819..f3223aac4df1 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -80,7 +80,7 @@ static int raw_open(struct inode *inode, struct file *filp)
80 filp->f_flags |= O_DIRECT; 80 filp->f_flags |= O_DIRECT;
81 filp->f_mapping = bdev->bd_inode->i_mapping; 81 filp->f_mapping = bdev->bd_inode->i_mapping;
82 if (++raw_devices[minor].inuse == 1) 82 if (++raw_devices[minor].inuse == 1)
83 filp->f_path.dentry->d_inode->i_mapping = 83 file_inode(filp)->i_mapping =
84 bdev->bd_inode->i_mapping; 84 bdev->bd_inode->i_mapping;
85 filp->private_data = bdev; 85 filp->private_data = bdev;
86 mutex_unlock(&raw_mutex); 86 mutex_unlock(&raw_mutex);
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index d780295a1473..8450e178b819 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -938,7 +938,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
938 } 938 }
939 939
940 if (ret > 0) { 940 if (ret > 0) {
941 struct inode *inode = file->f_path.dentry->d_inode; 941 struct inode *inode = file_inode(file);
942 inode->i_atime = current_fs_time(inode->i_sb); 942 inode->i_atime = current_fs_time(inode->i_sb);
943 } 943 }
944 944
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c
index 34c63f85104d..47b9fdfcf083 100644
--- a/drivers/char/tb0219.c
+++ b/drivers/char/tb0219.c
@@ -164,7 +164,7 @@ static ssize_t tanbac_tb0219_read(struct file *file, char __user *buf, size_t le
164 unsigned int minor; 164 unsigned int minor;
165 char value; 165 char value;
166 166
167 minor = iminor(file->f_path.dentry->d_inode); 167 minor = iminor(file_inode(file));
168 switch (minor) { 168 switch (minor) {
169 case 0: 169 case 0:
170 value = get_led(); 170 value = get_led();
@@ -200,7 +200,7 @@ static ssize_t tanbac_tb0219_write(struct file *file, const char __user *data,
200 int retval = 0; 200 int retval = 0;
201 char c; 201 char c;
202 202
203 minor = iminor(file->f_path.dentry->d_inode); 203 minor = iminor(file_inode(file));
204 switch (minor) { 204 switch (minor) {
205 case 0: 205 case 0:
206 type = TYPE_LED; 206 type = TYPE_LED;