• Jason Gerecke's avatar
    HID: wacom: Improve generic name generation · 09dc28ac
    Jason Gerecke authored
    The 'wacom_update_name' function is responsible for producing names for
    the input device nodes based on the hardware device name. Commit f2209d4a
    added the ability to strip off prefixes like "Wacom Co.,Ltd." where the
    prefix was immediately (and redundantly) followed by "Wacom". The
    2nd-generation Intuos Pro 2 has such a prefix, but with a small error
    (the period and comma are swapped) that prevents the existing code from
    matching it. We're loath to extend the number of cases out endlessly and
    so instead try to be smarter about name generation.
    
    We observe that the cause of the redundant prefixes is HID combining the
    manufacturer and product strings of USB devices together. By using the
    original product name (with "Wacom" prefixed, if it does not already
    exist in the string) we can bypass the gyrations to find and remove
    redundant prefixes. Other devices either don't have a manufacturer string
    that needs to be removed (Bluetooth, uhid) or should have their name
    generated from scratch (I2C).
    Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
    Acked-By: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
    Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
    09dc28ac
wacom_sys.c 67.5 KB