]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpiolib: Pass consumer device through to core in devm_fwnode_gpiod_get_index()
authorStephen Boyd <swboyd@chromium.org>
Fri, 23 Feb 2024 06:52:53 +0000 (22:52 -0800)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:34 +0000 (18:19 -0400)
commit630ed2bb6f4d67eba1629d02716d4ca624ab91ed
tree265c7ff984a7e5ff15ac4353790c697aa7cb8567
parent271d0efed20afb264087ef36b3e5e219e47906b2
gpiolib: Pass consumer device through to core in devm_fwnode_gpiod_get_index()

[ Upstream commit 0d776cfd5e5b559fdf2e38285c2aea4b7048acbd ]

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 <dmitry.torokhov@gmail.com>
Fixes: 8eb1f71e7acc ("gpiolib: consolidate GPIO lookups")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpiolib-devres.c
drivers/gpio/gpiolib.c
drivers/gpio/gpiolib.h