@@ -761,12 +761,14 @@ static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg,
761
761
static int ipr_save_pcix_cmd_reg (struct ipr_ioa_cfg * ioa_cfg )
762
762
{
763
763
int pcix_cmd_reg = pci_find_capability (ioa_cfg -> pdev , PCI_CAP_ID_PCIX );
764
+ int rc ;
764
765
765
766
if (pcix_cmd_reg == 0 )
766
767
return 0 ;
767
768
768
- if (pci_read_config_word (ioa_cfg -> pdev , pcix_cmd_reg + PCI_X_CMD ,
769
- & ioa_cfg -> saved_pcix_cmd_reg ) != PCIBIOS_SUCCESSFUL ) {
769
+ rc = pci_read_config_word (ioa_cfg -> pdev , pcix_cmd_reg + PCI_X_CMD ,
770
+ & ioa_cfg -> saved_pcix_cmd_reg );
771
+ if (rc != PCIBIOS_SUCCESSFUL ) {
770
772
dev_err (& ioa_cfg -> pdev -> dev , "Failed to save PCI-X command register\n" );
771
773
return - EIO ;
772
774
}
@@ -785,10 +787,12 @@ static int ipr_save_pcix_cmd_reg(struct ipr_ioa_cfg *ioa_cfg)
785
787
static int ipr_set_pcix_cmd_reg (struct ipr_ioa_cfg * ioa_cfg )
786
788
{
787
789
int pcix_cmd_reg = pci_find_capability (ioa_cfg -> pdev , PCI_CAP_ID_PCIX );
790
+ int rc ;
788
791
789
792
if (pcix_cmd_reg ) {
790
- if (pci_write_config_word (ioa_cfg -> pdev , pcix_cmd_reg + PCI_X_CMD ,
791
- ioa_cfg -> saved_pcix_cmd_reg ) != PCIBIOS_SUCCESSFUL ) {
793
+ rc = pci_write_config_word (ioa_cfg -> pdev , pcix_cmd_reg + PCI_X_CMD ,
794
+ ioa_cfg -> saved_pcix_cmd_reg );
795
+ if (rc != PCIBIOS_SUCCESSFUL ) {
792
796
dev_err (& ioa_cfg -> pdev -> dev , "Failed to setup PCI-X command register\n" );
793
797
return - EIO ;
794
798
}
0 commit comments