tools: iio: generic_buffer: Fix generic scale extraction
tools: iio: generic_buffer: Fix generic scale extraction

When using generic_buffer to read data, the scale is not properly
detected for scale shared by type. This is caused by a problem
with the generation of generic name out of the full name.
E.g.: for current->name in_accel_z, the extracted generic name
is "in" (when it should be "in_accel"). This is used in generic_buffer
to generate scale and offset paths (in_accel_scale).

Consider the in_ or out_ prefix when extracting the generic name
from the full name.

Signed-off-by: Irina Tirdea <756d90dbe30c1aa83b724b214803f9c992482927@intel.com>
Reviewed-by: Daniel Baluta <f45a6396254d0683f1df8e14b691f61d753fe117@intel.com>
Signed-off-by: Jonathan Cameron <09f65b71b7655725897b2fd41a09a0cefe2e1ace@kernel.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs