tests: make the devpath check less strict
We plan to change the way gpio-mockup platform devices are registered
in the kernel. This change will add an ID to the gpio-mockup platform
device name and will result in the devpath being changed to
'/devices/platform/gpio-mockup.X/gpiochip'.
When checking the devpath during the test case setup, it's enough to
verify that we got an event from the correct platform device - we
don't need to check the gpiochip name. Shorten the string against
which we check to skip whatever comes after the platform device name.
While we're at it: move the string definition into the function which
is the only user.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>