@@ -2146,15 +2146,16 @@ static int process_dir(struct config *config, enum REG_TYPE reg)
break;
case SCR:
- if (!strcmp(type, "SD")) {
- reg_content = read_file("scr");
- if (!reg_content) {
- fprintf(stderr, "Could not read SD card "
- "configuration in directory '%s'.\n",
- config->dir);
- ret = -1;
- goto err;
- }
+ if (config->bus != SD)
+ break;
+
+ reg_content = read_file("scr");
+ if (!reg_content) {
+ fprintf(stderr, "Could not read SD card "
+ "configuration in directory '%s'.\n",
+ config->dir);
+ ret = -1;
+ goto err;
}
print_sd_scr(config, reg_content);
This commit refactors the SCR case in the process_dir function to use the bus type check instead of comparing the type string directly. This change simplifies the logic and makes it consistent with other parts of the code that use the bus type. Signed-off-by: Avri Altman <avri.altman@sandisk.com> --- lsmmc.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)