serial/imx: check that the buffer is non-empty before sending it out
serial/imx: check that the buffer is non-empty before sending it out

The .start_tx callback (imx_start_tx here) isn't only called when the
buffer is non-empty.  E.g. after resume or when handshaking is enabled
and the other side starts to signal being ready.

So check for an empty puffer already before sending the first character.
This prevents sending out stale (or uninitialised) data.

Signed-off-by: Volker Ernst <a37c3b8398f81b3631383a957bf9fecdf0749baf@txtr.com>
Signed-off-by: Daniel Mack <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@caiaq.de>
Cc: Andy Green <e3579b1e47f273529f0f929453e939a68ede9fd1@warmcat.com>
[ukl: reword commit log, put check in while condition]
Signed-off-by: Uwe Kleine-König <181323dd666a182bc2d953e52d0ac3ab54cd8391@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>


KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas