@@ -183,6 +183,8 @@ static int amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,
183
183
{
184
184
const struct i2c_adapter_quirks * quirks = i2c_adap -> quirks ;
185
185
u16 limit ;
186
+ u16 ps ; /* Partial size */
187
+ int res = 0 , r ;
186
188
187
189
if (!quirks )
188
190
limit = 0 ;
@@ -200,28 +202,25 @@ static int amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,
200
202
eeprom_addr , buf_size ,
201
203
read ? "read" : "write" , EEPROM_OFFSET_SIZE );
202
204
return - EINVAL ;
203
- } else {
204
- u16 ps ; /* Partial size */
205
- int res = 0 , r ;
206
-
207
- /* The "limit" includes all data bytes sent/received,
208
- * which would include the EEPROM_OFFSET_SIZE bytes.
209
- * Account for them here.
210
- */
211
- limit -= EEPROM_OFFSET_SIZE ;
212
- for ( ; buf_size > 0 ;
213
- buf_size -= ps , eeprom_addr += ps , eeprom_buf += ps ) {
214
- ps = min (limit , buf_size );
215
-
216
- r = __amdgpu_eeprom_xfer (i2c_adap , eeprom_addr ,
217
- eeprom_buf , ps , read );
218
- if (r < 0 )
219
- return r ;
220
- res += r ;
221
- }
205
+ }
222
206
223
- return res ;
207
+ /* The "limit" includes all data bytes sent/received,
208
+ * which would include the EEPROM_OFFSET_SIZE bytes.
209
+ * Account for them here.
210
+ */
211
+ limit -= EEPROM_OFFSET_SIZE ;
212
+ for ( ; buf_size > 0 ;
213
+ buf_size -= ps , eeprom_addr += ps , eeprom_buf += ps ) {
214
+ ps = min (limit , buf_size );
215
+
216
+ r = __amdgpu_eeprom_xfer (i2c_adap , eeprom_addr ,
217
+ eeprom_buf , ps , read );
218
+ if (r < 0 )
219
+ return r ;
220
+ res += r ;
224
221
}
222
+
223
+ return res ;
225
224
}
226
225
227
226
int amdgpu_eeprom_read (struct i2c_adapter * i2c_adap ,
0 commit comments