tsc210x cleanup
This is mostly cleanup of the tsc210x patch, but some bugs were fixed so now
it works on tsc2101 too. Also, a few issues are now noted in the code:
Tool-reported:
- Address checkpatch.pl issues in the original patch
- And also "sparse" issues
Previously wrong:
- Cope with CONFIG_SOUND_MODULE
- Register accessor routines will now return error codes
- ... many callers now abort cleanly after errors
- Don't depend on seeing only a rev #1 tsc2102 chip!
- Add missing EXPORT_SYMBOL declarations
Style issues:
- BUG_ON() is strongly to be avoided
- So are macros that capture variables
- And needless casting from void pointers
- And type punning
- Use dev_*() for messaging where practical
- Use u16 not uint16_t, etc
- Various other whitespace issues
- Avoid __FUNCTION__
- Single-lines for file-top comments; no whole paths
Object code size and Other cleanup:
- Compile most strings out unless -DDEBUG is configured (saving space)
- Move some code into exit sections (then it may well vanish, saving space)
- Add some header comments
Open issues:
- Hwmon needs to know VREF and the chip type, and to scale its values
- Upstream push should exclude audio until some version is working
- Audio will needs to export symbols to modules, too
- Lots of the I/O calls (especially audio) still don't handle errors
- How could board init code get board-specific temp calibration data?
Also the Kconfig is more open-ended; tsc210x might in the future include the
tsc2100 and tsc2111, it doesn't need to be limited to tsc2101 and tsc2102.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Showing
This diff is collapsed.
Please register or sign in to comment