jtag_scan: Remove the now redundant IDCode parameter from the handlers

This commit is contained in:
dragonmux 2022-01-21 21:11:22 -05:00 committed by Piotr Esden-Tempski
parent 27c143a3a3
commit d1c9d94174
5 changed files with 5 additions and 6 deletions

View File

@ -1010,7 +1010,7 @@ int jtag_scan_stlinkv2(bmp_info_t *info, const uint8_t *irlens)
if((jtag_devs[i].jd_idcode & dev_descr[j].idmask) ==
dev_descr[j].idcode) {
if(dev_descr[j].handler)
dev_descr[j].handler(i, dev_descr[j].idcode);
dev_descr[j].handler(i);
break;
}

View File

@ -285,7 +285,7 @@ void adiv5_ap_ref(ADIv5_AP_t *ap);
void adiv5_ap_unref(ADIv5_AP_t *ap);
void platform_add_jtag_dev(const int dev_index, const jtag_dev_t *jtag_dev);
void adiv5_jtag_dp_handler(uint8_t jd_index, uint32_t j_idcode);
void adiv5_jtag_dp_handler(uint8_t jd_index);
int platform_jtag_dp_init(ADIv5_DP_t *dp);
int swdptap_init(ADIv5_DP_t *dp);

View File

@ -39,14 +39,13 @@
static uint32_t adiv5_jtagdp_error(ADIv5_DP_t *dp);
void adiv5_jtag_dp_handler(uint8_t jd_index, uint32_t j_idcode)
void adiv5_jtag_dp_handler(uint8_t jd_index)
{
ADIv5_DP_t *dp = (void*)calloc(1, sizeof(*dp));
if (!dp) { /* calloc failed: heap exhaustion */
DEBUG_WARN("calloc: failed in %s\n", __func__);
return;
}
(void)j_idcode;
dp->dp_jd_index = jd_index;
dp->idcode = jtag_devs[jd_index].jd_idcode;

View File

@ -22,7 +22,7 @@ typedef const struct jtag_dev_descr_s {
const uint32_t idcode;
const uint32_t idmask;
const char * const descr;
void (*const handler)(uint8_t jd_index, uint32_t j_idcode);
void (*const handler)(uint8_t jd_index);
} jtag_dev_descr_t;
extern jtag_dev_descr_t dev_descr[];

View File

@ -215,7 +215,7 @@ int jtag_scan(const uint8_t *irlens)
jtag_devs[i].jd_descr = dev_descr[j].descr;
/* Call handler to initialise/probe device further */
if(dev_descr[j].handler)
dev_descr[j].handler(i, dev_descr[i].idcode);
dev_descr[j].handler(i);
break;
}