linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] platform/x86: peaq_wmi: Fix missing terminating entry for peaq_dmi_table
@ 2017-10-30 13:07 Hans de Goede
  2017-10-30 13:07 ` [PATCH 2/2] platform/x86: peaq-wmi: Remove unnecessary checks from peaq_wmi_exit Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2017-10-30 13:07 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko
  Cc: Hans de Goede, platform-driver-x86, linux-kernel, stable

Add missing terminating entry to peaq_dmi_table.

Fixes: 3b95206110a2 ("platform/x86: peaq-wmi: Add DMI check before ...")
Cc: stable@vger.kernel.org
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/peaq-wmi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/peaq-wmi.c b/drivers/platform/x86/peaq-wmi.c
index 67fa3fa32011..2da48ecc90c1 100644
--- a/drivers/platform/x86/peaq-wmi.c
+++ b/drivers/platform/x86/peaq-wmi.c
@@ -73,6 +73,7 @@ static const struct dmi_system_id peaq_dmi_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "PEAQ PMM C1010 MD99187"),
 		},
 	},
+	{}
 };
 
 static int __init peaq_wmi_init(void)
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] platform/x86: peaq-wmi: Remove unnecessary checks from peaq_wmi_exit
  2017-10-30 13:07 [PATCH 1/2] platform/x86: peaq_wmi: Fix missing terminating entry for peaq_dmi_table Hans de Goede
@ 2017-10-30 13:07 ` Hans de Goede
  2017-10-30 14:09   ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2017-10-30 13:07 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko
  Cc: Hans de Goede, platform-driver-x86, linux-kernel

peaq_wmi_exit will only ever get called if peaq_wmi_init succeeds, so
there is no need to repeat the checks from peaq_wmi_init.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/peaq-wmi.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/platform/x86/peaq-wmi.c b/drivers/platform/x86/peaq-wmi.c
index 2da48ecc90c1..9b9e1f39bbfb 100644
--- a/drivers/platform/x86/peaq-wmi.c
+++ b/drivers/platform/x86/peaq-wmi.c
@@ -66,7 +66,7 @@ static void peaq_wmi_poll(struct input_polled_dev *dev)
 }
 
 /* Some other devices (Shuttle XS35) use the same WMI GUID for other purposes */
-static const struct dmi_system_id peaq_dmi_table[] = {
+static const struct dmi_system_id peaq_dmi_table[] __initconst = {
 	{
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "PEAQ"),
@@ -102,12 +102,6 @@ static int __init peaq_wmi_init(void)
 
 static void __exit peaq_wmi_exit(void)
 {
-	if (!dmi_check_system(peaq_dmi_table))
-		return;
-
-	if (!wmi_has_guid(PEAQ_DOLBY_BUTTON_GUID))
-		return;
-
 	input_unregister_polled_device(peaq_poll_dev);
 }
 
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] platform/x86: peaq-wmi: Remove unnecessary checks from peaq_wmi_exit
  2017-10-30 13:07 ` [PATCH 2/2] platform/x86: peaq-wmi: Remove unnecessary checks from peaq_wmi_exit Hans de Goede
@ 2017-10-30 14:09   ` Andy Shevchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2017-10-30 14:09 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Darren Hart, Andy Shevchenko, Platform Driver, linux-kernel

On Mon, Oct 30, 2017 at 3:07 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> peaq_wmi_exit will only ever get called if peaq_wmi_init succeeds, so
> there is no need to repeat the checks from peaq_wmi_init.

Both pushed to my review and testing queue, thanks!

>
> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/platform/x86/peaq-wmi.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/platform/x86/peaq-wmi.c b/drivers/platform/x86/peaq-wmi.c
> index 2da48ecc90c1..9b9e1f39bbfb 100644
> --- a/drivers/platform/x86/peaq-wmi.c
> +++ b/drivers/platform/x86/peaq-wmi.c
> @@ -66,7 +66,7 @@ static void peaq_wmi_poll(struct input_polled_dev *dev)
>  }
>
>  /* Some other devices (Shuttle XS35) use the same WMI GUID for other purposes */
> -static const struct dmi_system_id peaq_dmi_table[] = {
> +static const struct dmi_system_id peaq_dmi_table[] __initconst = {
>         {
>                 .matches = {
>                         DMI_MATCH(DMI_SYS_VENDOR, "PEAQ"),
> @@ -102,12 +102,6 @@ static int __init peaq_wmi_init(void)
>
>  static void __exit peaq_wmi_exit(void)
>  {
> -       if (!dmi_check_system(peaq_dmi_table))
> -               return;
> -
> -       if (!wmi_has_guid(PEAQ_DOLBY_BUTTON_GUID))
> -               return;
> -
>         input_unregister_polled_device(peaq_poll_dev);
>  }
>
> --
> 2.14.2
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-30 14:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-30 13:07 [PATCH 1/2] platform/x86: peaq_wmi: Fix missing terminating entry for peaq_dmi_table Hans de Goede
2017-10-30 13:07 ` [PATCH 2/2] platform/x86: peaq-wmi: Remove unnecessary checks from peaq_wmi_exit Hans de Goede
2017-10-30 14:09   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).