소스 검색

Don't cache config location in the DPM code

Now that we cache the configuration location in the configuration code
itself, we don't need to cache it elsewhere.  This makes the DPM code
for evaluating Type-C Current much cleaner.
Clara Hobbs 7 년 전
부모
커밋
042f47e110
1개의 변경된 파일1개의 추가작업 그리고 7개의 파일을 삭제
  1. 1
    7
      src/device_policy_manager.c

+ 1
- 7
src/device_policy_manager.c 파일 보기

@@ -187,13 +187,7 @@ bool pdb_dpm_giveback_enabled(void)
187 187
 
188 188
 bool pdb_dpm_evaluate_typec_current(void)
189 189
 {
190
-    static struct pdb_config *cfg = NULL;
191
-
192
-    /* Get the configuration the first time this function runs, and again any
193
-     * time the status is found to not be valid. */
194
-    if (cfg == NULL || cfg->status != PDB_CONFIG_STATUS_VALID) {
195
-        cfg = pdb_config_flash_read();
196
-    }
190
+    struct pdb_config *cfg = pdb_config_flash_read();
197 191
 
198 192
     /* We don't control the voltage anymore; it will always be 5 V. */
199 193
     dpm_requested_voltage = PD_MV2PDV(5000);

Loading…
취소
저장