grlib: Add ambapp_plb()

Replace the global variable ambapp_plb with a function to allow an automatic on
demand initialization.
This commit is contained in:
Sebastian Huber
2021-06-10 13:04:13 +02:00
parent c4c8d3fd50
commit 2c07f24af2
19 changed files with 96 additions and 63 deletions

View File

@@ -132,7 +132,7 @@ static rtems_device_driver canmux_initialize(rtems_device_major_number major, rt
strcpy(fs_name, CANMUX_DEVNAME);
/* Find core and initialize register pointer */
if (!ambapp_find_apbslv(&ambapp_plb, VENDOR_GAISLER, GAISLER_CANMUX, &d)) {
if (!ambapp_find_apbslv(ambapp_plb(), VENDOR_GAISLER, GAISLER_CANMUX, &d)) {
printk("CAN_MUX: Failed to find CAN_MUX core\n\r");
return -1;
}