Synchronize code with upstream version

Signed-off-by: Guenter Roeck <linux@roeck-us.net>