jtag: adapter: move adapter_driver extern declaration to header file

Prevents sparse warning:
"symbol 'adapter_driver' was not declared. Should it be static?"

Change-Id: I2a650ae09e250373132bdfa18f7b2942b970b98e
Signed-off-by: Samuel Obuch <samuel.obuch@espressif.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9534
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
This commit is contained in:
Samuel Obuch
2026-03-17 21:44:59 +01:00
committed by Antonio Borneo
parent 944fb35b70
commit faab1de8b1
6 changed files with 6 additions and 9 deletions
+2
View File
@@ -129,6 +129,8 @@ const char *adapter_gpio_get_name(enum adapter_gpio_config_index idx);
*/
const struct adapter_gpio_config *adapter_gpio_get_config(void);
extern struct adapter_driver *adapter_driver;
#define ADAPTER_GPIO_NOT_SET UINT_MAX
#endif /* OPENOCD_JTAG_ADAPTER_H */
-2
View File
@@ -115,8 +115,6 @@ struct jtag_event_callback {
/* callbacks to inform high-level handlers about JTAG state changes */
static struct jtag_event_callback *jtag_event_callbacks;
extern struct adapter_driver *adapter_driver;
void jtag_set_flush_queue_sleep(int ms)
{
jtag_flush_queue_sleep = ms;
+1 -2
View File
@@ -12,13 +12,12 @@
#include "config.h"
#endif
#include "adapter.h"
#include "interface.h"
#include "swim.h"
#include <helper/command.h>
#include <transport/transport.h>
extern struct adapter_driver *adapter_driver;
int swim_system_reset(void)
{
assert(adapter_driver->swim_ops);
+1 -2
View File
@@ -39,6 +39,7 @@
#include <helper/time_support.h>
#include <transport/transport.h>
#include <jtag/adapter.h>
#include <jtag/interface.h>
#include <jtag/swd.h>
@@ -722,8 +723,6 @@ static const struct command_registration swd_handlers[] = {
static int swd_select(struct command_context *ctx)
{
/* FIXME: only place where global 'adapter_driver' is still needed */
extern struct adapter_driver *adapter_driver;
const struct swd_driver *swd = adapter_driver->swd_ops;
int retval;
+1 -2
View File
@@ -16,12 +16,11 @@
#include "helper/list.h"
#include "helper/command.h"
#include "transport/transport.h"
#include "jtag/adapter.h"
#include "jtag/interface.h"
static OOCD_LIST_HEAD(all_dap);
extern struct adapter_driver *adapter_driver;
/* DAP command support */
struct arm_dap_object {
struct list_head lh;
+1 -1
View File
@@ -13,6 +13,7 @@
#include <helper/log.h>
#include "target.h"
#include "target_type.h"
#include "jtag/adapter.h"
#include "jtag/interface.h"
#include "jtag/jtag.h"
#include "jtag/swim.h"
@@ -33,7 +34,6 @@ static void stm8_enable_watchpoints(struct target *target);
static int stm8_unset_watchpoint(struct target *target,
struct watchpoint *watchpoint);
static int (*adapter_speed)(int speed);
extern struct adapter_driver *adapter_driver;
static const struct {
unsigned int id;