<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/gpio/gpiolib-devres.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-02-27T13:17:38Z</updated>
<entry>
<title>gpiolib: Pass consumer device through to core in devm_fwnode_gpiod_get_index()</title>
<updated>2024-02-27T13:17:38Z</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2024-02-23T06:52:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0d776cfd5e5b559fdf2e38285c2aea4b7048acbd'/>
<id>urn:sha1:0d776cfd5e5b559fdf2e38285c2aea4b7048acbd</id>
<content type='text'>
This devm API takes a consumer device as an argument to setup the devm
action, but throws it away when calling further into gpiolib. This leads
to odd debug messages like this:

 (NULL device *): using DT '/gpio-keys/switch-pen-insert' for '(null)' GPIO lookup

Let's pass the consumer device down, by directly calling what
fwnode_gpiod_get_index() calls but pass the device used for devm. This
changes the message to look like this instead:

 gpio-keys gpio-keys: using DT '/gpio-keys/switch-pen-insert' for '(null)' GPIO lookup

Note that callers of fwnode_gpiod_get_index() will still see the NULL
device pointer debug message, but there's not much we can do about that
because the API doesn't take a struct device.

Cc: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Fixes: 8eb1f71e7acc ("gpiolib: consolidate GPIO lookups")
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpiolib: of: remove [devm_]gpiod_get_from_of_node() APIs</title>
<updated>2023-01-30T14:55:28Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2022-12-19T19:20:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=650f2dc970539b3344a98c4bd18efa309e66623b'/>
<id>urn:sha1:650f2dc970539b3344a98c4bd18efa309e66623b</id>
<content type='text'>
Now that everyone is using [devm_]fwnode_gpiod_get[_index]() APIs,
remove OF-specific [devm_]gpiod_get_from_of_node().

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpiolib: devres: Get rid of unused devm_gpio_free()</title>
<updated>2022-07-19T07:56:34Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2022-06-22T17:28:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2b038e786f8338a3bc22d791000753e0ec113e00'/>
<id>urn:sha1:2b038e786f8338a3bc22d791000753e0ec113e00</id>
<content type='text'>
The last user, which in fact was a dead code, has gone a year ago,
previous one 3 years ago. On top of that we want to drop away the
legacy GPIO APIs in the kernel, so take a chance to get rid of
unused devm_gpio_free() and accompanying stuff.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;brgl@bgdev.pl&gt;
</content>
</entry>
<entry>
<title>gpiolib: constify passed device_node pointer</title>
<updated>2021-08-05T19:21:58Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@canonical.com</email>
</author>
<published>2021-07-28T14:42:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e6ae9a833ef4043b940954b8dcac31493706b9d6'/>
<id>urn:sha1:e6ae9a833ef4043b940954b8dcac31493706b9d6</id>
<content type='text'>
Several gpiolib functions receive pointer to struct device_node which is
later passed to OF functions.  These OF functions accept already pointer
to const, so gpiolib can follow similar approach to indicate they are
not modifying the struct device_node.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Reviewed-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
<entry>
<title>gpiolib: devres: shrink devm_gpiochip_add_data_with_key()</title>
<updated>2020-11-16T10:27:33Z</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bgolaszewski@baylibre.com</email>
</author>
<published>2020-11-10T09:39:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3c6e73e47afc874c231b48157be669efaf768471'/>
<id>urn:sha1:3c6e73e47afc874c231b48157be669efaf768471</id>
<content type='text'>
If all we want to manage is a single pointer, there's no need to
manually allocate and add a new devres. We can simply use
devm_add_action_or_reset() and shrink the code by a good bit.

Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpiolib: Extract gpiod_not_found() helper</title>
<updated>2020-10-26T14:23:33Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2020-10-21T14:25:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7b58696d9a8415576317615c63e9899797026f17'/>
<id>urn:sha1:7b58696d9a8415576317615c63e9899797026f17</id>
<content type='text'>
Several places in the code are using same idiom, i.e.
	IS_ERR(desc) &amp;&amp; PTR_ERR(desc) == -ENOENT
which meaning is GPIO description is not found.

For better readability extract gpiod_not_found() helper and use it.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
<entry>
<title>gpio: don't use same lockdep class for all devm_gpiochip_add_data users</title>
<updated>2020-08-03T23:22:02Z</updated>
<author>
<name>Ahmad Fatoum</name>
<email>a.fatoum@pengutronix.de</email>
</author>
<published>2020-07-31T12:38:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5f402bb17533113c21d61c2d4bc4ef4a6fa1c9a5'/>
<id>urn:sha1:5f402bb17533113c21d61c2d4bc4ef4a6fa1c9a5</id>
<content type='text'>
Commit 959bc7b22bd2 ("gpio: Automatically add lockdep keys") documents
in its commits message its intention to "create a unique class key for
each driver".

It does so by having gpiochip_add_data add in-place the definition of
two static lockdep classes for LOCKDEP use. That way, every caller of
the macro adds their gpiochip with unique lockdep classes.

There are many indirect callers of gpiochip_add_data, however, via
use of devm_gpiochip_add_data. devm_gpiochip_add_data has external
linkage and all its users will share the same lockdep classes, which
probably is not intended.

Fix this by replicating the gpio_chip_add_data statics-in-macro for
the devm_ version as well.

Fixes: 959bc7b22bd2 ("gpio: Automatically add lockdep keys")
Signed-off-by: Ahmad Fatoum &lt;a.fatoum@pengutronix.de&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Reviewed-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
Link: https://lore.kernel.org/r/20200731123835.8003-1-a.fatoum@pengutronix.de
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: Move devres calls to devres file</title>
<updated>2020-03-20T09:23:06Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2020-03-13T08:15:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a28e1c0505a09c3a2d81fed1c8453ac2d8d02b3a'/>
<id>urn:sha1:a28e1c0505a09c3a2d81fed1c8453ac2d8d02b3a</id>
<content type='text'>
These two devres functions devm_gpiochip_[add|remove]()
were in the wrong file. They should be in gpiolib-devres.c
not gpiolib.c.

Link: https://lore.kernel.org/r/20200313081522.35143-1-linus.walleij@linaro.org
Reviewed-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>treewide: remove redundant IS_ERR() before error code check</title>
<updated>2020-02-04T03:05:27Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2020-02-04T01:37:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=45586c7078d42b932c5399953d21746800083691'/>
<id>urn:sha1:45586c7078d42b932c5399953d21746800083691</id>
<content type='text'>
'PTR_ERR(p) == -E*' is a stronger condition than IS_ERR(p).
Hence, IS_ERR(p) is unneeded.

The semantic patch that generates this commit is as follows:

// &lt;smpl&gt;
@@
expression ptr;
constant error_code;
@@
-IS_ERR(ptr) &amp;&amp; (PTR_ERR(ptr) == - error_code)
+PTR_ERR(ptr) == - error_code
// &lt;/smpl&gt;

Link: http://lkml.kernel.org/r/20200106045833.1725-1-masahiroy@kernel.org
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Cc: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Acked-by: Stephen Boyd &lt;sboyd@kernel.org&gt; [drivers/clk/clk.c]
Acked-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt; [GPIO]
Acked-by: Wolfram Sang &lt;wsa@the-dreams.de&gt; [drivers/i2c]
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt; [acpi/scan.c]
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Cc: Eric Biggers &lt;ebiggers@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>gpiolib: introduce fwnode_gpiod_get_index()</title>
<updated>2019-10-03T10:04:28Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2019-09-13T03:22:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=13949fa9daa91a60c7cfef40755f7611cc2cf653'/>
<id>urn:sha1:13949fa9daa91a60c7cfef40755f7611cc2cf653</id>
<content type='text'>
This introduces fwnode_gpiod_get_index() that iterates through common gpio
suffixes when trying to locate a GPIO within a given firmware node.

We also switch devm_fwnode_gpiod_get_index() to call
fwnode_gpiod_get_index() instead of iterating through GPIO suffixes on
its own.

Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Link: https://lore.kernel.org/r/20190913032240.50333-3-dmitry.torokhov@gmail.com
Reviewed-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
</feed>
