make bitbang_interface const

Change-Id: I5e187250d231aeefc7a206b7f7917c3b2e858d5a
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8535
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
This commit is contained in:
R. Diez 2024-11-03 12:06:05 +01:00 committed by Antonio Borneo
parent d4b3b4ea82
commit 8b5ea720da
11 changed files with 11 additions and 11 deletions

View File

@ -283,7 +283,7 @@ static int am335xgpio_blink(bool on)
return ERROR_OK; return ERROR_OK;
} }
static struct bitbang_interface am335xgpio_bitbang = { static const struct bitbang_interface am335xgpio_bitbang = {
.read = am335xgpio_read, .read = am335xgpio_read,
.write = am335xgpio_write, .write = am335xgpio_write,
.swdio_read = am335xgpio_swdio_read, .swdio_read = am335xgpio_swdio_read,

View File

@ -104,7 +104,7 @@ static int at91rm9200_write(int tck, int tms, int tdi);
static int at91rm9200_init(void); static int at91rm9200_init(void);
static int at91rm9200_quit(void); static int at91rm9200_quit(void);
static struct bitbang_interface at91rm9200_bitbang = { static const struct bitbang_interface at91rm9200_bitbang = {
.read = at91rm9200_read, .read = at91rm9200_read,
.write = at91rm9200_write, .write = at91rm9200_write,
.blink = NULL, .blink = NULL,

View File

@ -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); 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! /* DANGER!!!! clock absolutely *MUST* be 0 in idle or reset won't work!
* *

View File

@ -67,6 +67,6 @@ extern const struct swd_driver bitbang_swd;
int bitbang_execute_queue(struct jtag_command *cmd_queue); 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 */ #endif /* OPENOCD_JTAG_DRIVERS_BITBANG_H */

View File

@ -77,7 +77,7 @@ static int dummy_led(bool on)
return ERROR_OK; return ERROR_OK;
} }
static struct bitbang_interface dummy_bitbang = { static const struct bitbang_interface dummy_bitbang = {
.read = &dummy_read, .read = &dummy_read,
.write = &dummy_write, .write = &dummy_write,
.blink = &dummy_led, .blink = &dummy_led,

View File

@ -55,7 +55,7 @@ struct adapter_driver ep93xx_adapter_driver = {
.jtag_ops = &ep93xx_interface, .jtag_ops = &ep93xx_interface,
}; };
static struct bitbang_interface ep93xx_bitbang = { static const struct bitbang_interface ep93xx_bitbang = {
.read = ep93xx_read, .read = ep93xx_read,
.write = ep93xx_write, .write = ep93xx_write,
.blink = NULL, .blink = NULL,

View File

@ -82,7 +82,7 @@ static int imx_gpio_swd_write(int swclk, int swdio);
static int imx_gpio_init(void); static int imx_gpio_init(void);
static int imx_gpio_quit(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, .read = imx_gpio_read,
.write = imx_gpio_write, .write = imx_gpio_write,
.swdio_read = imx_gpio_swdio_read, .swdio_read = imx_gpio_swdio_read,

View File

@ -191,7 +191,7 @@ static int linuxgpiod_blink(bool on)
return retval; return retval;
} }
static struct bitbang_interface linuxgpiod_bitbang = { static const struct bitbang_interface linuxgpiod_bitbang = {
.read = linuxgpiod_read, .read = linuxgpiod_read,
.write = linuxgpiod_write, .write = linuxgpiod_write,
.swdio_read = linuxgpiod_swdio_read, .swdio_read = linuxgpiod_swdio_read,

View File

@ -255,7 +255,7 @@ static int parport_get_giveio_access(void)
} }
#endif #endif
static struct bitbang_interface parport_bitbang = { static const struct bitbang_interface parport_bitbang = {
.read = &parport_read, .read = &parport_read,
.write = &parport_write, .write = &parport_write,
.blink = &parport_led, .blink = &parport_led,

View File

@ -278,7 +278,7 @@ static int remote_bitbang_swd_write(int swclk, int swdio)
return remote_bitbang_queue(c, NO_FLUSH); 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, .buf_size = sizeof(remote_bitbang_recv_buf) - 1,
.sample = &remote_bitbang_sample, .sample = &remote_bitbang_sample,
.read_sample = &remote_bitbang_read_sample, .read_sample = &remote_bitbang_read_sample,

View File

@ -565,7 +565,7 @@ struct adapter_driver sysfsgpio_adapter_driver = {
.swd_ops = &bitbang_swd, .swd_ops = &bitbang_swd,
}; };
static struct bitbang_interface sysfsgpio_bitbang = { static const struct bitbang_interface sysfsgpio_bitbang = {
.read = sysfsgpio_read, .read = sysfsgpio_read,
.write = sysfsgpio_write, .write = sysfsgpio_write,
.swdio_read = sysfsgpio_swdio_read, .swdio_read = sysfsgpio_swdio_read,