@@ -694,7 +694,7 @@ static ssize_t boot_vga_show(struct device *dev, struct device_attribute *attr,
694
694
static DEVICE_ATTR_RO (boot_vga );
695
695
696
696
static ssize_t pci_read_config (struct file * filp , struct kobject * kobj ,
697
- struct bin_attribute * bin_attr , char * buf ,
697
+ const struct bin_attribute * bin_attr , char * buf ,
698
698
loff_t off , size_t count )
699
699
{
700
700
struct pci_dev * dev = to_pci_dev (kobj_to_dev (kobj ));
@@ -769,7 +769,7 @@ static ssize_t pci_read_config(struct file *filp, struct kobject *kobj,
769
769
}
770
770
771
771
static ssize_t pci_write_config (struct file * filp , struct kobject * kobj ,
772
- struct bin_attribute * bin_attr , char * buf ,
772
+ const struct bin_attribute * bin_attr , char * buf ,
773
773
loff_t off , size_t count )
774
774
{
775
775
struct pci_dev * dev = to_pci_dev (kobj_to_dev (kobj ));
@@ -837,9 +837,9 @@ static ssize_t pci_write_config(struct file *filp, struct kobject *kobj,
837
837
838
838
return count ;
839
839
}
840
- static BIN_ATTR (config , 0644 , pci_read_config , pci_write_config , 0 ) ;
840
+ static const BIN_ATTR (config , 0644 , pci_read_config , pci_write_config , 0 ) ;
841
841
842
- static struct bin_attribute * pci_dev_config_attrs [] = {
842
+ static const struct bin_attribute * const pci_dev_config_attrs [] = {
843
843
& bin_attr_config ,
844
844
NULL ,
845
845
};
@@ -856,7 +856,7 @@ static size_t pci_dev_config_attr_bin_size(struct kobject *kobj,
856
856
}
857
857
858
858
static const struct attribute_group pci_dev_config_attr_group = {
859
- .bin_attrs = pci_dev_config_attrs ,
859
+ .bin_attrs_new = pci_dev_config_attrs ,
860
860
.bin_size = pci_dev_config_attr_bin_size ,
861
861
};
862
862
@@ -887,8 +887,8 @@ pci_llseek_resource(struct file *filep,
887
887
* callback routine (pci_legacy_read).
888
888
*/
889
889
static ssize_t pci_read_legacy_io (struct file * filp , struct kobject * kobj ,
890
- struct bin_attribute * bin_attr , char * buf ,
891
- loff_t off , size_t count )
890
+ const struct bin_attribute * bin_attr ,
891
+ char * buf , loff_t off , size_t count )
892
892
{
893
893
struct pci_bus * bus = to_pci_bus (kobj_to_dev (kobj ));
894
894
@@ -912,8 +912,8 @@ static ssize_t pci_read_legacy_io(struct file *filp, struct kobject *kobj,
912
912
* callback routine (pci_legacy_write).
913
913
*/
914
914
static ssize_t pci_write_legacy_io (struct file * filp , struct kobject * kobj ,
915
- struct bin_attribute * bin_attr , char * buf ,
916
- loff_t off , size_t count )
915
+ const struct bin_attribute * bin_attr ,
916
+ char * buf , loff_t off , size_t count )
917
917
{
918
918
struct pci_bus * bus = to_pci_bus (kobj_to_dev (kobj ));
919
919
@@ -1003,8 +1003,8 @@ void pci_create_legacy_files(struct pci_bus *b)
1003
1003
b -> legacy_io -> attr .name = "legacy_io" ;
1004
1004
b -> legacy_io -> size = 0xffff ;
1005
1005
b -> legacy_io -> attr .mode = 0600 ;
1006
- b -> legacy_io -> read = pci_read_legacy_io ;
1007
- b -> legacy_io -> write = pci_write_legacy_io ;
1006
+ b -> legacy_io -> read_new = pci_read_legacy_io ;
1007
+ b -> legacy_io -> write_new = pci_write_legacy_io ;
1008
1008
/* See pci_create_attr() for motivation */
1009
1009
b -> legacy_io -> llseek = pci_llseek_resource ;
1010
1010
b -> legacy_io -> mmap = pci_mmap_legacy_io ;
@@ -1099,7 +1099,7 @@ static int pci_mmap_resource_wc(struct file *filp, struct kobject *kobj,
1099
1099
}
1100
1100
1101
1101
static ssize_t pci_resource_io (struct file * filp , struct kobject * kobj ,
1102
- struct bin_attribute * attr , char * buf ,
1102
+ const struct bin_attribute * attr , char * buf ,
1103
1103
loff_t off , size_t count , bool write )
1104
1104
{
1105
1105
#ifdef CONFIG_HAS_IOPORT
@@ -1142,14 +1142,14 @@ static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj,
1142
1142
}
1143
1143
1144
1144
static ssize_t pci_read_resource_io (struct file * filp , struct kobject * kobj ,
1145
- struct bin_attribute * attr , char * buf ,
1145
+ const struct bin_attribute * attr , char * buf ,
1146
1146
loff_t off , size_t count )
1147
1147
{
1148
1148
return pci_resource_io (filp , kobj , attr , buf , off , count , false);
1149
1149
}
1150
1150
1151
1151
static ssize_t pci_write_resource_io (struct file * filp , struct kobject * kobj ,
1152
- struct bin_attribute * attr , char * buf ,
1152
+ const struct bin_attribute * attr , char * buf ,
1153
1153
loff_t off , size_t count )
1154
1154
{
1155
1155
int ret ;
@@ -1210,8 +1210,8 @@ static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine)
1210
1210
} else {
1211
1211
sprintf (res_attr_name , "resource%d" , num );
1212
1212
if (pci_resource_flags (pdev , num ) & IORESOURCE_IO ) {
1213
- res_attr -> read = pci_read_resource_io ;
1214
- res_attr -> write = pci_write_resource_io ;
1213
+ res_attr -> read_new = pci_read_resource_io ;
1214
+ res_attr -> write_new = pci_write_resource_io ;
1215
1215
if (arch_can_pci_mmap_io ())
1216
1216
res_attr -> mmap = pci_mmap_resource_uc ;
1217
1217
} else {
@@ -1292,7 +1292,7 @@ void __weak pci_remove_resource_files(struct pci_dev *dev) { return; }
1292
1292
* writing anything except 0 enables it
1293
1293
*/
1294
1294
static ssize_t pci_write_rom (struct file * filp , struct kobject * kobj ,
1295
- struct bin_attribute * bin_attr , char * buf ,
1295
+ const struct bin_attribute * bin_attr , char * buf ,
1296
1296
loff_t off , size_t count )
1297
1297
{
1298
1298
struct pci_dev * pdev = to_pci_dev (kobj_to_dev (kobj ));
@@ -1318,7 +1318,7 @@ static ssize_t pci_write_rom(struct file *filp, struct kobject *kobj,
1318
1318
* device corresponding to @kobj.
1319
1319
*/
1320
1320
static ssize_t pci_read_rom (struct file * filp , struct kobject * kobj ,
1321
- struct bin_attribute * bin_attr , char * buf ,
1321
+ const struct bin_attribute * bin_attr , char * buf ,
1322
1322
loff_t off , size_t count )
1323
1323
{
1324
1324
struct pci_dev * pdev = to_pci_dev (kobj_to_dev (kobj ));
@@ -1344,9 +1344,9 @@ static ssize_t pci_read_rom(struct file *filp, struct kobject *kobj,
1344
1344
1345
1345
return count ;
1346
1346
}
1347
- static BIN_ATTR (rom , 0600 , pci_read_rom , pci_write_rom , 0 ) ;
1347
+ static const BIN_ATTR (rom , 0600 , pci_read_rom , pci_write_rom , 0 ) ;
1348
1348
1349
- static struct bin_attribute * pci_dev_rom_attrs [] = {
1349
+ static const struct bin_attribute * const pci_dev_rom_attrs [] = {
1350
1350
& bin_attr_rom ,
1351
1351
NULL ,
1352
1352
};
@@ -1372,7 +1372,7 @@ static size_t pci_dev_rom_attr_bin_size(struct kobject *kobj,
1372
1372
}
1373
1373
1374
1374
static const struct attribute_group pci_dev_rom_attr_group = {
1375
- .bin_attrs = pci_dev_rom_attrs ,
1375
+ .bin_attrs_new = pci_dev_rom_attrs ,
1376
1376
.is_bin_visible = pci_dev_rom_attr_is_visible ,
1377
1377
.bin_size = pci_dev_rom_attr_bin_size ,
1378
1378
};
0 commit comments