treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / mips / pnx833x / common / prom.c
blob12733ef25782e32b52bc742e6d9a8387446a7657
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * prom.c:
5 * Copyright 2008 NXP Semiconductors
6 * Chris Steel <chris.steel@nxp.com>
7 * Daniel Laird <daniel.j.laird@nxp.com>
9 * Based on software written by:
10 * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code.
12 #include <linux/init.h>
13 #include <asm/bootinfo.h>
14 #include <linux/string.h>
16 void __init prom_init_cmdline(void)
18 int argc = fw_arg0;
19 char **argv = (char **)fw_arg1;
20 char *c = &(arcs_cmdline[0]);
21 int i;
23 for (i = 1; i < argc; i++) {
24 strcpy(c, argv[i]);
25 c += strlen(argv[i]);
26 if (i < argc-1)
27 *c++ = ' ';
29 *c = 0;
32 char __init *prom_getenv(char *envname)
34 extern char **prom_envp;
35 char **env = prom_envp;
36 int i;
38 i = strlen(envname);
40 while (*env) {
41 if (strncmp(envname, *env, i) == 0 && *(*env+i) == '=')
42 return *env + i + 1;
43 env++;
46 return 0;
49 void __init prom_free_prom_memory(void)