Remove conditional logic for kernel version to determine the
size of ctrl_dir and ocp_dir. Instead, the maximum possible
size is used for these arrays regardless of the kernel version
Resolves#144
@kozga advised in issue #94 of a bug in
get_spi_bus_path_number()
> In version 1.0 declared path length is too low (50 bytes)
> But for kernels 4.1 path length is 54 bytes.
> In result, path is shortened to
> '/sys/devices/platform/ocp/48030000.spi/spi_master/'
> and function always return 1,
> even if you try to open /dev/spidev2.x.
These are the sysfs paths for the SPI bus 1 and 2
for Debian 8.6 with Linux 4.4.21-bone13 kernel:
/sys/devices/platform/ocp/48030000.spi/spi_master/spi1/
/sys/devices/platform/ocp/481a0000.spi/spi_master/spi2/
I have fixed by increasing the size of path to MAX_PATH.
MAX_PATH is defined as 256. This should provide enough
extra margin for any future kernel changes in sysfs paths.