led.c (dca3a783400a18e2bf4503b1d4a85c4d0ca1a7e4) | led.c (d9dda78bad879595d8c4220a067fc029d6484a16) |
---|---|
1/* 2 * Chassis LCD/LED driver for HP-PARISC workstations 3 * 4 * (c) Copyright 2000 Red Hat Software 5 * (c) Copyright 2000 Helge Deller <hdeller@redhat.com> 6 * (c) Copyright 2001-2009 Helge Deller <deller@gmx.de> 7 * (c) Copyright 2001 Randolph Chung <tausq@debian.org> 8 * --- 158 unchanged lines hidden (view full) --- 167 default: 168 return 0; 169 } 170 return 0; 171} 172 173static int led_proc_open(struct inode *inode, struct file *file) 174{ | 1/* 2 * Chassis LCD/LED driver for HP-PARISC workstations 3 * 4 * (c) Copyright 2000 Red Hat Software 5 * (c) Copyright 2000 Helge Deller <hdeller@redhat.com> 6 * (c) Copyright 2001-2009 Helge Deller <deller@gmx.de> 7 * (c) Copyright 2001 Randolph Chung <tausq@debian.org> 8 * --- 158 unchanged lines hidden (view full) --- 167 default: 168 return 0; 169 } 170 return 0; 171} 172 173static int led_proc_open(struct inode *inode, struct file *file) 174{ |
175 return single_open(file, led_proc_show, PDE(inode)->data); | 175 return single_open(file, led_proc_show, PDE_DATA(inode)); |
176} 177 178 179static ssize_t led_proc_write(struct file *file, const char *buf, 180 size_t count, loff_t *pos) 181{ | 176} 177 178 179static ssize_t led_proc_write(struct file *file, const char *buf, 180 size_t count, loff_t *pos) 181{ |
182 void *data = PDE(file_inode(file))->data; | 182 void *data = PDE_DATA(file_inode(file)); |
183 char *cur, lbuf[32]; 184 int d; 185 186 if (!capable(CAP_SYS_ADMIN)) 187 return -EACCES; 188 189 if (count >= sizeof(lbuf)) 190 count = sizeof(lbuf)-1; --- 589 unchanged lines hidden --- | 183 char *cur, lbuf[32]; 184 int d; 185 186 if (!capable(CAP_SYS_ADMIN)) 187 return -EACCES; 188 189 if (count >= sizeof(lbuf)) 190 count = sizeof(lbuf)-1; --- 589 unchanged lines hidden --- |