Felix Singer has uploaded this change for review.
jlink_spi.c: Move variable `enable_target_power` into parameter struct
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: Id32a6866372658a04fd62385d226294cfbcd4227
---
M jlink_spi.c
1 file changed, 16 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/89/67889/1
diff --git a/jlink_spi.c b/jlink_spi.c
index 24ab466..ad046e6 100644
--- a/jlink_spi.c
+++ b/jlink_spi.c
@@ -198,6 +198,7 @@
uint32_t serial_number;
bool use_serial_number;
bool reset_cs;
+ bool enable_target_power;
};
static int jlink_spi_init(const struct programmer_cfg *cfg)
@@ -207,7 +208,6 @@
struct jaylink_device_handle *jaylink_devh = NULL;
struct jlink_spi_data *jlink_data = NULL;
struct jlink_spi_parameters parameters = { 0 };
- bool enable_target_power;
param_str = extract_programmer_param_str(cfg, "spispeed");
if (param_str) {
@@ -276,12 +276,11 @@
else
msg_pdbg("Using TRST as chip select signal.\n");
- enable_target_power = false;
+ parameters.enable_target_power = false;
param_str = extract_programmer_param_str(cfg, "power");
-
if (param_str) {
if (!strcasecmp(param_str, "on")) {
- enable_target_power = true;
+ parameters.enable_target_power = true;
} else {
msg_perr("Invalid value for 'power' argument: '%s'.\n", param_str);
free(param_str);
@@ -398,7 +397,7 @@
}
}
- if (enable_target_power) {
+ if (parameters.enable_target_power) {
if (!jaylink_has_cap(caps, JAYLINK_DEV_CAP_SET_TARGET_POWER)) {
msg_perr("Device does not support target power.\n");
goto init_err;
@@ -426,7 +425,7 @@
goto init_err;
}
- if (enable_target_power) {
+ if (parameters.enable_target_power) {
ret = jaylink_set_target_power(jaylink_devh, true);
if (ret != JAYLINK_OK) {
@@ -504,7 +503,7 @@
jlink_data->ctx = jaylink_ctx;
jlink_data->devh = jaylink_devh;
jlink_data->reset_cs = parameters.reset_cs;
- jlink_data->enable_target_power = enable_target_power;
+ jlink_data->enable_target_power = parameters.enable_target_power;
/* Ensure that the CS signal is not active initially. */
if (!deassert_cs(jlink_data))
To view, visit change 67889. To unsubscribe, or for help writing mail filters, visit settings.