I suppose my usage case was a bit special - I had to write code that would
enumerate and get information on devices that would run on as wide a
range of Linux-based systems as possible. Getting information out of sysfs
in a way that is fully backwards-compatible while still being future-proof
proved to be rather hard. In the end, by minimising the use I made of sysfs
to just the most basic device enumeration - the original purpose of sysfs
after all - I was able to write code that worked from early single-digit 2.6
kernels up to current ones, and with some slightly hacky extensions even
worked on all 2.4 series kernels I tried.