aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib-acpi.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-03-10 23:08:57 +0100
committerLinus Walleij <linus.walleij@linaro.org>2015-03-19 09:46:04 +0100
commit4d8440b93ce8a8544199804dbcf997b2ab3dad11 (patch)
tree77458cfa065d39cc50c3be2801463d830fd07d36 /drivers/gpio/gpiolib-acpi.c
parentgpio: move pincontrol calls to <linux/gpio/driver.h> (diff)
downloadlinux-dev-4d8440b93ce8a8544199804dbcf997b2ab3dad11.tar.xz
linux-dev-4d8440b93ce8a8544199804dbcf997b2ab3dad11.zip
gpio / ACPI: Avoid unnecessary checks in __gpiod_get_index()
If dev is NULL in __gpiod_get_index() and both ACPI and OF are enabled, it will be checked twice before the code decides to give up with DT/ACPI lookup, so avoid that. Also use the observation that ACPI_COMPANION() is much more efficient than ACPI_HANDLE(), because the latter uses the former and carries out a check and a pointer dereference on top of it, so replace the ACPI_HANDLE() check with an ACPI_COMPANION() one which does not require the additional IS_ENABLED(CONFIG_ACPI) check too. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib-acpi.c')
0 files changed, 0 insertions, 0 deletions