Minidriver card reinitialization cleanup

In minidriver before performing a card operation we currently check whether
the supplied card handles have changed.
If they did the card in reader might have been changed so we reinitialize
it.

However, in few places in reinitialization call path an error returned by
some operation would leave the context in an inconsistent state.

So let's walk through this path to make sure that functions there will exit
cleanly if an error happens.

Also, make sure that all card operations that actually do something have
the necessary check call in the first place and also that they all
consistently check whether VENDOR_SPECIFIC pointer is not NULL before
dereferencing it.

This is a cleanup part of "Keep track of card resets by other contexts in
minidriver" (that is, it does not include the actual reset handling code
introduced by that commit), simplified.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
This commit is contained in:
Maciej S. Szmigiero 2017-06-17 19:33:37 +02:00 committed by Frank Morgner
parent bd9cdd243d
commit 294c232ca9
1 changed files with 358 additions and 126 deletions

File diff suppressed because it is too large Load Diff