Skip to content

Commit

Permalink
make bitbang_interface const
Browse files Browse the repository at this point in the history
Change-Id: I5e187250d231aeefc7a206b7f7917c3b2e858d5a
Signed-off-by: R. Diez <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/8535
Reviewed-by: Antonio Borneo <[email protected]>
Tested-by: jenkins
  • Loading branch information
R. Diez authored and borneoa committed Jan 12, 2025
1 parent d4b3b4e commit 8b5ea72
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/jtag/drivers/am335xgpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static int am335xgpio_blink(bool on)
return ERROR_OK;
}

static struct bitbang_interface am335xgpio_bitbang = {
static const struct bitbang_interface am335xgpio_bitbang = {
.read = am335xgpio_read,
.write = am335xgpio_write,
.swdio_read = am335xgpio_swdio_read,
Expand Down
2 changes: 1 addition & 1 deletion src/jtag/drivers/at91rm9200.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static int at91rm9200_write(int tck, int tms, int tdi);
static int at91rm9200_init(void);
static int at91rm9200_quit(void);

static struct bitbang_interface at91rm9200_bitbang = {
static const struct bitbang_interface at91rm9200_bitbang = {
.read = at91rm9200_read,
.write = at91rm9200_write,
.blink = NULL,
Expand Down
2 changes: 1 addition & 1 deletion src/jtag/drivers/bitbang.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static int bitbang_stableclocks(unsigned int num_cycles);

static void bitbang_swd_write_reg(uint8_t cmd, uint32_t value, uint32_t ap_delay_clk);

struct bitbang_interface *bitbang_interface;
const struct bitbang_interface *bitbang_interface;

/* DANGER!!!! clock absolutely *MUST* be 0 in idle or reset won't work!
*
Expand Down
2 changes: 1 addition & 1 deletion src/jtag/drivers/bitbang.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ extern const struct swd_driver bitbang_swd;

int bitbang_execute_queue(struct jtag_command *cmd_queue);

extern struct bitbang_interface *bitbang_interface;
extern const struct bitbang_interface *bitbang_interface;

#endif /* OPENOCD_JTAG_DRIVERS_BITBANG_H */
2 changes: 1 addition & 1 deletion src/jtag/drivers/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static int dummy_led(bool on)
return ERROR_OK;
}

static struct bitbang_interface dummy_bitbang = {
static const struct bitbang_interface dummy_bitbang = {
.read = &dummy_read,
.write = &dummy_write,
.blink = &dummy_led,
Expand Down
2 changes: 1 addition & 1 deletion src/jtag/drivers/ep93xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct adapter_driver ep93xx_adapter_driver = {
.jtag_ops = &ep93xx_interface,
};

static struct bitbang_interface ep93xx_bitbang = {
static const struct bitbang_interface ep93xx_bitbang = {
.read = ep93xx_read,
.write = ep93xx_write,
.blink = NULL,
Expand Down
2 changes: 1 addition & 1 deletion src/jtag/drivers/imx_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static int imx_gpio_swd_write(int swclk, int swdio);
static int imx_gpio_init(void);
static int imx_gpio_quit(void);

static struct bitbang_interface imx_gpio_bitbang = {
static const struct bitbang_interface imx_gpio_bitbang = {
.read = imx_gpio_read,
.write = imx_gpio_write,
.swdio_read = imx_gpio_swdio_read,
Expand Down
2 changes: 1 addition & 1 deletion src/jtag/drivers/linuxgpiod.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static int linuxgpiod_blink(bool on)
return retval;
}

static struct bitbang_interface linuxgpiod_bitbang = {
static const struct bitbang_interface linuxgpiod_bitbang = {
.read = linuxgpiod_read,
.write = linuxgpiod_write,
.swdio_read = linuxgpiod_swdio_read,
Expand Down
2 changes: 1 addition & 1 deletion src/jtag/drivers/parport.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ static int parport_get_giveio_access(void)
}
#endif

static struct bitbang_interface parport_bitbang = {
static const struct bitbang_interface parport_bitbang = {
.read = &parport_read,
.write = &parport_write,
.blink = &parport_led,
Expand Down
2 changes: 1 addition & 1 deletion src/jtag/drivers/remote_bitbang.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ static int remote_bitbang_swd_write(int swclk, int swdio)
return remote_bitbang_queue(c, NO_FLUSH);
}

static struct bitbang_interface remote_bitbang_bitbang = {
static const struct bitbang_interface remote_bitbang_bitbang = {
.buf_size = sizeof(remote_bitbang_recv_buf) - 1,
.sample = &remote_bitbang_sample,
.read_sample = &remote_bitbang_read_sample,
Expand Down
2 changes: 1 addition & 1 deletion src/jtag/drivers/sysfsgpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ struct adapter_driver sysfsgpio_adapter_driver = {
.swd_ops = &bitbang_swd,
};

static struct bitbang_interface sysfsgpio_bitbang = {
static const struct bitbang_interface sysfsgpio_bitbang = {
.read = sysfsgpio_read,
.write = sysfsgpio_write,
.swdio_read = sysfsgpio_swdio_read,
Expand Down

0 comments on commit 8b5ea72

Please sign in to comment.