static int get_real_id(const char *devpath, const char *idname, uint16_t *val)

{

    FILE *f;

    char name[128];

    long id;



    snprintf(name, sizeof(name), "%s%s", devpath, idname);

    f = fopen(name, "r");

    if (f == NULL) {

        error_report("%s: %s: %m", __func__, name);

        return -1;

    }

    if (fscanf(f, "%li\n", &id) == 1) {

        *val = id;

    } else {


        return -1;

    }




    return 0;

}
static int get_real_id(const char *devpath, const char *idname, uint16_t *val)

{

    FILE *f;

    char name[128];

    long id;



    snprintf(name, sizeof(name), "%s%s", devpath, idname);

    f = fopen(name, "r");

    if (f == NULL) {

        error_report("%s: %s: %m", __func__, name);

        return -1;

    }

    if (fscanf(f, "%li\n", &id) == 1) {

        *val = id;

    } else {


        return -1;

    }




    return 0;

}
static int FUNC_0(const char *VAR_0, const char *VAR_1, uint16_t *VAR_2)

{

    FILE *f;

    char VAR_3[128];

    long VAR_4;



    snprintf(VAR_3, sizeof(VAR_3), "%s%s", VAR_0, VAR_1);

    f = fopen(VAR_3, "r");

    if (f == NULL) {

        error_report("%s: %s: %m", __func__, VAR_3);

        return -1;

    }

    if (fscanf(f, "%li\n", &VAR_4) == 1) {

        *VAR_2 = VAR_4;

    } else {


        return -1;

    }




    return 0;

}
static int FUNC_0(const char *VAR_0, const char *VAR_1, uint16_t *VAR_2)
{ FILE *f; char VAR_3[128]; long VAR_4; snprintf(VAR_3, sizeof(VAR_3), "%s%s", VAR_0, VAR_1); f = fopen(VAR_3, "r"); if (f == NULL) { error_report("%s: %s: %m", __func__, VAR_3); return -1; } if (fscanf(f, "%li\n", &VAR_4) == 1) { *VAR_2 = VAR_4; } else { return -1; } return 0; }