2 Jun
2015
2 Jun
'15
7:16 p.m.
On Fri, May 29, 2015 at 06:31:08PM +0200, Lars-Peter Clausen wrote:
Three things, don't use the _index API if there is only a single gpio for the property, either don't use a name at all or use a descriptive name something like "hp-detect" and use the new version of the API which has the flags parameter.
So this should be: devm_gpiod_get(&i2c->dev, NULL, GPIOD_IN);
and then drop the gpiod_direction_input()...
It seems better if people use names where possible if there's any chance that we could add support for other GPIOs in the future, that avoids confusion further down the line with extension.