.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 1997-1998 Mark Lord |
---|
3 | 4 | * Copyright (C) 2003 Red Hat |
---|
.. | .. |
---|
205 | 206 | ide_devset_rw(current_speed, xfer_rate); |
---|
206 | 207 | ide_devset_rw_field(init_speed, init_speed); |
---|
207 | 208 | ide_devset_rw_flag(nice1, IDE_DFLAG_NICE1); |
---|
208 | | -ide_devset_rw_field(number, dn); |
---|
| 209 | +ide_devset_ro_field(number, dn); |
---|
209 | 210 | |
---|
210 | 211 | static const struct ide_proc_devset ide_generic_settings[] = { |
---|
211 | 212 | IDE_PROC_DEVSET(current_speed, 0, 70), |
---|
.. | .. |
---|
380 | 381 | return -EINVAL; |
---|
381 | 382 | } |
---|
382 | 383 | |
---|
383 | | -static const struct file_operations ide_settings_proc_fops = { |
---|
384 | | - .owner = THIS_MODULE, |
---|
385 | | - .open = ide_settings_proc_open, |
---|
386 | | - .read = seq_read, |
---|
387 | | - .llseek = seq_lseek, |
---|
388 | | - .release = single_release, |
---|
389 | | - .write = ide_settings_proc_write, |
---|
| 384 | +static const struct proc_ops ide_settings_proc_ops = { |
---|
| 385 | + .proc_open = ide_settings_proc_open, |
---|
| 386 | + .proc_read = seq_read, |
---|
| 387 | + .proc_lseek = seq_lseek, |
---|
| 388 | + .proc_release = single_release, |
---|
| 389 | + .proc_write = ide_settings_proc_write, |
---|
390 | 390 | }; |
---|
391 | 391 | |
---|
392 | 392 | int ide_capacity_proc_show(struct seq_file *m, void *v) |
---|
.. | .. |
---|
545 | 545 | if (drive->proc) { |
---|
546 | 546 | ide_add_proc_entries(drive->proc, generic_drive_entries, drive); |
---|
547 | 547 | proc_create_data("settings", S_IFREG|S_IRUSR|S_IWUSR, |
---|
548 | | - drive->proc, &ide_settings_proc_fops, |
---|
| 548 | + drive->proc, &ide_settings_proc_ops, |
---|
549 | 549 | drive); |
---|
550 | 550 | } |
---|
551 | 551 | sprintf(name, "ide%d/%s", (drive->name[2]-'a')/2, drive->name); |
---|
.. | .. |
---|
614 | 614 | return 0; |
---|
615 | 615 | } |
---|
616 | 616 | |
---|
617 | | -static int ide_drivers_open(struct inode *inode, struct file *file) |
---|
618 | | -{ |
---|
619 | | - return single_open(file, &ide_drivers_show, NULL); |
---|
620 | | -} |
---|
621 | | - |
---|
622 | | -static const struct file_operations ide_drivers_operations = { |
---|
623 | | - .owner = THIS_MODULE, |
---|
624 | | - .open = ide_drivers_open, |
---|
625 | | - .read = seq_read, |
---|
626 | | - .llseek = seq_lseek, |
---|
627 | | - .release = single_release, |
---|
628 | | -}; |
---|
| 617 | +DEFINE_PROC_SHOW_ATTRIBUTE(ide_drivers); |
---|
629 | 618 | |
---|
630 | 619 | void proc_ide_create(void) |
---|
631 | 620 | { |
---|
.. | .. |
---|
634 | 623 | if (!proc_ide_root) |
---|
635 | 624 | return; |
---|
636 | 625 | |
---|
637 | | - proc_create("drivers", 0, proc_ide_root, &ide_drivers_operations); |
---|
| 626 | + proc_create("drivers", 0, proc_ide_root, &ide_drivers_proc_ops); |
---|
638 | 627 | } |
---|
639 | 628 | |
---|
640 | 629 | void proc_ide_destroy(void) |
---|