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>
#define NORETURN __attribute__((noreturn))
#define MALLOC __attribute__((malloc))
-static const char mockup_devpath[] = "/devices/platform/gpio-mockup/gpiochip";
-
static const unsigned int min_kern_major = 4;
static const unsigned int min_kern_minor = 12;
static const unsigned int min_kern_release = 6;
static bool devpath_is_mockup(const char *devpath)
{
+ static const char mockup_devpath[] = "/devices/platform/gpio-mockup";
+
return !strncmp(devpath, mockup_devpath, sizeof(mockup_devpath) - 1);
}