Refactor file open checks
* Return 0 on success, <0 on error.
* No need to seek check the normal files.
* Use perror(): when a system call fails, it is useful to know why.
* If the checks fail, don't try to access the device in the error path.
file open/access checks pass in the normal case
file open checks fail when:
* no device present
* firmware file doesn't exist
* permissions are wrong for backup file
1 file changed