i.MX: Fix UART driver to work with unitialized "chardev" device
The "chardev" property initialization might have failed (for example because
there are not enough chardevs provided by QEMU).
The serial device emulator needs to be able to work with an uninitialized
(NULL) chardev device pointer.
This patch adds some missing tests on the chr pointer value before
using it.
Signed-off-by: Jean-Christophe Dubois <[email protected]>
Reviewed-by: Peter Crosthwaite <[email protected]>
Message-id:
1438342461[email protected]
Signed-off-by: Peter Maydell <[email protected]>