Improve QSPI algorithm on Unix


QSPI uses the wrong algorithm of devices search. In case no any devices
are detected with udev (or with sysfs), starts a search with a filters.
In this case a user gets a list of devices that are not a serial ports,
that is wrong.

The main idea should be in that udev or sysfs are the main sources of
obtaining information. In case they returns an empty list this means
that system has no serial ports.

Algorithm is:

Try to find devices through udev. If it fails (system error or udev is
not present), then try to find using sysfs; otherwise return udev result,
even if it has an empty list. If sysfs is fails (permission denied or
sysfs is not present), then try to find devices in /dev/ as last attempt;
otherwise return sysfs result, even if it has an empty list.

Tested on Linux (with udev, sysfs, filters) using FTDI serial ports.

Change-Id: I0132e27f720b007ea3f4861e9cd7ed77833cff8c
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
commit38286174dd6b3df4e460977326423a6bbda59700
parent383ee53814649190e24e08a16acd6aee629de157
authorDenis Shienkov <denis.shienkov@gmail.com>
committerDenis Shienkov <denis.shienkov@gmail.com>
commit timeTue, 2 Dec 2014 12:06:26 +0100