altera.c (4f2c0a4acffbec01079c28f839422e64ddeff004) altera.c (128f20c018661439dca8afa523ac066e1a4210ad)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * altera.c
4 *
5 * altera FPGA driver
6 *
7 * Copyright (C) Altera Corporation 1998-2001
8 * Copyright (C) 2010,2011 NetUP Inc.

--- 2393 unchanged lines hidden (view full) ---

2402 astate = kzalloc(sizeof(struct altera_state), GFP_KERNEL);
2403 if (!astate) {
2404 retval = -ENOMEM;
2405 goto free_value;
2406 }
2407
2408 astate->config = config;
2409 if (!astate->config->jtag_io) {
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * altera.c
4 *
5 * altera FPGA driver
6 *
7 * Copyright (C) Altera Corporation 1998-2001
8 * Copyright (C) 2010,2011 NetUP Inc.

--- 2393 unchanged lines hidden (view full) ---

2402 astate = kzalloc(sizeof(struct altera_state), GFP_KERNEL);
2403 if (!astate) {
2404 retval = -ENOMEM;
2405 goto free_value;
2406 }
2407
2408 astate->config = config;
2409 if (!astate->config->jtag_io) {
2410 if (!IS_ENABLED(CONFIG_HAS_IOPORT)) {
2411 retval = -ENODEV;
2412 goto free_state;
2413 }
2410 dprintk("%s: using byteblaster!\n", __func__);
2411 astate->config->jtag_io = netup_jtag_io_lpt;
2412 }
2413
2414 altera_check_crc((u8 *)fw->data, fw->size);
2415
2416 if (debug) {
2417 altera_get_file_info((u8 *)fw->data, fw->size, &format_version,

--- 58 unchanged lines hidden (view full) ---

2476 printk(KERN_ERR "%s: error: action \"%s\""
2477 " is not supported "
2478 "for this Jam STAPL file.\n"
2479 "Program terminated.\n", __func__,
2480 astate->config->action);
2481
2482 } else if (exec_result)
2483 printk(KERN_ERR "%s: error %d\n", __func__, exec_result);
2414 dprintk("%s: using byteblaster!\n", __func__);
2415 astate->config->jtag_io = netup_jtag_io_lpt;
2416 }
2417
2418 altera_check_crc((u8 *)fw->data, fw->size);
2419
2420 if (debug) {
2421 altera_get_file_info((u8 *)fw->data, fw->size, &format_version,

--- 58 unchanged lines hidden (view full) ---

2480 printk(KERN_ERR "%s: error: action \"%s\""
2481 " is not supported "
2482 "for this Jam STAPL file.\n"
2483 "Program terminated.\n", __func__,
2484 astate->config->action);
2485
2486 } else if (exec_result)
2487 printk(KERN_ERR "%s: error %d\n", __func__, exec_result);
2484
2488free_state:
2485 kfree(astate);
2486free_value:
2487 kfree(value);
2488free_key:
2489 kfree(key);
2490out:
2491 return retval;
2492}
2493EXPORT_SYMBOL(altera_init);
2489 kfree(astate);
2490free_value:
2491 kfree(value);
2492free_key:
2493 kfree(key);
2494out:
2495 return retval;
2496}
2497EXPORT_SYMBOL(altera_init);