Cleanup result extraction and update license notice, no functional changes.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
*
* Copyright 2011 Analog Devices Inc.
*
- * Licensed under the GPL-2 or later.
+ * Licensed under the GPL-2.
*/
#include <linux/interrupt.h>
goto error_ret;
}
- *val = (st->rx[1] & 0x1f) << 11 | st->rx[2] << 3 | (st->rx[3] & 0xe0) >> 5;
+ *val = (be32_to_cpu(*(u32 *)st->rx) >> 5) & 0xFFFF;
error_ret:
mutex_unlock(&st->buf_lock);
goto error_ret;
}
- *val = (st->rx[0] & 0x03) << 14 | st->rx[1] << 6 | (st->rx[2] & 0xfc) >> 2;
+ *val = (be32_to_cpu(*(u32 *)st->rx) >> 10) & 0xFFFF;
+
error_ret:
mutex_unlock(&st->buf_lock);
return ret;