]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: intel-vbtn: Fix probe failure on devices with only switches
authorHans de Goede <hdegoede@redhat.com>
Sat, 2 May 2020 18:29:51 +0000 (20:29 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 7 May 2020 17:19:37 +0000 (20:19 +0300)
commit5a87f84ba86711d12fe1df462a4543e785364baf
tree1798878216953f9acc85ddbdd63f1698f599b72f
parent3e69fedf0ec2fbaf4b3546e0fa844c948f6f6105
platform/x86: intel-vbtn: Fix probe failure on devices with only switches

On some devices the INT33D6 vbtn device is only used to report
tablet-mode / docked status (switches) and there are no vbtn managed
buttons.

On these devices there is no VBDL object.

Move the VBDL check to a intel_vbtn_has_buttons() helper and only exit
from intel_vbtn_probe() with -ENODEV when there are both no buttons and
no switches. Also only report the buttons being present to userspace if
the has_buttons check has succeeded.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/intel-vbtn.c