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