board: tp-link_tl-mr3020: add ath79 support
[fw/openocd] / src / flash / nor / lpc2900.c
index 886842083b69732b92276d532dd5bfa485d68ca6..515a3f7b2889bfbeb556eb99c680a349531a672f 100644 (file)
@@ -13,9 +13,7 @@
  *   GNU General Public License for more details.                          *
  *                                                                         *
  *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 
 #ifdef HAVE_CONFIG_H
@@ -556,7 +554,7 @@ COMMAND_HANDLER(lpc2900_handle_read_custom_command)
        target_write_u32(target, FCTR, FCTR_FS_CS | FCTR_FS_WEB);
 
        /* Try and open the file */
-       struct fileio fileio;
+       struct fileio *fileio;
        const char *filename = CMD_ARGV[1];
        int ret = fileio_open(&fileio, filename, FILEIO_WRITE, FILEIO_BINARY);
        if (ret != ERROR_OK) {
@@ -565,14 +563,14 @@ COMMAND_HANDLER(lpc2900_handle_read_custom_command)
        }
 
        size_t nwritten;
-       ret = fileio_write(&fileio, sizeof(customer), customer, &nwritten);
+       ret = fileio_write(fileio, sizeof(customer), customer, &nwritten);
        if (ret != ERROR_OK) {
                LOG_ERROR("Write operation to file %s failed", filename);
-               fileio_close(&fileio);
+               fileio_close(fileio);
                return ret;
        }
 
-       fileio_close(&fileio);
+       fileio_close(fileio);
 
        return ERROR_OK;
 }