If you add the feature check then presumably someone trying to dodebounce on a port without the feature isn't paying attention so thisshould WARN at the very least. Also it shouldn't be a return 0.

This however seems a bit excessive and inconsistent. Every other functionsimply returns -EINVAL if the request is unsupported. So not only does itcomplicate the code it makes the code inconsistent with its existingregular behaviour. The initial patch is consistent, regular and followsexpected gpiolib behaviour in all respects.

> that could be used later for adding debounce emulation for chips that > doesn't support hw debouncing.

You don't need flags for this - the request will just start working ifsomeone adds the feature.

GPIO is almost always fairly tightly platform bound so features onlyexisting on certain ports is fine. The platform vendor will have madesure they relevant ports have suitable debounce facilities.