1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright (C) Paul Mackerras 1997.
17 static unsigned int of_stdout_handle;
19 static int of_console_open(void)
23 if (((devp = of_finddevice("/chosen")) != NULL)
24 && (of_getprop(devp, "stdout", &of_stdout_handle,
25 sizeof(of_stdout_handle))
26 == sizeof(of_stdout_handle))) {
27 of_stdout_handle = be32_to_cpu(of_stdout_handle);
34 static void of_console_write(const char *buf, int len)
36 of_call_prom("write", 3, 1, of_stdout_handle, buf, len);
39 void of_console_init(void)
41 console_ops.open = of_console_open;
42 console_ops.write = of_console_write;