]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: rewrite gpiodev_add_to_list
authorBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Fri, 26 Feb 2016 14:37:14 +0000 (22:37 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 7 Mar 2016 05:02:46 +0000 (12:02 +0700)
commit8aca76e81a24658d4386dfd7e814e7cacb8fe7dc
treeb5f1523191402b63e554b41c472a642d03147bfe
parent1e3dcd76fa2ee803221842387954c5e50ec235d6
gpiolib: rewrite gpiodev_add_to_list

The original code of gpiodev_add_to_list is not very clear which
lead to bugs or compiling warning, reference the following patches:
Bugs:
1.  Commit b02a4b893c55 ("gpiolib: improve overlap check of range of
    gpio").
2.  Commit a166ebd62c58 ("gpiolib: fix chip order in gpio list")

Warning:
1.  Commit 93ea0d6529c6 ("gpio: fix warning about iterator").
of gpio").

There is a off-list discussion about how to improve it consequently.
This commit try to follow this by rewriting the whole functions.

Tested pass with my gpio mockup driver and test scripts[1].

[1] http://www.spinics.net/lists/linux-gpio/msg09598.html

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c