Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

simple_open: automatically convert to simple_open()

Many users of debugfs copy the implementation of default_open() when
they want to support a custom read/write function op. This leads to a
proliferation of the default_open() implementation across the entire
tree.

Now that the common implementation has been consolidated into libfs we
can replace all the users of this function with simple_open().

This replacement was done with the following semantic patch:

<smpl>
@ open @
identifier open_f != simple_open;
identifier i, f;
@@
-int open_f(struct inode *i, struct file *f)
-{
(
-if (i->i_private)
-f->private_data = i->i_private;
|
-f->private_data = i->i_private;
)
-return 0;
-}

@ has_open depends on open @
identifier fops;
identifier open.open_f;
@@
struct file_operations fops = {
...
-.open = open_f,
+.open = simple_open,
...
};
</smpl>

[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Stephen Boyd and committed by
Linus Torvalds
234e3405 9b3ae64b

+176 -572
+1 -7
arch/arm/mach-msm/smd_debug.c
··· 203 203 return simple_read_from_buffer(buf, count, ppos, debug_buffer, bsize); 204 204 } 205 205 206 - static int debug_open(struct inode *inode, struct file *file) 207 - { 208 - file->private_data = inode->i_private; 209 - return 0; 210 - } 211 - 212 206 static const struct file_operations debug_ops = { 213 207 .read = debug_read, 214 - .open = debug_open, 208 + .open = simple_open, 215 209 .llseek = default_llseek, 216 210 }; 217 211
+1 -8
arch/x86/kernel/kdebugfs.c
··· 68 68 return count; 69 69 } 70 70 71 - static int setup_data_open(struct inode *inode, struct file *file) 72 - { 73 - file->private_data = inode->i_private; 74 - 75 - return 0; 76 - } 77 - 78 71 static const struct file_operations fops_setup_data = { 79 72 .read = setup_data_read, 80 - .open = setup_data_open, 73 + .open = simple_open, 81 74 .llseek = default_llseek, 82 75 }; 83 76
+1 -7
drivers/acpi/ec_sys.c
··· 27 27 28 28 static struct dentry *acpi_ec_debugfs_dir; 29 29 30 - static int acpi_ec_open_io(struct inode *i, struct file *f) 31 - { 32 - f->private_data = i->i_private; 33 - return 0; 34 - } 35 - 36 30 static ssize_t acpi_ec_read_io(struct file *f, char __user *buf, 37 31 size_t count, loff_t *off) 38 32 { ··· 89 95 90 96 static const struct file_operations acpi_ec_io_ops = { 91 97 .owner = THIS_MODULE, 92 - .open = acpi_ec_open_io, 98 + .open = simple_open, 93 99 .read = acpi_ec_read_io, 94 100 .write = acpi_ec_write_io, 95 101 .llseek = default_llseek,
+3 -9
drivers/base/regmap/regmap-debugfs.c
··· 27 27 return strlen(buf); 28 28 } 29 29 30 - static int regmap_open_file(struct inode *inode, struct file *file) 31 - { 32 - file->private_data = inode->i_private; 33 - return 0; 34 - } 35 - 36 30 static ssize_t regmap_name_read_file(struct file *file, 37 31 char __user *user_buf, size_t count, 38 32 loff_t *ppos) ··· 51 57 } 52 58 53 59 static const struct file_operations regmap_name_fops = { 54 - .open = regmap_open_file, 60 + .open = simple_open, 55 61 .read = regmap_name_read_file, 56 62 .llseek = default_llseek, 57 63 }; ··· 168 174 #endif 169 175 170 176 static const struct file_operations regmap_map_fops = { 171 - .open = regmap_open_file, 177 + .open = simple_open, 172 178 .read = regmap_map_read_file, 173 179 .write = regmap_map_write_file, 174 180 .llseek = default_llseek, ··· 237 243 } 238 244 239 245 static const struct file_operations regmap_access_fops = { 240 - .open = regmap_open_file, 246 + .open = simple_open, 241 247 .read = regmap_access_read_file, 242 248 .llseek = default_llseek, 243 249 };
+10 -16
drivers/bluetooth/btmrvl_debugfs.c
··· 45 45 struct dentry *txdnldready; 46 46 }; 47 47 48 - static int btmrvl_open_generic(struct inode *inode, struct file *file) 49 - { 50 - file->private_data = inode->i_private; 51 - return 0; 52 - } 53 - 54 48 static ssize_t btmrvl_hscfgcmd_write(struct file *file, 55 49 const char __user *ubuf, size_t count, loff_t *ppos) 56 50 { ··· 87 93 static const struct file_operations btmrvl_hscfgcmd_fops = { 88 94 .read = btmrvl_hscfgcmd_read, 89 95 .write = btmrvl_hscfgcmd_write, 90 - .open = btmrvl_open_generic, 96 + .open = simple_open, 91 97 .llseek = default_llseek, 92 98 }; 93 99 ··· 128 134 static const struct file_operations btmrvl_psmode_fops = { 129 135 .read = btmrvl_psmode_read, 130 136 .write = btmrvl_psmode_write, 131 - .open = btmrvl_open_generic, 137 + .open = simple_open, 132 138 .llseek = default_llseek, 133 139 }; 134 140 ··· 174 180 static const struct file_operations btmrvl_pscmd_fops = { 175 181 .read = btmrvl_pscmd_read, 176 182 .write = btmrvl_pscmd_write, 177 - .open = btmrvl_open_generic, 183 + .open = simple_open, 178 184 .llseek = default_llseek, 179 185 }; 180 186 ··· 215 221 static const struct file_operations btmrvl_gpiogap_fops = { 216 222 .read = btmrvl_gpiogap_read, 217 223 .write = btmrvl_gpiogap_write, 218 - .open = btmrvl_open_generic, 224 + .open = simple_open, 219 225 .llseek = default_llseek, 220 226 }; 221 227 ··· 259 265 static const struct file_operations btmrvl_hscmd_fops = { 260 266 .read = btmrvl_hscmd_read, 261 267 .write = btmrvl_hscmd_write, 262 - .open = btmrvl_open_generic, 268 + .open = simple_open, 263 269 .llseek = default_llseek, 264 270 }; 265 271 ··· 299 305 static const struct file_operations btmrvl_hsmode_fops = { 300 306 .read = btmrvl_hsmode_read, 301 307 .write = btmrvl_hsmode_write, 302 - .open = btmrvl_open_generic, 308 + .open = simple_open, 303 309 .llseek = default_llseek, 304 310 }; 305 311 ··· 317 323 318 324 static const struct file_operations btmrvl_curpsmode_fops = { 319 325 .read = btmrvl_curpsmode_read, 320 - .open = btmrvl_open_generic, 326 + .open = simple_open, 321 327 .llseek = default_llseek, 322 328 }; 323 329 ··· 335 341 336 342 static const struct file_operations btmrvl_psstate_fops = { 337 343 .read = btmrvl_psstate_read, 338 - .open = btmrvl_open_generic, 344 + .open = simple_open, 339 345 .llseek = default_llseek, 340 346 }; 341 347 ··· 353 359 354 360 static const struct file_operations btmrvl_hsstate_fops = { 355 361 .read = btmrvl_hsstate_read, 356 - .open = btmrvl_open_generic, 362 + .open = simple_open, 357 363 .llseek = default_llseek, 358 364 }; 359 365 ··· 372 378 373 379 static const struct file_operations btmrvl_txdnldready_fops = { 374 380 .read = btmrvl_txdnldready_read, 375 - .open = btmrvl_open_generic, 381 + .open = simple_open, 376 382 .llseek = default_llseek, 377 383 }; 378 384
+1 -7
drivers/char/virtio_console.c
··· 1038 1038 .attrs = port_sysfs_entries, 1039 1039 }; 1040 1040 1041 - static int debugfs_open(struct inode *inode, struct file *filp) 1042 - { 1043 - filp->private_data = inode->i_private; 1044 - return 0; 1045 - } 1046 - 1047 1041 static ssize_t debugfs_read(struct file *filp, char __user *ubuf, 1048 1042 size_t count, loff_t *offp) 1049 1043 { ··· 1081 1087 1082 1088 static const struct file_operations port_debugfs_ops = { 1083 1089 .owner = THIS_MODULE, 1084 - .open = debugfs_open, 1090 + .open = simple_open, 1085 1091 .read = debugfs_read, 1086 1092 }; 1087 1093
+1 -8
drivers/dma/coh901318.c
··· 104 104 static struct coh901318_base *debugfs_dma_base; 105 105 static struct dentry *dma_dentry; 106 106 107 - static int coh901318_debugfs_open(struct inode *inode, struct file *file) 108 - { 109 - 110 - file->private_data = inode->i_private; 111 - return 0; 112 - } 113 - 114 107 static int coh901318_debugfs_read(struct file *file, char __user *buf, 115 108 size_t count, loff_t *f_pos) 116 109 { ··· 151 158 152 159 static const struct file_operations coh901318_debugfs_status_operations = { 153 160 .owner = THIS_MODULE, 154 - .open = coh901318_debugfs_open, 161 + .open = simple_open, 155 162 .read = coh901318_debugfs_read, 156 163 .llseek = default_llseek, 157 164 };
+3 -11
drivers/gpu/drm/i915/i915_debugfs.c
··· 1502 1502 return 0; 1503 1503 } 1504 1504 1505 - static int 1506 - i915_debugfs_common_open(struct inode *inode, 1507 - struct file *filp) 1508 - { 1509 - filp->private_data = inode->i_private; 1510 - return 0; 1511 - } 1512 - 1513 1505 static ssize_t 1514 1506 i915_wedged_read(struct file *filp, 1515 1507 char __user *ubuf, ··· 1552 1560 1553 1561 static const struct file_operations i915_wedged_fops = { 1554 1562 .owner = THIS_MODULE, 1555 - .open = i915_debugfs_common_open, 1563 + .open = simple_open, 1556 1564 .read = i915_wedged_read, 1557 1565 .write = i915_wedged_write, 1558 1566 .llseek = default_llseek, ··· 1614 1622 1615 1623 static const struct file_operations i915_max_freq_fops = { 1616 1624 .owner = THIS_MODULE, 1617 - .open = i915_debugfs_common_open, 1625 + .open = simple_open, 1618 1626 .read = i915_max_freq_read, 1619 1627 .write = i915_max_freq_write, 1620 1628 .llseek = default_llseek, ··· 1685 1693 1686 1694 static const struct file_operations i915_cache_sharing_fops = { 1687 1695 .owner = THIS_MODULE, 1688 - .open = i915_debugfs_common_open, 1696 + .open = simple_open, 1689 1697 .read = i915_cache_sharing_read, 1690 1698 .write = i915_cache_sharing_write, 1691 1699 .llseek = default_llseek,
+2 -14
drivers/hid/hid-picolcd.c
··· 1525 1525 /* 1526 1526 * The "eeprom" file 1527 1527 */ 1528 - static int picolcd_debug_eeprom_open(struct inode *i, struct file *f) 1529 - { 1530 - f->private_data = i->i_private; 1531 - return 0; 1532 - } 1533 - 1534 1528 static ssize_t picolcd_debug_eeprom_read(struct file *f, char __user *u, 1535 1529 size_t s, loff_t *off) 1536 1530 { ··· 1612 1618 */ 1613 1619 static const struct file_operations picolcd_debug_eeprom_fops = { 1614 1620 .owner = THIS_MODULE, 1615 - .open = picolcd_debug_eeprom_open, 1621 + .open = simple_open, 1616 1622 .read = picolcd_debug_eeprom_read, 1617 1623 .write = picolcd_debug_eeprom_write, 1618 1624 .llseek = generic_file_llseek, ··· 1621 1627 /* 1622 1628 * The "flash" file 1623 1629 */ 1624 - static int picolcd_debug_flash_open(struct inode *i, struct file *f) 1625 - { 1626 - f->private_data = i->i_private; 1627 - return 0; 1628 - } 1629 - 1630 1630 /* record a flash address to buf (bounds check to be done by caller) */ 1631 1631 static int _picolcd_flash_setaddr(struct picolcd_data *data, u8 *buf, long off) 1632 1632 { ··· 1805 1817 */ 1806 1818 static const struct file_operations picolcd_debug_flash_fops = { 1807 1819 .owner = THIS_MODULE, 1808 - .open = picolcd_debug_flash_open, 1820 + .open = simple_open, 1809 1821 .read = picolcd_debug_flash_read, 1810 1822 .write = picolcd_debug_flash_write, 1811 1823 .llseek = generic_file_llseek,
+1 -7
drivers/hid/hid-wiimote-debug.c
··· 23 23 struct dentry *drm; 24 24 }; 25 25 26 - static int wiidebug_eeprom_open(struct inode *i, struct file *f) 27 - { 28 - f->private_data = i->i_private; 29 - return 0; 30 - } 31 - 32 26 static ssize_t wiidebug_eeprom_read(struct file *f, char __user *u, size_t s, 33 27 loff_t *off) 34 28 { ··· 77 83 78 84 static const struct file_operations wiidebug_eeprom_fops = { 79 85 .owner = THIS_MODULE, 80 - .open = wiidebug_eeprom_open, 86 + .open = simple_open, 81 87 .read = wiidebug_eeprom_read, 82 88 .llseek = generic_file_llseek, 83 89 };
+1 -7
drivers/idle/i7300_idle.c
··· 516 516 517 517 MODULE_DEVICE_TABLE(pci, pci_tbl); 518 518 519 - int stats_open_generic(struct inode *inode, struct file *fp) 520 - { 521 - fp->private_data = inode->i_private; 522 - return 0; 523 - } 524 - 525 519 static ssize_t stats_read_ul(struct file *fp, char __user *ubuf, size_t count, 526 520 loff_t *off) 527 521 { ··· 528 534 } 529 535 530 536 static const struct file_operations idle_fops = { 531 - .open = stats_open_generic, 537 + .open = simple_open, 532 538 .read = stats_read_ul, 533 539 .llseek = default_llseek, 534 540 };
+2 -8
drivers/iommu/omap-iommu-debug.c
··· 323 323 return count; 324 324 } 325 325 326 - static int debug_open_generic(struct inode *inode, struct file *file) 327 - { 328 - file->private_data = inode->i_private; 329 - return 0; 330 - } 331 - 332 326 #define DEBUG_FOPS(name) \ 333 327 static const struct file_operations debug_##name##_fops = { \ 334 - .open = debug_open_generic, \ 328 + .open = simple_open, \ 335 329 .read = debug_read_##name, \ 336 330 .write = debug_write_##name, \ 337 331 .llseek = generic_file_llseek, \ ··· 333 339 334 340 #define DEBUG_FOPS_RO(name) \ 335 341 static const struct file_operations debug_##name##_fops = { \ 336 - .open = debug_open_generic, \ 342 + .open = simple_open, \ 337 343 .read = debug_read_##name, \ 338 344 .llseek = generic_file_llseek, \ 339 345 };
+1 -8
drivers/mfd/aat2870-core.c
··· 262 262 return count; 263 263 } 264 264 265 - static int aat2870_reg_open_file(struct inode *inode, struct file *file) 266 - { 267 - file->private_data = inode->i_private; 268 - 269 - return 0; 270 - } 271 - 272 265 static ssize_t aat2870_reg_read_file(struct file *file, char __user *user_buf, 273 266 size_t count, loff_t *ppos) 274 267 { ··· 323 330 } 324 331 325 332 static const struct file_operations aat2870_reg_fops = { 326 - .open = aat2870_reg_open_file, 333 + .open = simple_open, 327 334 .read = aat2870_reg_read_file, 328 335 .write = aat2870_reg_write_file, 329 336 };
+1 -7
drivers/mfd/ab3100-core.c
··· 483 483 bool mode; 484 484 }; 485 485 486 - static int ab3100_get_set_reg_open_file(struct inode *inode, struct file *file) 487 - { 488 - file->private_data = inode->i_private; 489 - return 0; 490 - } 491 - 492 486 static ssize_t ab3100_get_set_reg(struct file *file, 493 487 const char __user *user_buf, 494 488 size_t count, loff_t *ppos) ··· 577 583 } 578 584 579 585 static const struct file_operations ab3100_get_set_reg_fops = { 580 - .open = ab3100_get_set_reg_open_file, 586 + .open = simple_open, 581 587 .write = ab3100_get_set_reg, 582 588 .llseek = noop_llseek, 583 589 };
+1 -7
drivers/misc/ibmasm/ibmasmfs.c
··· 500 500 return 1; 501 501 } 502 502 503 - static int remote_settings_file_open(struct inode *inode, struct file *file) 504 - { 505 - file->private_data = inode->i_private; 506 - return 0; 507 - } 508 - 509 503 static int remote_settings_file_close(struct inode *inode, struct file *file) 510 504 { 511 505 return 0; ··· 594 600 }; 595 601 596 602 static const struct file_operations remote_settings_fops = { 597 - .open = remote_settings_file_open, 603 + .open = simple_open, 598 604 .release = remote_settings_file_close, 599 605 .read = remote_settings_file_read, 600 606 .write = remote_settings_file_write,
+1 -9
drivers/mtd/ubi/debug.c
··· 386 386 return count; 387 387 } 388 388 389 - static int default_open(struct inode *inode, struct file *file) 390 - { 391 - if (inode->i_private) 392 - file->private_data = inode->i_private; 393 - 394 - return 0; 395 - } 396 - 397 389 /* File operations for all UBI debugfs files */ 398 390 static const struct file_operations dfs_fops = { 399 391 .read = dfs_file_read, 400 392 .write = dfs_file_write, 401 - .open = default_open, 393 + .open = simple_open, 402 394 .llseek = no_llseek, 403 395 .owner = THIS_MODULE, 404 396 };
+2 -8
drivers/net/caif/caif_spi.c
··· 127 127 debugfs_remove(cfspi->dbgfs_dir); 128 128 } 129 129 130 - static int dbgfs_open(struct inode *inode, struct file *file) 131 - { 132 - file->private_data = inode->i_private; 133 - return 0; 134 - } 135 - 136 130 static ssize_t dbgfs_state(struct file *file, char __user *user_buf, 137 131 size_t count, loff_t *ppos) 138 132 { ··· 237 243 } 238 244 239 245 static const struct file_operations dbgfs_state_fops = { 240 - .open = dbgfs_open, 246 + .open = simple_open, 241 247 .read = dbgfs_state, 242 248 .owner = THIS_MODULE 243 249 }; 244 250 245 251 static const struct file_operations dbgfs_frame_fops = { 246 - .open = dbgfs_open, 252 + .open = simple_open, 247 253 .read = dbgfs_frame, 248 254 .owner = THIS_MODULE 249 255 };
+1 -8
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
··· 2000 2000 /* 2001 2001 * debugfs support 2002 2002 */ 2003 - 2004 - static int mem_open(struct inode *inode, struct file *file) 2005 - { 2006 - file->private_data = inode->i_private; 2007 - return 0; 2008 - } 2009 - 2010 2003 static ssize_t mem_read(struct file *file, char __user *buf, size_t count, 2011 2004 loff_t *ppos) 2012 2005 { ··· 2043 2050 2044 2051 static const struct file_operations mem_debugfs_fops = { 2045 2052 .owner = THIS_MODULE, 2046 - .open = mem_open, 2053 + .open = simple_open, 2047 2054 .read = mem_read, 2048 2055 .llseek = default_llseek, 2049 2056 };
+2 -13
drivers/net/wimax/i2400m/debugfs.c
··· 53 53 &fops_netdev_queue_stopped); 54 54 } 55 55 56 - 57 - /* 58 - * inode->i_private has the @data argument to debugfs_create_file() 59 - */ 60 - static 61 - int i2400m_stats_open(struct inode *inode, struct file *filp) 62 - { 63 - filp->private_data = inode->i_private; 64 - return 0; 65 - } 66 - 67 56 /* 68 57 * We don't allow partial reads of this file, as then the reader would 69 58 * get weirdly confused data as it is updated. ··· 106 117 static 107 118 const struct file_operations i2400m_rx_stats_fops = { 108 119 .owner = THIS_MODULE, 109 - .open = i2400m_stats_open, 120 + .open = simple_open, 110 121 .read = i2400m_rx_stats_read, 111 122 .write = i2400m_rx_stats_write, 112 123 .llseek = default_llseek, ··· 159 170 static 160 171 const struct file_operations i2400m_tx_stats_fops = { 161 172 .owner = THIS_MODULE, 162 - .open = i2400m_stats_open, 173 + .open = simple_open, 163 174 .read = i2400m_tx_stats_read, 164 175 .write = i2400m_tx_stats_write, 165 176 .llseek = default_llseek,
+8 -15
drivers/net/wireless/ath/ath5k/debug.c
··· 71 71 module_param_named(debug, ath5k_debug, uint, 0); 72 72 73 73 74 - static int ath5k_debugfs_open(struct inode *inode, struct file *file) 75 - { 76 - file->private_data = inode->i_private; 77 - return 0; 78 - } 79 - 80 - 81 74 /* debugfs: registers */ 82 75 83 76 struct reg { ··· 258 265 static const struct file_operations fops_beacon = { 259 266 .read = read_file_beacon, 260 267 .write = write_file_beacon, 261 - .open = ath5k_debugfs_open, 268 + .open = simple_open, 262 269 .owner = THIS_MODULE, 263 270 .llseek = default_llseek, 264 271 }; ··· 278 285 279 286 static const struct file_operations fops_reset = { 280 287 .write = write_file_reset, 281 - .open = ath5k_debugfs_open, 288 + .open = simple_open, 282 289 .owner = THIS_MODULE, 283 290 .llseek = noop_llseek, 284 291 }; ··· 358 365 static const struct file_operations fops_debug = { 359 366 .read = read_file_debug, 360 367 .write = write_file_debug, 361 - .open = ath5k_debugfs_open, 368 + .open = simple_open, 362 369 .owner = THIS_MODULE, 363 370 .llseek = default_llseek, 364 371 }; ··· 470 477 static const struct file_operations fops_antenna = { 471 478 .read = read_file_antenna, 472 479 .write = write_file_antenna, 473 - .open = ath5k_debugfs_open, 480 + .open = simple_open, 474 481 .owner = THIS_MODULE, 475 482 .llseek = default_llseek, 476 483 }; ··· 525 532 526 533 static const struct file_operations fops_misc = { 527 534 .read = read_file_misc, 528 - .open = ath5k_debugfs_open, 535 + .open = simple_open, 529 536 .owner = THIS_MODULE, 530 537 }; 531 538 ··· 640 647 static const struct file_operations fops_frameerrors = { 641 648 .read = read_file_frameerrors, 642 649 .write = write_file_frameerrors, 643 - .open = ath5k_debugfs_open, 650 + .open = simple_open, 644 651 .owner = THIS_MODULE, 645 652 .llseek = default_llseek, 646 653 }; ··· 803 810 static const struct file_operations fops_ani = { 804 811 .read = read_file_ani, 805 812 .write = write_file_ani, 806 - .open = ath5k_debugfs_open, 813 + .open = simple_open, 807 814 .owner = THIS_MODULE, 808 815 .llseek = default_llseek, 809 816 }; ··· 874 881 static const struct file_operations fops_queue = { 875 882 .read = read_file_queue, 876 883 .write = write_file_queue, 877 - .open = ath5k_debugfs_open, 884 + .open = simple_open, 878 885 .owner = THIS_MODULE, 879 886 .llseek = default_llseek, 880 887 };
+18 -24
drivers/net/wireless/ath/ath6kl/debug.c
··· 217 217 target->credit_info->cur_free_credits); 218 218 } 219 219 220 - static int ath6kl_debugfs_open(struct inode *inode, struct file *file) 221 - { 222 - file->private_data = inode->i_private; 223 - return 0; 224 - } 225 - 226 220 void ath6kl_debug_war(struct ath6kl *ar, enum ath6kl_war war) 227 221 { 228 222 switch (war) { ··· 257 263 258 264 static const struct file_operations fops_war_stats = { 259 265 .read = read_file_war_stats, 260 - .open = ath6kl_debugfs_open, 266 + .open = simple_open, 261 267 .owner = THIS_MODULE, 262 268 .llseek = default_llseek, 263 269 }; ··· 482 488 } 483 489 484 490 static const struct file_operations fops_fwlog_mask = { 485 - .open = ath6kl_debugfs_open, 491 + .open = simple_open, 486 492 .read = ath6kl_fwlog_mask_read, 487 493 .write = ath6kl_fwlog_mask_write, 488 494 .owner = THIS_MODULE, ··· 628 634 629 635 static const struct file_operations fops_tgt_stats = { 630 636 .read = read_file_tgt_stats, 631 - .open = ath6kl_debugfs_open, 637 + .open = simple_open, 632 638 .owner = THIS_MODULE, 633 639 .llseek = default_llseek, 634 640 }; ··· 693 699 694 700 static const struct file_operations fops_credit_dist_stats = { 695 701 .read = read_file_credit_dist_stats, 696 - .open = ath6kl_debugfs_open, 702 + .open = simple_open, 697 703 .owner = THIS_MODULE, 698 704 .llseek = default_llseek, 699 705 }; ··· 796 802 } 797 803 798 804 static const struct file_operations fops_endpoint_stats = { 799 - .open = ath6kl_debugfs_open, 805 + .open = simple_open, 800 806 .read = ath6kl_endpoint_stats_read, 801 807 .write = ath6kl_endpoint_stats_write, 802 808 .owner = THIS_MODULE, ··· 869 875 static const struct file_operations fops_diag_reg_read = { 870 876 .read = ath6kl_regread_read, 871 877 .write = ath6kl_regread_write, 872 - .open = ath6kl_debugfs_open, 878 + .open = simple_open, 873 879 .owner = THIS_MODULE, 874 880 .llseek = default_llseek, 875 881 }; ··· 993 999 static const struct file_operations fops_lrssi_roam_threshold = { 994 1000 .read = ath6kl_lrssi_roam_read, 995 1001 .write = ath6kl_lrssi_roam_write, 996 - .open = ath6kl_debugfs_open, 1002 + .open = simple_open, 997 1003 .owner = THIS_MODULE, 998 1004 .llseek = default_llseek, 999 1005 }; ··· 1055 1061 static const struct file_operations fops_diag_reg_write = { 1056 1062 .read = ath6kl_regwrite_read, 1057 1063 .write = ath6kl_regwrite_write, 1058 - .open = ath6kl_debugfs_open, 1064 + .open = simple_open, 1059 1065 .owner = THIS_MODULE, 1060 1066 .llseek = default_llseek, 1061 1067 }; ··· 1160 1166 1161 1167 static const struct file_operations fops_roam_table = { 1162 1168 .read = ath6kl_roam_table_read, 1163 - .open = ath6kl_debugfs_open, 1169 + .open = simple_open, 1164 1170 .owner = THIS_MODULE, 1165 1171 .llseek = default_llseek, 1166 1172 }; ··· 1198 1204 1199 1205 static const struct file_operations fops_force_roam = { 1200 1206 .write = ath6kl_force_roam_write, 1201 - .open = ath6kl_debugfs_open, 1207 + .open = simple_open, 1202 1208 .owner = THIS_MODULE, 1203 1209 .llseek = default_llseek, 1204 1210 }; ··· 1238 1244 1239 1245 static const struct file_operations fops_roam_mode = { 1240 1246 .write = ath6kl_roam_mode_write, 1241 - .open = ath6kl_debugfs_open, 1247 + .open = simple_open, 1242 1248 .owner = THIS_MODULE, 1243 1249 .llseek = default_llseek, 1244 1250 }; ··· 1280 1286 } 1281 1287 1282 1288 static const struct file_operations fops_keepalive = { 1283 - .open = ath6kl_debugfs_open, 1289 + .open = simple_open, 1284 1290 .read = ath6kl_keepalive_read, 1285 1291 .write = ath6kl_keepalive_write, 1286 1292 .owner = THIS_MODULE, ··· 1325 1331 } 1326 1332 1327 1333 static const struct file_operations fops_disconnect_timeout = { 1328 - .open = ath6kl_debugfs_open, 1334 + .open = simple_open, 1329 1335 .read = ath6kl_disconnect_timeout_read, 1330 1336 .write = ath6kl_disconnect_timeout_write, 1331 1337 .owner = THIS_MODULE, ··· 1506 1512 1507 1513 static const struct file_operations fops_create_qos = { 1508 1514 .write = ath6kl_create_qos_write, 1509 - .open = ath6kl_debugfs_open, 1515 + .open = simple_open, 1510 1516 .owner = THIS_MODULE, 1511 1517 .llseek = default_llseek, 1512 1518 }; ··· 1554 1560 1555 1561 static const struct file_operations fops_delete_qos = { 1556 1562 .write = ath6kl_delete_qos_write, 1557 - .open = ath6kl_debugfs_open, 1563 + .open = simple_open, 1558 1564 .owner = THIS_MODULE, 1559 1565 .llseek = default_llseek, 1560 1566 }; ··· 1587 1593 1588 1594 static const struct file_operations fops_bgscan_int = { 1589 1595 .write = ath6kl_bgscan_int_write, 1590 - .open = ath6kl_debugfs_open, 1596 + .open = simple_open, 1591 1597 .owner = THIS_MODULE, 1592 1598 .llseek = default_llseek, 1593 1599 }; ··· 1645 1651 static const struct file_operations fops_listen_int = { 1646 1652 .read = ath6kl_listen_int_read, 1647 1653 .write = ath6kl_listen_int_write, 1648 - .open = ath6kl_debugfs_open, 1654 + .open = simple_open, 1649 1655 .owner = THIS_MODULE, 1650 1656 .llseek = default_llseek, 1651 1657 }; ··· 1705 1711 1706 1712 static const struct file_operations fops_power_params = { 1707 1713 .write = ath6kl_power_params_write, 1708 - .open = ath6kl_debugfs_open, 1714 + .open = simple_open, 1709 1715 .owner = THIS_MODULE, 1710 1716 .llseek = default_llseek, 1711 1717 };
+16 -21
drivers/net/wireless/ath/ath9k/debug.c
··· 26 26 #define REG_READ_D(_ah, _reg) \ 27 27 ath9k_hw_common(_ah)->ops->read((_ah), (_reg)) 28 28 29 - static int ath9k_debugfs_open(struct inode *inode, struct file *file) 30 - { 31 - file->private_data = inode->i_private; 32 - return 0; 33 - } 34 29 35 30 static ssize_t ath9k_debugfs_read_buf(struct file *file, char __user *user_buf, 36 31 size_t count, loff_t *ppos) ··· 78 83 static const struct file_operations fops_debug = { 79 84 .read = read_file_debug, 80 85 .write = write_file_debug, 81 - .open = ath9k_debugfs_open, 86 + .open = simple_open, 82 87 .owner = THIS_MODULE, 83 88 .llseek = default_llseek, 84 89 }; ··· 124 129 static const struct file_operations fops_tx_chainmask = { 125 130 .read = read_file_tx_chainmask, 126 131 .write = write_file_tx_chainmask, 127 - .open = ath9k_debugfs_open, 132 + .open = simple_open, 128 133 .owner = THIS_MODULE, 129 134 .llseek = default_llseek, 130 135 }; ··· 167 172 static const struct file_operations fops_rx_chainmask = { 168 173 .read = read_file_rx_chainmask, 169 174 .write = write_file_rx_chainmask, 170 - .open = ath9k_debugfs_open, 175 + .open = simple_open, 171 176 .owner = THIS_MODULE, 172 177 .llseek = default_llseek, 173 178 }; ··· 218 223 static const struct file_operations fops_disable_ani = { 219 224 .read = read_file_disable_ani, 220 225 .write = write_file_disable_ani, 221 - .open = ath9k_debugfs_open, 226 + .open = simple_open, 222 227 .owner = THIS_MODULE, 223 228 .llseek = default_llseek, 224 229 }; ··· 319 324 320 325 static const struct file_operations fops_dma = { 321 326 .read = read_file_dma, 322 - .open = ath9k_debugfs_open, 327 + .open = simple_open, 323 328 .owner = THIS_MODULE, 324 329 .llseek = default_llseek, 325 330 }; ··· 441 446 442 447 static const struct file_operations fops_interrupt = { 443 448 .read = read_file_interrupt, 444 - .open = ath9k_debugfs_open, 449 + .open = simple_open, 445 450 .owner = THIS_MODULE, 446 451 .llseek = default_llseek, 447 452 }; ··· 847 852 848 853 static const struct file_operations fops_xmit = { 849 854 .read = read_file_xmit, 850 - .open = ath9k_debugfs_open, 855 + .open = simple_open, 851 856 .owner = THIS_MODULE, 852 857 .llseek = default_llseek, 853 858 }; 854 859 855 860 static const struct file_operations fops_stations = { 856 861 .read = read_file_stations, 857 - .open = ath9k_debugfs_open, 862 + .open = simple_open, 858 863 .owner = THIS_MODULE, 859 864 .llseek = default_llseek, 860 865 }; 861 866 862 867 static const struct file_operations fops_misc = { 863 868 .read = read_file_misc, 864 - .open = ath9k_debugfs_open, 869 + .open = simple_open, 865 870 .owner = THIS_MODULE, 866 871 .llseek = default_llseek, 867 872 }; 868 873 869 874 static const struct file_operations fops_reset = { 870 875 .read = read_file_reset, 871 - .open = ath9k_debugfs_open, 876 + .open = simple_open, 872 877 .owner = THIS_MODULE, 873 878 .llseek = default_llseek, 874 879 }; ··· 1011 1016 1012 1017 static const struct file_operations fops_recv = { 1013 1018 .read = read_file_recv, 1014 - .open = ath9k_debugfs_open, 1019 + .open = simple_open, 1015 1020 .owner = THIS_MODULE, 1016 1021 .llseek = default_llseek, 1017 1022 }; ··· 1050 1055 static const struct file_operations fops_regidx = { 1051 1056 .read = read_file_regidx, 1052 1057 .write = write_file_regidx, 1053 - .open = ath9k_debugfs_open, 1058 + .open = simple_open, 1054 1059 .owner = THIS_MODULE, 1055 1060 .llseek = default_llseek, 1056 1061 }; ··· 1097 1102 static const struct file_operations fops_regval = { 1098 1103 .read = read_file_regval, 1099 1104 .write = write_file_regval, 1100 - .open = ath9k_debugfs_open, 1105 + .open = simple_open, 1101 1106 .owner = THIS_MODULE, 1102 1107 .llseek = default_llseek, 1103 1108 }; ··· 1186 1191 1187 1192 static const struct file_operations fops_dump_nfcal = { 1188 1193 .read = read_file_dump_nfcal, 1189 - .open = ath9k_debugfs_open, 1194 + .open = simple_open, 1190 1195 .owner = THIS_MODULE, 1191 1196 .llseek = default_llseek, 1192 1197 }; ··· 1214 1219 1215 1220 static const struct file_operations fops_base_eeprom = { 1216 1221 .read = read_file_base_eeprom, 1217 - .open = ath9k_debugfs_open, 1222 + .open = simple_open, 1218 1223 .owner = THIS_MODULE, 1219 1224 .llseek = default_llseek, 1220 1225 }; ··· 1242 1247 1243 1248 static const struct file_operations fops_modal_eeprom = { 1244 1249 .read = read_file_modal_eeprom, 1245 - .open = ath9k_debugfs_open, 1250 + .open = simple_open, 1246 1251 .owner = THIS_MODULE, 1247 1252 .llseek = default_llseek, 1248 1253 };
+1 -8
drivers/net/wireless/ath/ath9k/dfs_debug.c
··· 60 60 return retval; 61 61 } 62 62 63 - static int ath9k_dfs_debugfs_open(struct inode *inode, struct file *file) 64 - { 65 - file->private_data = inode->i_private; 66 - 67 - return 0; 68 - } 69 - 70 63 static const struct file_operations fops_dfs_stats = { 71 64 .read = read_file_dfs, 72 - .open = ath9k_dfs_debugfs_open, 65 + .open = simple_open, 73 66 .owner = THIS_MODULE, 74 67 .llseek = default_llseek, 75 68 };
+10 -16
drivers/net/wireless/ath/ath9k/htc_drv_debug.c
··· 16 16 17 17 #include "htc.h" 18 18 19 - static int ath9k_debugfs_open(struct inode *inode, struct file *file) 20 - { 21 - file->private_data = inode->i_private; 22 - return 0; 23 - } 24 - 25 19 static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf, 26 20 size_t count, loff_t *ppos) 27 21 { ··· 69 75 70 76 static const struct file_operations fops_tgt_int_stats = { 71 77 .read = read_file_tgt_int_stats, 72 - .open = ath9k_debugfs_open, 78 + .open = simple_open, 73 79 .owner = THIS_MODULE, 74 80 .llseek = default_llseek, 75 81 }; ··· 139 145 140 146 static const struct file_operations fops_tgt_tx_stats = { 141 147 .read = read_file_tgt_tx_stats, 142 - .open = ath9k_debugfs_open, 148 + .open = simple_open, 143 149 .owner = THIS_MODULE, 144 150 .llseek = default_llseek, 145 151 }; ··· 185 191 186 192 static const struct file_operations fops_tgt_rx_stats = { 187 193 .read = read_file_tgt_rx_stats, 188 - .open = ath9k_debugfs_open, 194 + .open = simple_open, 189 195 .owner = THIS_MODULE, 190 196 .llseek = default_llseek, 191 197 }; ··· 237 243 238 244 static const struct file_operations fops_xmit = { 239 245 .read = read_file_xmit, 240 - .open = ath9k_debugfs_open, 246 + .open = simple_open, 241 247 .owner = THIS_MODULE, 242 248 .llseek = default_llseek, 243 249 }; ··· 358 364 359 365 static const struct file_operations fops_recv = { 360 366 .read = read_file_recv, 361 - .open = ath9k_debugfs_open, 367 + .open = simple_open, 362 368 .owner = THIS_MODULE, 363 369 .llseek = default_llseek, 364 370 }; ··· 393 399 394 400 static const struct file_operations fops_slot = { 395 401 .read = read_file_slot, 396 - .open = ath9k_debugfs_open, 402 + .open = simple_open, 397 403 .owner = THIS_MODULE, 398 404 .llseek = default_llseek, 399 405 }; ··· 440 446 441 447 static const struct file_operations fops_queue = { 442 448 .read = read_file_queue, 443 - .open = ath9k_debugfs_open, 449 + .open = simple_open, 444 450 .owner = THIS_MODULE, 445 451 .llseek = default_llseek, 446 452 }; ··· 481 487 static const struct file_operations fops_debug = { 482 488 .read = read_file_debug, 483 489 .write = write_file_debug, 484 - .open = ath9k_debugfs_open, 490 + .open = simple_open, 485 491 .owner = THIS_MODULE, 486 492 .llseek = default_llseek, 487 493 }; ··· 630 636 631 637 static const struct file_operations fops_base_eeprom = { 632 638 .read = read_file_base_eeprom, 633 - .open = ath9k_debugfs_open, 639 + .open = simple_open, 634 640 .owner = THIS_MODULE, 635 641 .llseek = default_llseek, 636 642 }; ··· 911 917 912 918 static const struct file_operations fops_modal_eeprom = { 913 919 .read = read_file_modal_eeprom, 914 - .open = ath9k_debugfs_open, 920 + .open = simple_open, 915 921 .owner = THIS_MODULE, 916 922 .llseek = default_llseek, 917 923 };
+1 -7
drivers/net/wireless/ath/ath9k/rc.c
··· 1480 1480 1481 1481 #ifdef CONFIG_ATH9K_DEBUGFS 1482 1482 1483 - static int ath9k_debugfs_open(struct inode *inode, struct file *file) 1484 - { 1485 - file->private_data = inode->i_private; 1486 - return 0; 1487 - } 1488 - 1489 1483 static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, 1490 1484 size_t count, loff_t *ppos) 1491 1485 { ··· 1547 1553 1548 1554 static const struct file_operations fops_rcstat = { 1549 1555 .read = read_file_rcstat, 1550 - .open = ath9k_debugfs_open, 1556 + .open = simple_open, 1551 1557 .owner = THIS_MODULE 1552 1558 }; 1553 1559
+1 -6
drivers/net/wireless/ath/carl9170/debug.c
··· 48 48 #define ADD(buf, off, max, fmt, args...) \ 49 49 off += snprintf(&buf[off], max - off, fmt, ##args); 50 50 51 - static int carl9170_debugfs_open(struct inode *inode, struct file *file) 52 - { 53 - file->private_data = inode->i_private; 54 - return 0; 55 - } 56 51 57 52 struct carl9170_debugfs_fops { 58 53 unsigned int read_bufsize; ··· 173 178 .attr = _attr, \ 174 179 .req_dev_state = _dstate, \ 175 180 .fops = { \ 176 - .open = carl9170_debugfs_open, \ 181 + .open = simple_open, \ 177 182 .read = carl9170_debugfs_read, \ 178 183 .write = carl9170_debugfs_write, \ 179 184 .owner = THIS_MODULE \
+1 -7
drivers/net/wireless/b43/debugfs.c
··· 500 500 501 501 #undef fappend 502 502 503 - static int b43_debugfs_open(struct inode *inode, struct file *file) 504 - { 505 - file->private_data = inode->i_private; 506 - return 0; 507 - } 508 - 509 503 static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf, 510 504 size_t count, loff_t *ppos) 511 505 { ··· 618 624 .read = _read, \ 619 625 .write = _write, \ 620 626 .fops = { \ 621 - .open = b43_debugfs_open, \ 627 + .open = simple_open, \ 622 628 .read = b43_debugfs_read, \ 623 629 .write = b43_debugfs_write, \ 624 630 .llseek = generic_file_llseek, \
+1 -7
drivers/net/wireless/b43legacy/debugfs.c
··· 197 197 198 198 #undef fappend 199 199 200 - static int b43legacy_debugfs_open(struct inode *inode, struct file *file) 201 - { 202 - file->private_data = inode->i_private; 203 - return 0; 204 - } 205 - 206 200 static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf, 207 201 size_t count, loff_t *ppos) 208 202 { ··· 325 331 .read = _read, \ 326 332 .write = _write, \ 327 333 .fops = { \ 328 - .open = b43legacy_debugfs_open, \ 334 + .open = simple_open, \ 329 335 .read = b43legacy_debugfs_read, \ 330 336 .write = b43legacy_debugfs_write, \ 331 337 .llseek = generic_file_llseek, \
+1 -7
drivers/net/wireless/iwlegacy/3945-rs.c
··· 821 821 } 822 822 823 823 #ifdef CONFIG_MAC80211_DEBUGFS 824 - static int 825 - il3945_open_file_generic(struct inode *inode, struct file *file) 826 - { 827 - file->private_data = inode->i_private; 828 - return 0; 829 - } 830 824 831 825 static ssize_t 832 826 il3945_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf, ··· 856 862 857 863 static const struct file_operations rs_sta_dbgfs_stats_table_ops = { 858 864 .read = il3945_sta_dbgfs_stats_table_read, 859 - .open = il3945_open_file_generic, 865 + .open = simple_open, 860 866 .llseek = default_llseek, 861 867 }; 862 868
+3 -9
drivers/net/wireless/iwlegacy/4965-rs.c
··· 2518 2518 } 2519 2519 2520 2520 #ifdef CONFIG_MAC80211_DEBUGFS 2521 - static int 2522 - il4965_open_file_generic(struct inode *inode, struct file *file) 2523 - { 2524 - file->private_data = inode->i_private; 2525 - return 0; 2526 - } 2527 2521 2528 2522 static void 2529 2523 il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx) ··· 2689 2695 static const struct file_operations rs_sta_dbgfs_scale_table_ops = { 2690 2696 .write = il4965_rs_sta_dbgfs_scale_table_write, 2691 2697 .read = il4965_rs_sta_dbgfs_scale_table_read, 2692 - .open = il4965_open_file_generic, 2698 + .open = simple_open, 2693 2699 .llseek = default_llseek, 2694 2700 }; 2695 2701 ··· 2734 2740 2735 2741 static const struct file_operations rs_sta_dbgfs_stats_table_ops = { 2736 2742 .read = il4965_rs_sta_dbgfs_stats_table_read, 2737 - .open = il4965_open_file_generic, 2743 + .open = simple_open, 2738 2744 .llseek = default_llseek, 2739 2745 }; 2740 2746 ··· 2762 2768 2763 2769 static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = { 2764 2770 .read = il4965_rs_sta_dbgfs_rate_scale_data_read, 2765 - .open = il4965_open_file_generic, 2771 + .open = simple_open, 2766 2772 .llseek = default_llseek, 2767 2773 }; 2768 2774
+3 -9
drivers/net/wireless/iwlegacy/debug.c
··· 160 160 const char __user *user_buf, \ 161 161 size_t count, loff_t *ppos); 162 162 163 - static int 164 - il_dbgfs_open_file_generic(struct inode *inode, struct file *file) 165 - { 166 - file->private_data = inode->i_private; 167 - return 0; 168 - } 169 163 170 164 #define DEBUGFS_READ_FILE_OPS(name) \ 171 165 DEBUGFS_READ_FUNC(name); \ 172 166 static const struct file_operations il_dbgfs_##name##_ops = { \ 173 167 .read = il_dbgfs_##name##_read, \ 174 - .open = il_dbgfs_open_file_generic, \ 168 + .open = simple_open, \ 175 169 .llseek = generic_file_llseek, \ 176 170 }; 177 171 ··· 173 179 DEBUGFS_WRITE_FUNC(name); \ 174 180 static const struct file_operations il_dbgfs_##name##_ops = { \ 175 181 .write = il_dbgfs_##name##_write, \ 176 - .open = il_dbgfs_open_file_generic, \ 182 + .open = simple_open, \ 177 183 .llseek = generic_file_llseek, \ 178 184 }; 179 185 ··· 183 189 static const struct file_operations il_dbgfs_##name##_ops = { \ 184 190 .write = il_dbgfs_##name##_write, \ 185 191 .read = il_dbgfs_##name##_read, \ 186 - .open = il_dbgfs_open_file_generic, \ 192 + .open = simple_open, \ 187 193 .llseek = generic_file_llseek, \ 188 194 }; 189 195
+3 -8
drivers/net/wireless/iwlwifi/iwl-agn-rs.c
··· 3083 3083 } 3084 3084 3085 3085 #ifdef CONFIG_MAC80211_DEBUGFS 3086 - static int open_file_generic(struct inode *inode, struct file *file) 3087 - { 3088 - file->private_data = inode->i_private; 3089 - return 0; 3090 - } 3091 3086 static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, 3092 3087 u32 *rate_n_flags, int index) 3093 3088 { ··· 3221 3226 static const struct file_operations rs_sta_dbgfs_scale_table_ops = { 3222 3227 .write = rs_sta_dbgfs_scale_table_write, 3223 3228 .read = rs_sta_dbgfs_scale_table_read, 3224 - .open = open_file_generic, 3229 + .open = simple_open, 3225 3230 .llseek = default_llseek, 3226 3231 }; 3227 3232 static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file, ··· 3264 3269 3265 3270 static const struct file_operations rs_sta_dbgfs_stats_table_ops = { 3266 3271 .read = rs_sta_dbgfs_stats_table_read, 3267 - .open = open_file_generic, 3272 + .open = simple_open, 3268 3273 .llseek = default_llseek, 3269 3274 }; 3270 3275 ··· 3290 3295 3291 3296 static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = { 3292 3297 .read = rs_sta_dbgfs_rate_scale_data_read, 3293 - .open = open_file_generic, 3298 + .open = simple_open, 3294 3299 .llseek = default_llseek, 3295 3300 }; 3296 3301
+3 -9
drivers/net/wireless/iwlwifi/iwl-debugfs.c
··· 84 84 size_t count, loff_t *ppos); 85 85 86 86 87 - static int iwl_dbgfs_open_file_generic(struct inode *inode, struct file *file) 88 - { 89 - file->private_data = inode->i_private; 90 - return 0; 91 - } 92 - 93 87 #define DEBUGFS_READ_FILE_OPS(name) \ 94 88 DEBUGFS_READ_FUNC(name); \ 95 89 static const struct file_operations iwl_dbgfs_##name##_ops = { \ 96 90 .read = iwl_dbgfs_##name##_read, \ 97 - .open = iwl_dbgfs_open_file_generic, \ 91 + .open = simple_open, \ 98 92 .llseek = generic_file_llseek, \ 99 93 }; 100 94 ··· 96 102 DEBUGFS_WRITE_FUNC(name); \ 97 103 static const struct file_operations iwl_dbgfs_##name##_ops = { \ 98 104 .write = iwl_dbgfs_##name##_write, \ 99 - .open = iwl_dbgfs_open_file_generic, \ 105 + .open = simple_open, \ 100 106 .llseek = generic_file_llseek, \ 101 107 }; 102 108 ··· 107 113 static const struct file_operations iwl_dbgfs_##name##_ops = { \ 108 114 .write = iwl_dbgfs_##name##_write, \ 109 115 .read = iwl_dbgfs_##name##_read, \ 110 - .open = iwl_dbgfs_open_file_generic, \ 116 + .open = simple_open, \ 111 117 .llseek = generic_file_llseek, \ 112 118 }; 113 119
+3 -9
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
··· 1898 1898 size_t count, loff_t *ppos); 1899 1899 1900 1900 1901 - static int iwl_dbgfs_open_file_generic(struct inode *inode, struct file *file) 1902 - { 1903 - file->private_data = inode->i_private; 1904 - return 0; 1905 - } 1906 - 1907 1901 #define DEBUGFS_READ_FILE_OPS(name) \ 1908 1902 DEBUGFS_READ_FUNC(name); \ 1909 1903 static const struct file_operations iwl_dbgfs_##name##_ops = { \ 1910 1904 .read = iwl_dbgfs_##name##_read, \ 1911 - .open = iwl_dbgfs_open_file_generic, \ 1905 + .open = simple_open, \ 1912 1906 .llseek = generic_file_llseek, \ 1913 1907 }; 1914 1908 ··· 1910 1916 DEBUGFS_WRITE_FUNC(name); \ 1911 1917 static const struct file_operations iwl_dbgfs_##name##_ops = { \ 1912 1918 .write = iwl_dbgfs_##name##_write, \ 1913 - .open = iwl_dbgfs_open_file_generic, \ 1919 + .open = simple_open, \ 1914 1920 .llseek = generic_file_llseek, \ 1915 1921 }; 1916 1922 ··· 1920 1926 static const struct file_operations iwl_dbgfs_##name##_ops = { \ 1921 1927 .write = iwl_dbgfs_##name##_write, \ 1922 1928 .read = iwl_dbgfs_##name##_read, \ 1923 - .open = iwl_dbgfs_open_file_generic, \ 1929 + .open = simple_open, \ 1924 1930 .llseek = generic_file_llseek, \ 1925 1931 }; 1926 1932
+4 -10
drivers/net/wireless/iwmc3200wifi/debugfs.c
··· 99 99 iwm_debugfs_u32_read, iwm_debugfs_dbg_modules_write, 100 100 "%llu\n"); 101 101 102 - static int iwm_generic_open(struct inode *inode, struct file *filp) 103 - { 104 - filp->private_data = inode->i_private; 105 - return 0; 106 - } 107 - 108 102 109 103 static ssize_t iwm_debugfs_txq_read(struct file *filp, char __user *buffer, 110 104 size_t count, loff_t *ppos) ··· 395 401 396 402 static const struct file_operations iwm_debugfs_txq_fops = { 397 403 .owner = THIS_MODULE, 398 - .open = iwm_generic_open, 404 + .open = simple_open, 399 405 .read = iwm_debugfs_txq_read, 400 406 .llseek = default_llseek, 401 407 }; 402 408 403 409 static const struct file_operations iwm_debugfs_tx_credit_fops = { 404 410 .owner = THIS_MODULE, 405 - .open = iwm_generic_open, 411 + .open = simple_open, 406 412 .read = iwm_debugfs_tx_credit_read, 407 413 .llseek = default_llseek, 408 414 }; 409 415 410 416 static const struct file_operations iwm_debugfs_rx_ticket_fops = { 411 417 .owner = THIS_MODULE, 412 - .open = iwm_generic_open, 418 + .open = simple_open, 413 419 .read = iwm_debugfs_rx_ticket_read, 414 420 .llseek = default_llseek, 415 421 }; 416 422 417 423 static const struct file_operations iwm_debugfs_fw_err_fops = { 418 424 .owner = THIS_MODULE, 419 - .open = iwm_generic_open, 425 + .open = simple_open, 420 426 .read = iwm_debugfs_fw_err_read, 421 427 .llseek = default_llseek, 422 428 };
+1 -8
drivers/net/wireless/iwmc3200wifi/sdio.c
··· 264 264 return ret; 265 265 } 266 266 267 - /* debugfs hooks */ 268 - static int iwm_debugfs_sdio_open(struct inode *inode, struct file *filp) 269 - { 270 - filp->private_data = inode->i_private; 271 - return 0; 272 - } 273 - 274 267 static ssize_t iwm_debugfs_sdio_read(struct file *filp, char __user *buffer, 275 268 size_t count, loff_t *ppos) 276 269 { ··· 356 363 357 364 static const struct file_operations iwm_debugfs_sdio_fops = { 358 365 .owner = THIS_MODULE, 359 - .open = iwm_debugfs_sdio_open, 366 + .open = simple_open, 360 367 .read = iwm_debugfs_sdio_read, 361 368 .llseek = default_llseek, 362 369 };
+2 -8
drivers/net/wireless/libertas/debugfs.c
··· 21 21 static void lbs_debug_init(struct lbs_private *priv); 22 22 #endif 23 23 24 - static int open_file_generic(struct inode *inode, struct file *file) 25 - { 26 - file->private_data = inode->i_private; 27 - return 0; 28 - } 29 - 30 24 static ssize_t write_file_dummy(struct file *file, const char __user *buf, 31 25 size_t count, loff_t *ppos) 32 26 { ··· 690 696 691 697 #define FOPS(fread, fwrite) { \ 692 698 .owner = THIS_MODULE, \ 693 - .open = open_file_generic, \ 699 + .open = simple_open, \ 694 700 .read = (fread), \ 695 701 .write = (fwrite), \ 696 702 .llseek = generic_file_llseek, \ ··· 956 962 957 963 static const struct file_operations lbs_debug_fops = { 958 964 .owner = THIS_MODULE, 959 - .open = open_file_generic, 965 + .open = simple_open, 960 966 .write = lbs_debugfs_write, 961 967 .read = lbs_debugfs_read, 962 968 .llseek = default_llseek,
+3 -15
drivers/net/wireless/mwifiex/debugfs.c
··· 140 140 static int num_of_items = ARRAY_SIZE(items); 141 141 142 142 /* 143 - * Generic proc file open handler. 144 - * 145 - * This function is called every time a file is accessed for read or write. 146 - */ 147 - static int 148 - mwifiex_open_generic(struct inode *inode, struct file *file) 149 - { 150 - file->private_data = inode->i_private; 151 - return 0; 152 - } 153 - 154 - /* 155 143 * Proc info file read handler. 156 144 * 157 145 * This function is called when the 'info' file is opened for reading. ··· 664 676 static const struct file_operations mwifiex_dfs_##name##_fops = { \ 665 677 .read = mwifiex_##name##_read, \ 666 678 .write = mwifiex_##name##_write, \ 667 - .open = mwifiex_open_generic, \ 679 + .open = simple_open, \ 668 680 }; 669 681 670 682 #define MWIFIEX_DFS_FILE_READ_OPS(name) \ 671 683 static const struct file_operations mwifiex_dfs_##name##_fops = { \ 672 684 .read = mwifiex_##name##_read, \ 673 - .open = mwifiex_open_generic, \ 685 + .open = simple_open, \ 674 686 }; 675 687 676 688 #define MWIFIEX_DFS_FILE_WRITE_OPS(name) \ 677 689 static const struct file_operations mwifiex_dfs_##name##_fops = { \ 678 690 .write = mwifiex_##name##_write, \ 679 - .open = mwifiex_open_generic, \ 691 + .open = simple_open, \ 680 692 }; 681 693 682 694
+4 -10
drivers/net/wireless/wl1251/debugfs.c
··· 47 47 \ 48 48 static const struct file_operations name## _ops = { \ 49 49 .read = name## _read, \ 50 - .open = wl1251_open_file_generic, \ 50 + .open = simple_open, \ 51 51 .llseek = generic_file_llseek, \ 52 52 }; 53 53 ··· 84 84 \ 85 85 static const struct file_operations sub## _ ##name## _ops = { \ 86 86 .read = sub## _ ##name## _read, \ 87 - .open = wl1251_open_file_generic, \ 87 + .open = simple_open, \ 88 88 .llseek = generic_file_llseek, \ 89 89 }; 90 90 ··· 115 115 116 116 out: 117 117 mutex_unlock(&wl->mutex); 118 - } 119 - 120 - static int wl1251_open_file_generic(struct inode *inode, struct file *file) 121 - { 122 - file->private_data = inode->i_private; 123 - return 0; 124 118 } 125 119 126 120 DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, 20, "%u"); ··· 229 235 230 236 static const struct file_operations tx_queue_len_ops = { 231 237 .read = tx_queue_len_read, 232 - .open = wl1251_open_file_generic, 238 + .open = simple_open, 233 239 .llseek = generic_file_llseek, 234 240 }; 235 241 ··· 251 257 252 258 static const struct file_operations tx_queue_status_ops = { 253 259 .read = tx_queue_status_read, 254 - .open = wl1251_open_file_generic, 260 + .open = simple_open, 255 261 .llseek = generic_file_llseek, 256 262 }; 257 263
+16 -22
drivers/net/wireless/wl12xx/debugfs.c
··· 63 63 \ 64 64 static const struct file_operations name## _ops = { \ 65 65 .read = name## _read, \ 66 - .open = wl1271_open_file_generic, \ 66 + .open = simple_open, \ 67 67 .llseek = generic_file_llseek, \ 68 68 }; 69 69 ··· 96 96 \ 97 97 static const struct file_operations sub## _ ##name## _ops = { \ 98 98 .read = sub## _ ##name## _read, \ 99 - .open = wl1271_open_file_generic, \ 99 + .open = simple_open, \ 100 100 .llseek = generic_file_llseek, \ 101 101 }; 102 102 ··· 124 124 125 125 out: 126 126 mutex_unlock(&wl->mutex); 127 - } 128 - 129 - static int wl1271_open_file_generic(struct inode *inode, struct file *file) 130 - { 131 - file->private_data = inode->i_private; 132 - return 0; 133 127 } 134 128 135 129 DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, "%u"); ··· 237 243 238 244 static const struct file_operations tx_queue_len_ops = { 239 245 .read = tx_queue_len_read, 240 - .open = wl1271_open_file_generic, 246 + .open = simple_open, 241 247 .llseek = default_llseek, 242 248 }; 243 249 ··· 283 289 static const struct file_operations gpio_power_ops = { 284 290 .read = gpio_power_read, 285 291 .write = gpio_power_write, 286 - .open = wl1271_open_file_generic, 292 + .open = simple_open, 287 293 .llseek = default_llseek, 288 294 }; 289 295 ··· 302 308 303 309 static const struct file_operations start_recovery_ops = { 304 310 .write = start_recovery_write, 305 - .open = wl1271_open_file_generic, 311 + .open = simple_open, 306 312 .llseek = default_llseek, 307 313 }; 308 314 ··· 366 372 static const struct file_operations dynamic_ps_timeout_ops = { 367 373 .read = dynamic_ps_timeout_read, 368 374 .write = dynamic_ps_timeout_write, 369 - .open = wl1271_open_file_generic, 375 + .open = simple_open, 370 376 .llseek = default_llseek, 371 377 }; 372 378 ··· 435 441 static const struct file_operations forced_ps_ops = { 436 442 .read = forced_ps_read, 437 443 .write = forced_ps_write, 438 - .open = wl1271_open_file_generic, 444 + .open = simple_open, 439 445 .llseek = default_llseek, 440 446 }; 441 447 ··· 477 483 static const struct file_operations split_scan_timeout_ops = { 478 484 .read = split_scan_timeout_read, 479 485 .write = split_scan_timeout_write, 480 - .open = wl1271_open_file_generic, 486 + .open = simple_open, 481 487 .llseek = default_llseek, 482 488 }; 483 489 ··· 560 566 561 567 static const struct file_operations driver_state_ops = { 562 568 .read = driver_state_read, 563 - .open = wl1271_open_file_generic, 569 + .open = simple_open, 564 570 .llseek = default_llseek, 565 571 }; 566 572 ··· 669 675 670 676 static const struct file_operations vifs_state_ops = { 671 677 .read = vifs_state_read, 672 - .open = wl1271_open_file_generic, 678 + .open = simple_open, 673 679 .llseek = default_llseek, 674 680 }; 675 681 ··· 727 733 static const struct file_operations dtim_interval_ops = { 728 734 .read = dtim_interval_read, 729 735 .write = dtim_interval_write, 730 - .open = wl1271_open_file_generic, 736 + .open = simple_open, 731 737 .llseek = default_llseek, 732 738 }; 733 739 ··· 785 791 static const struct file_operations suspend_dtim_interval_ops = { 786 792 .read = suspend_dtim_interval_read, 787 793 .write = suspend_dtim_interval_write, 788 - .open = wl1271_open_file_generic, 794 + .open = simple_open, 789 795 .llseek = default_llseek, 790 796 }; 791 797 ··· 843 849 static const struct file_operations beacon_interval_ops = { 844 850 .read = beacon_interval_read, 845 851 .write = beacon_interval_write, 846 - .open = wl1271_open_file_generic, 852 + .open = simple_open, 847 853 .llseek = default_llseek, 848 854 }; 849 855 ··· 898 904 static const struct file_operations rx_streaming_interval_ops = { 899 905 .read = rx_streaming_interval_read, 900 906 .write = rx_streaming_interval_write, 901 - .open = wl1271_open_file_generic, 907 + .open = simple_open, 902 908 .llseek = default_llseek, 903 909 }; 904 910 ··· 953 959 static const struct file_operations rx_streaming_always_ops = { 954 960 .read = rx_streaming_always_read, 955 961 .write = rx_streaming_always_write, 956 - .open = wl1271_open_file_generic, 962 + .open = simple_open, 957 963 .llseek = default_llseek, 958 964 }; 959 965 ··· 997 1003 998 1004 static const struct file_operations beacon_filtering_ops = { 999 1005 .write = beacon_filtering_write, 1000 - .open = wl1271_open_file_generic, 1006 + .open = simple_open, 1001 1007 .llseek = default_llseek, 1002 1008 }; 1003 1009
+3 -11
drivers/oprofile/oprofilefs.c
··· 117 117 } 118 118 119 119 120 - static int default_open(struct inode *inode, struct file *filp) 121 - { 122 - if (inode->i_private) 123 - filp->private_data = inode->i_private; 124 - return 0; 125 - } 126 - 127 - 128 120 static const struct file_operations ulong_fops = { 129 121 .read = ulong_read_file, 130 122 .write = ulong_write_file, 131 - .open = default_open, 123 + .open = simple_open, 132 124 .llseek = default_llseek, 133 125 }; 134 126 135 127 136 128 static const struct file_operations ulong_ro_fops = { 137 129 .read = ulong_read_file, 138 - .open = default_open, 130 + .open = simple_open, 139 131 .llseek = default_llseek, 140 132 }; 141 133 ··· 179 187 180 188 static const struct file_operations atomic_ro_fops = { 181 189 .read = atomic_read_file, 182 - .open = default_open, 190 + .open = simple_open, 183 191 .llseek = default_llseek, 184 192 }; 185 193
+3 -10
drivers/remoteproc/remoteproc_debugfs.c
··· 50 50 return simple_read_from_buffer(userbuf, count, ppos, trace->va, len); 51 51 } 52 52 53 - static int rproc_open_generic(struct inode *inode, struct file *file) 54 - { 55 - file->private_data = inode->i_private; 56 - 57 - return 0; 58 - } 59 - 60 53 static const struct file_operations trace_rproc_ops = { 61 54 .read = rproc_trace_read, 62 - .open = rproc_open_generic, 55 + .open = simple_open, 63 56 .llseek = generic_file_llseek, 64 57 }; 65 58 ··· 87 94 88 95 static const struct file_operations rproc_state_ops = { 89 96 .read = rproc_state_read, 90 - .open = rproc_open_generic, 97 + .open = simple_open, 91 98 .llseek = generic_file_llseek, 92 99 }; 93 100 ··· 107 114 108 115 static const struct file_operations rproc_name_ops = { 109 116 .read = rproc_name_read, 110 - .open = rproc_open_generic, 117 + .open = simple_open, 111 118 .llseek = generic_file_llseek, 112 119 }; 113 120
+1 -8
drivers/scsi/lpfc/lpfc_debugfs.c
··· 997 997 return nbytes; 998 998 } 999 999 1000 - static int 1001 - lpfc_debugfs_dif_err_open(struct inode *inode, struct file *file) 1002 - { 1003 - file->private_data = inode->i_private; 1004 - return 0; 1005 - } 1006 - 1007 1000 static ssize_t 1008 1001 lpfc_debugfs_dif_err_read(struct file *file, char __user *buf, 1009 1002 size_t nbytes, loff_t *ppos) ··· 3514 3521 #undef lpfc_debugfs_op_dif_err 3515 3522 static const struct file_operations lpfc_debugfs_op_dif_err = { 3516 3523 .owner = THIS_MODULE, 3517 - .open = lpfc_debugfs_dif_err_open, 3524 + .open = simple_open, 3518 3525 .llseek = lpfc_debugfs_lseek, 3519 3526 .read = lpfc_debugfs_dif_err_read, 3520 3527 .write = lpfc_debugfs_dif_err_write,
+1 -7
drivers/spi/spi-dw.c
··· 63 63 }; 64 64 65 65 #ifdef CONFIG_DEBUG_FS 66 - static int spi_show_regs_open(struct inode *inode, struct file *file) 67 - { 68 - file->private_data = inode->i_private; 69 - return 0; 70 - } 71 - 72 66 #define SPI_REGS_BUFSIZE 1024 73 67 static ssize_t spi_show_regs(struct file *file, char __user *user_buf, 74 68 size_t count, loff_t *ppos) ··· 122 128 123 129 static const struct file_operations mrst_spi_regs_ops = { 124 130 .owner = THIS_MODULE, 125 - .open = spi_show_regs_open, 131 + .open = simple_open, 126 132 .read = spi_show_regs, 127 133 .llseek = default_llseek, 128 134 };
+2 -7
drivers/tty/serial/mfd.c
··· 127 127 128 128 #define HSU_REGS_BUFSIZE 1024 129 129 130 - static int hsu_show_regs_open(struct inode *inode, struct file *file) 131 - { 132 - file->private_data = inode->i_private; 133 - return 0; 134 - } 135 130 136 131 static ssize_t port_show_regs(struct file *file, char __user *user_buf, 137 132 size_t count, loff_t *ppos) ··· 226 231 227 232 static const struct file_operations port_regs_ops = { 228 233 .owner = THIS_MODULE, 229 - .open = hsu_show_regs_open, 234 + .open = simple_open, 230 235 .read = port_show_regs, 231 236 .llseek = default_llseek, 232 237 }; 233 238 234 239 static const struct file_operations dma_regs_ops = { 235 240 .owner = THIS_MODULE, 236 - .open = hsu_show_regs_open, 241 + .open = simple_open, 237 242 .read = dma_show_regs, 238 243 .llseek = default_llseek, 239 244 };
+2 -6
drivers/tty/serial/pch_uart.c
··· 304 304 #ifdef CONFIG_DEBUG_FS 305 305 306 306 #define PCH_REGS_BUFSIZE 1024 307 - static int pch_show_regs_open(struct inode *inode, struct file *file) 308 - { 309 - file->private_data = inode->i_private; 310 - return 0; 311 - } 307 + 312 308 313 309 static ssize_t port_show_regs(struct file *file, char __user *user_buf, 314 310 size_t count, loff_t *ppos) ··· 358 362 359 363 static const struct file_operations port_regs_ops = { 360 364 .owner = THIS_MODULE, 361 - .open = pch_show_regs_open, 365 + .open = simple_open, 362 366 .read = port_show_regs, 363 367 .llseek = default_llseek, 364 368 };
+1 -9
drivers/usb/core/inode.c
··· 428 428 return retval; 429 429 } 430 430 431 - static int default_open (struct inode *inode, struct file *file) 432 - { 433 - if (inode->i_private) 434 - file->private_data = inode->i_private; 435 - 436 - return 0; 437 - } 438 - 439 431 static const struct file_operations default_file_operations = { 440 432 .read = default_read_file, 441 433 .write = default_write_file, 442 - .open = default_open, 434 + .open = simple_open, 443 435 .llseek = default_file_lseek, 444 436 }; 445 437
+1 -8
drivers/usb/host/ehci-dbg.c
··· 352 352 static int debug_periodic_open(struct inode *, struct file *); 353 353 static int debug_registers_open(struct inode *, struct file *); 354 354 static int debug_async_open(struct inode *, struct file *); 355 - static int debug_lpm_open(struct inode *, struct file *); 356 355 static ssize_t debug_lpm_read(struct file *file, char __user *user_buf, 357 356 size_t count, loff_t *ppos); 358 357 static ssize_t debug_lpm_write(struct file *file, const char __user *buffer, ··· 384 385 }; 385 386 static const struct file_operations debug_lpm_fops = { 386 387 .owner = THIS_MODULE, 387 - .open = debug_lpm_open, 388 + .open = simple_open, 388 389 .read = debug_lpm_read, 389 390 .write = debug_lpm_write, 390 391 .release = debug_lpm_close, ··· 967 968 fill_registers_buffer); 968 969 969 970 return file->private_data ? 0 : -ENOMEM; 970 - } 971 - 972 - static int debug_lpm_open(struct inode *inode, struct file *file) 973 - { 974 - file->private_data = inode->i_private; 975 - return 0; 976 971 } 977 972 978 973 static int debug_lpm_close(struct inode *inode, struct file *file)
+1 -8
drivers/uwb/uwb-debug.c
··· 159 159 return uwb_rc_ie_rm(rc, ie_to_rm->data[0]); 160 160 } 161 161 162 - static int command_open(struct inode *inode, struct file *file) 163 - { 164 - file->private_data = inode->i_private; 165 - 166 - return 0; 167 - } 168 - 169 162 static ssize_t command_write(struct file *file, const char __user *buf, 170 163 size_t len, loff_t *off) 171 164 { ··· 199 206 } 200 207 201 208 static const struct file_operations command_fops = { 202 - .open = command_open, 209 + .open = simple_open, 203 210 .write = command_write, 204 211 .read = NULL, 205 212 .llseek = no_llseek,
+3 -11
fs/debugfs/file.c
··· 33 33 return count; 34 34 } 35 35 36 - static int default_open(struct inode *inode, struct file *file) 37 - { 38 - if (inode->i_private) 39 - file->private_data = inode->i_private; 40 - 41 - return 0; 42 - } 43 - 44 36 const struct file_operations debugfs_file_operations = { 45 37 .read = default_read_file, 46 38 .write = default_write_file, 47 - .open = default_open, 39 + .open = simple_open, 48 40 .llseek = noop_llseek, 49 41 }; 50 42 ··· 439 447 static const struct file_operations fops_bool = { 440 448 .read = read_file_bool, 441 449 .write = write_file_bool, 442 - .open = default_open, 450 + .open = simple_open, 443 451 .llseek = default_llseek, 444 452 }; 445 453 ··· 484 492 485 493 static const struct file_operations fops_blob = { 486 494 .read = read_file_blob, 487 - .open = default_open, 495 + .open = simple_open, 488 496 .llseek = default_llseek, 489 497 }; 490 498
+1 -8
fs/dlm/debug_fs.c
··· 609 609 /* 610 610 * dump lkb's on the ls_waiters list 611 611 */ 612 - 613 - static int waiters_open(struct inode *inode, struct file *file) 614 - { 615 - file->private_data = inode->i_private; 616 - return 0; 617 - } 618 - 619 612 static ssize_t waiters_read(struct file *file, char __user *userbuf, 620 613 size_t count, loff_t *ppos) 621 614 { ··· 637 644 638 645 static const struct file_operations waiters_fops = { 639 646 .owner = THIS_MODULE, 640 - .open = waiters_open, 647 + .open = simple_open, 641 648 .read = waiters_read, 642 649 .llseek = default_llseek, 643 650 };
+1 -7
fs/pstore/inode.c
··· 52 52 char data[]; 53 53 }; 54 54 55 - static int pstore_file_open(struct inode *inode, struct file *file) 56 - { 57 - file->private_data = inode->i_private; 58 - return 0; 59 - } 60 - 61 55 static ssize_t pstore_file_read(struct file *file, char __user *userbuf, 62 56 size_t count, loff_t *ppos) 63 57 { ··· 61 67 } 62 68 63 69 static const struct file_operations pstore_file_operations = { 64 - .open = pstore_file_open, 70 + .open = simple_open, 65 71 .read = pstore_file_read, 66 72 .llseek = default_llseek, 67 73 };
+2 -16
kernel/trace/blktrace.c
··· 311 311 } 312 312 EXPORT_SYMBOL_GPL(blk_trace_remove); 313 313 314 - static int blk_dropped_open(struct inode *inode, struct file *filp) 315 - { 316 - filp->private_data = inode->i_private; 317 - 318 - return 0; 319 - } 320 - 321 314 static ssize_t blk_dropped_read(struct file *filp, char __user *buffer, 322 315 size_t count, loff_t *ppos) 323 316 { ··· 324 331 325 332 static const struct file_operations blk_dropped_fops = { 326 333 .owner = THIS_MODULE, 327 - .open = blk_dropped_open, 334 + .open = simple_open, 328 335 .read = blk_dropped_read, 329 336 .llseek = default_llseek, 330 337 }; 331 - 332 - static int blk_msg_open(struct inode *inode, struct file *filp) 333 - { 334 - filp->private_data = inode->i_private; 335 - 336 - return 0; 337 - } 338 338 339 339 static ssize_t blk_msg_write(struct file *filp, const char __user *buffer, 340 340 size_t count, loff_t *ppos) ··· 357 371 358 372 static const struct file_operations blk_msg_fops = { 359 373 .owner = THIS_MODULE, 360 - .open = blk_msg_open, 374 + .open = simple_open, 361 375 .write = blk_msg_write, 362 376 .llseek = noop_llseek, 363 377 };
+3 -9
net/mac80211/debugfs.c
··· 15 15 #include "rate.h" 16 16 #include "debugfs.h" 17 17 18 - int mac80211_open_file_generic(struct inode *inode, struct file *file) 19 - { 20 - file->private_data = inode->i_private; 21 - return 0; 22 - } 23 - 24 18 #define DEBUGFS_FORMAT_BUFFER_SIZE 100 25 19 26 20 int mac80211_format_buffer(char __user *userbuf, size_t count, ··· 44 50 #define DEBUGFS_READONLY_FILE_OPS(name) \ 45 51 static const struct file_operations name## _ops = { \ 46 52 .read = name## _read, \ 47 - .open = mac80211_open_file_generic, \ 53 + .open = simple_open, \ 48 54 .llseek = generic_file_llseek, \ 49 55 }; 50 56 ··· 87 93 88 94 static const struct file_operations reset_ops = { 89 95 .write = reset_write, 90 - .open = mac80211_open_file_generic, 96 + .open = simple_open, 91 97 .llseek = noop_llseek, 92 98 }; 93 99 ··· 248 254 \ 249 255 static const struct file_operations stats_ ##name## _ops = { \ 250 256 .read = stats_ ##name## _read, \ 251 - .open = mac80211_open_file_generic, \ 257 + .open = simple_open, \ 252 258 .llseek = generic_file_llseek, \ 253 259 }; 254 260
-1
net/mac80211/debugfs.h
··· 3 3 4 4 #ifdef CONFIG_MAC80211_DEBUGFS 5 5 extern void debugfs_hw_add(struct ieee80211_local *local); 6 - extern int mac80211_open_file_generic(struct inode *inode, struct file *file); 7 6 extern int mac80211_format_buffer(char __user *userbuf, size_t count, 8 7 loff_t *ppos, char *fmt, ...); 9 8 #else
+2 -2
net/mac80211/debugfs_key.c
··· 30 30 #define KEY_OPS(name) \ 31 31 static const struct file_operations key_ ##name## _ops = { \ 32 32 .read = key_##name##_read, \ 33 - .open = mac80211_open_file_generic, \ 33 + .open = simple_open, \ 34 34 .llseek = generic_file_llseek, \ 35 35 } 36 36 ··· 45 45 #define KEY_CONF_OPS(name) \ 46 46 static const struct file_operations key_ ##name## _ops = { \ 47 47 .read = key_conf_##name##_read, \ 48 - .open = mac80211_open_file_generic, \ 48 + .open = simple_open, \ 49 49 .llseek = generic_file_llseek, \ 50 50 } 51 51
+1 -1
net/mac80211/debugfs_netdev.c
··· 135 135 static const struct file_operations name##_ops = { \ 136 136 .read = ieee80211_if_read_##name, \ 137 137 .write = (_write), \ 138 - .open = mac80211_open_file_generic, \ 138 + .open = simple_open, \ 139 139 .llseek = generic_file_llseek, \ 140 140 } 141 141
+2 -2
net/mac80211/debugfs_sta.c
··· 33 33 #define STA_OPS(name) \ 34 34 static const struct file_operations sta_ ##name## _ops = { \ 35 35 .read = sta_##name##_read, \ 36 - .open = mac80211_open_file_generic, \ 36 + .open = simple_open, \ 37 37 .llseek = generic_file_llseek, \ 38 38 } 39 39 ··· 41 41 static const struct file_operations sta_ ##name## _ops = { \ 42 42 .read = sta_##name##_read, \ 43 43 .write = sta_##name##_write, \ 44 - .open = mac80211_open_file_generic, \ 44 + .open = simple_open, \ 45 45 .llseek = generic_file_llseek, \ 46 46 } 47 47
+1 -1
net/mac80211/rate.c
··· 145 145 146 146 static const struct file_operations rcname_ops = { 147 147 .read = rcname_read, 148 - .open = mac80211_open_file_generic, 148 + .open = simple_open, 149 149 .llseek = default_llseek, 150 150 }; 151 151 #endif
+2 -8
net/wireless/debugfs.c
··· 13 13 #include "core.h" 14 14 #include "debugfs.h" 15 15 16 - static int cfg80211_open_file_generic(struct inode *inode, struct file *file) 17 - { 18 - file->private_data = inode->i_private; 19 - return 0; 20 - } 21 - 22 16 #define DEBUGFS_READONLY_FILE(name, buflen, fmt, value...) \ 23 17 static ssize_t name## _read(struct file *file, char __user *userbuf, \ 24 18 size_t count, loff_t *ppos) \ ··· 27 33 \ 28 34 static const struct file_operations name## _ops = { \ 29 35 .read = name## _read, \ 30 - .open = cfg80211_open_file_generic, \ 36 + .open = simple_open, \ 31 37 .llseek = generic_file_llseek, \ 32 38 }; 33 39 ··· 96 102 97 103 static const struct file_operations ht40allow_map_ops = { 98 104 .read = ht40allow_map_read, 99 - .open = cfg80211_open_file_generic, 105 + .open = simple_open, 100 106 .llseek = default_llseek, 101 107 }; 102 108
+1 -7
sound/soc/imx/imx-audmux.c
··· 40 40 #ifdef CONFIG_DEBUG_FS 41 41 static struct dentry *audmux_debugfs_root; 42 42 43 - static int audmux_open_file(struct inode *inode, struct file *file) 44 - { 45 - file->private_data = inode->i_private; 46 - return 0; 47 - } 48 - 49 43 /* There is an annoying discontinuity in the SSI numbering with regard 50 44 * to the Linux number of the devices */ 51 45 static const char *audmux_port_string(int port) ··· 136 142 } 137 143 138 144 static const struct file_operations audmux_debugfs_fops = { 139 - .open = audmux_open_file, 145 + .open = simple_open, 140 146 .read = audmux_read_file, 141 147 .llseek = default_llseek, 142 148 };
+1 -7
sound/soc/soc-core.c
··· 201 201 static DEVICE_ATTR(pmdown_time, 0644, pmdown_time_show, pmdown_time_set); 202 202 203 203 #ifdef CONFIG_DEBUG_FS 204 - static int codec_reg_open_file(struct inode *inode, struct file *file) 205 - { 206 - file->private_data = inode->i_private; 207 - return 0; 208 - } 209 - 210 204 static ssize_t codec_reg_read_file(struct file *file, char __user *user_buf, 211 205 size_t count, loff_t *ppos) 212 206 { ··· 258 264 } 259 265 260 266 static const struct file_operations codec_reg_fops = { 261 - .open = codec_reg_open_file, 267 + .open = simple_open, 262 268 .read = codec_reg_read_file, 263 269 .write = codec_reg_write_file, 264 270 .llseek = default_llseek,
+2 -14
sound/soc/soc-dapm.c
··· 1544 1544 } 1545 1545 1546 1546 #ifdef CONFIG_DEBUG_FS 1547 - static int dapm_widget_power_open_file(struct inode *inode, struct file *file) 1548 - { 1549 - file->private_data = inode->i_private; 1550 - return 0; 1551 - } 1552 - 1553 1547 static ssize_t dapm_widget_power_read_file(struct file *file, 1554 1548 char __user *user_buf, 1555 1549 size_t count, loff_t *ppos) ··· 1607 1613 } 1608 1614 1609 1615 static const struct file_operations dapm_widget_power_fops = { 1610 - .open = dapm_widget_power_open_file, 1616 + .open = simple_open, 1611 1617 .read = dapm_widget_power_read_file, 1612 1618 .llseek = default_llseek, 1613 1619 }; 1614 - 1615 - static int dapm_bias_open_file(struct inode *inode, struct file *file) 1616 - { 1617 - file->private_data = inode->i_private; 1618 - return 0; 1619 - } 1620 1620 1621 1621 static ssize_t dapm_bias_read_file(struct file *file, char __user *user_buf, 1622 1622 size_t count, loff_t *ppos) ··· 1642 1654 } 1643 1655 1644 1656 static const struct file_operations dapm_bias_fops = { 1645 - .open = dapm_bias_open_file, 1657 + .open = simple_open, 1646 1658 .read = dapm_bias_read_file, 1647 1659 .llseek = default_llseek, 1648 1660 };