drm/amdgpu: Return from switch early for EEPROM I2C address
authorjsg <jsg@openbsd.org>
Thu, 14 Dec 2023 05:33:28 +0000 (05:33 +0000)
committerjsg <jsg@openbsd.org>
Thu, 14 Dec 2023 05:33:28 +0000 (05:33 +0000)
From Luben Tuikov
af6b1f1156fc2d886251a076b87243597301437c in linux-6.1.y/6.1.68
8782007b5f5795f118c5167f46d8c8142abcc92f in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_ras_eeprom.c

index aeebae6..2c2c845 100644 (file)
@@ -185,14 +185,14 @@ static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev,
        switch (adev->asic_type) {
        case CHIP_VEGA20:
                control->i2c_address = EEPROM_I2C_MADDR_0;
-               break;
+               return true;
 
        case CHIP_ARCTURUS:
                return __get_eeprom_i2c_addr_arct(adev, control);
 
        case CHIP_SIENNA_CICHLID:
                control->i2c_address = EEPROM_I2C_MADDR_0;
-               break;
+               return true;
 
        case CHIP_ALDEBARAN:
 #ifdef notyet
@@ -205,7 +205,7 @@ static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev,
                STUB();
                control->i2c_address = EEPROM_I2C_MADDR_0;
 #endif
-               break;
+               return true;
 
        case CHIP_IP_DISCOVERY:
                return __get_eeprom_i2c_addr_ip_discovery(adev, control);
@@ -213,8 +213,6 @@ static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev,
        default:
                return false;
        }
-
-       return true;
 }
 
 static void