Skip to content

Commit

Permalink
MIPS: ingenic: Use common cmdline handling code
Browse files Browse the repository at this point in the history
jz4740_init_cmdline appends all arguments from argv (in fw_arg1) to
arcs_cmdline, up to argc (in fw_arg0). The common code in
fw_init_cmdline will do the exact same thing when run on a system where
fw_arg0 isn't a pointer to kseg0 (it'll also set _fw_envp but we don't
use it). Remove the custom implementation & use the generic code.

Signed-off-by: Paul Burton <[email protected]>
Reviewed-by: PrasannaKumar Muralidharan <[email protected]>
Reviewed-by: James Hogan <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Maarten ter Huurne <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/18484/
Signed-off-by: James Hogan <[email protected]>
  • Loading branch information
paulburton authored and amalon committed Jan 18, 2018
1 parent 8ce355c commit e08a48d
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions arch/mips/jz4740/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,13 @@
#include <linux/serial_reg.h>

#include <asm/bootinfo.h>
#include <asm/fw/fw.h>
#include <asm/mach-jz4740/base.h>

static __init void jz4740_init_cmdline(int argc, char *argv[])
{
unsigned int count = COMMAND_LINE_SIZE - 1;
int i;
char *dst = &(arcs_cmdline[0]);
char *src;

for (i = 1; i < argc && count; ++i) {
src = argv[i];
while (*src && count) {
*dst++ = *src++;
--count;
}
*dst++ = ' ';
}
if (i > 1)
--dst;

*dst = 0;
}

void __init prom_init(void)
{
jz4740_init_cmdline((int)fw_arg0, (char **)fw_arg1);
mips_machtype = MACH_INGENIC_JZ4740;
fw_init_cmdline();
}

void __init prom_free_prom_memory(void)
Expand Down

0 comments on commit e08a48d

Please sign in to comment.