54
54
MODULE_DESCRIPTION ("/proc interface to IA-64 SAL features" );
55
55
MODULE_LICENSE ("GPL" );
56
56
57
- static const struct file_operations proc_salinfo_fops ;
58
-
59
57
typedef struct {
60
58
const char * name ; /* name of the proc entry */
61
59
unsigned long feature ; /* feature bit */
@@ -578,6 +576,17 @@ static int salinfo_cpu_pre_down(unsigned int cpu)
578
576
return 0 ;
579
577
}
580
578
579
+ /*
580
+ * 'data' contains an integer that corresponds to the feature we're
581
+ * testing
582
+ */
583
+ static int proc_salinfo_show (struct seq_file * m , void * v )
584
+ {
585
+ unsigned long data = (unsigned long )v ;
586
+ seq_puts (m , (sal_platform_features & data ) ? "1\n" : "0\n" );
587
+ return 0 ;
588
+ }
589
+
581
590
static int __init
582
591
salinfo_init (void )
583
592
{
@@ -593,9 +602,9 @@ salinfo_init(void)
593
602
594
603
for (i = 0 ; i < NR_SALINFO_ENTRIES ; i ++ ) {
595
604
/* pass the feature bit in question as misc data */
596
- * sdir ++ = proc_create_data (salinfo_entries [i ].name , 0 , salinfo_dir ,
597
- & proc_salinfo_fops ,
598
- (void * )salinfo_entries [i ].feature );
605
+ * sdir ++ = proc_create_single_data (salinfo_entries [i ].name , 0 ,
606
+ salinfo_dir , proc_salinfo_show ,
607
+ (void * )salinfo_entries [i ].feature );
599
608
}
600
609
601
610
for (i = 0 ; i < ARRAY_SIZE (salinfo_log_name ); i ++ ) {
@@ -633,27 +642,4 @@ salinfo_init(void)
633
642
return 0 ;
634
643
}
635
644
636
- /*
637
- * 'data' contains an integer that corresponds to the feature we're
638
- * testing
639
- */
640
- static int proc_salinfo_show (struct seq_file * m , void * v )
641
- {
642
- unsigned long data = (unsigned long )v ;
643
- seq_puts (m , (sal_platform_features & data ) ? "1\n" : "0\n" );
644
- return 0 ;
645
- }
646
-
647
- static int proc_salinfo_open (struct inode * inode , struct file * file )
648
- {
649
- return single_open (file , proc_salinfo_show , PDE_DATA (inode ));
650
- }
651
-
652
- static const struct file_operations proc_salinfo_fops = {
653
- .open = proc_salinfo_open ,
654
- .read = seq_read ,
655
- .llseek = seq_lseek ,
656
- .release = single_release ,
657
- };
658
-
659
645
module_init (salinfo_init );
0 commit comments