Browse Source

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 years ago
parent
commit
042f47e110
1 changed files with 1 additions and 7 deletions
  1. 1
    7
      src/device_policy_manager.c

+ 1
- 7
src/device_policy_manager.c View File

@@ -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…
Cancel
Save