All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Ayman Bagabas <ayman.bagabas@gmail.com>
Cc: Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Platform Driver <platform-driver-x86@vger.kernel.org>
Subject: Re: [PATCH v4 1/3] x86: add support for Huawei WMI hotkeys.
Date: Sat, 10 Nov 2018 16:25:49 +0200	[thread overview]
Message-ID: <CAHp75Vc0H6Cd=knnx3Sv2zLXfqPp2J48VQDFBo4miLo5vMVftg@mail.gmail.com> (raw)
In-Reply-To: <20181109234526.4280-2-ayman.bagabas@gmail.com>

On Sat, Nov 10, 2018 at 1:45 AM Ayman Bagabas <ayman.bagabas@gmail.com> wrote:
>
> This driver adds support for missing hotkeys on some Huawei laptops.
> Currently, only Huawei Matebook X and Matebook X Pro is supported.

>  drivers/platform/x86/huawei_wmi.c            | 215 +++++++++++++++++++
>  include/linux/platform_data/x86/huawei_wmi.h |   9 +

So, please use a de facto pattern, i.e. <VENDOR>-wmi.c, so for *.h.

> +config HUAWEI_LAPTOP

This better to be consistent with the module name.

> +       help
> +         This driver provides support for Huawei WMI hotkeys.
> +         It enables the missing keys and adds support to the micmute
> +         LED found on some of these laptops.

Here we usually put a line how module will be called.

> +// SPDX-License-Identifier: GPL-2.0

You need to choose proper license either here, or in MODULE_LICENSE()
line. For now they are not in align.

> +MODULE_LICENSE("GPL");

> +       /*
> +        * MBX uses code 0x80 to indicate a hotkey event.
> +        * The actual key is fetched from the method WQ00

Period is missed.

> +        */

> +static void huawei_wmi_notify(u32 value, void *context)
> +{
> +       struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
> +       union acpi_object *obj;
> +       acpi_status status;

> +       struct input_dev *inputdev = (struct input_dev *)context;

No need an explicit casting.
Also, move this to be first line in the definition block.

> +       status = wmi_get_event_data(value, &response);
> +       if (ACPI_FAILURE(status)) {
> +               dev_err(&inputdev->dev, "Bad event status 0x%x\n", status);
> +               return;
> +       }

> +}

> +       err = sparse_keymap_setup(inputdev,
> +                       huawei_wmi_keymap, NULL);

Would it be one line?

> +       if (err)
> +               goto err_free_dev;
> +

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2018-11-10 14:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-09 23:45 [PATCH v4 0/3] Huawei laptops Ayman Bagabas
2018-11-09 23:45 ` [PATCH v4 1/3] x86: add support for Huawei WMI hotkeys Ayman Bagabas
2018-11-10 14:25   ` Andy Shevchenko [this message]
2018-11-09 23:45 ` [PATCH v4 2/3] ALSA: hda: fix front speakers on Huawei MBXP Ayman Bagabas
2018-11-09 23:45 ` [PATCH v4 3/3] ALSA: hda: add support for Huawei WMI micmute LED Ayman Bagabas
2018-11-10 14:26   ` Andy Shevchenko
2018-11-10 14:26     ` Andy Shevchenko
2018-11-11  8:44     ` Takashi Iwai
2018-11-11  8:44       ` Takashi Iwai
2018-11-10 14:17 ` [PATCH v4 0/3] Huawei laptops Andy Shevchenko
2018-11-10 14:18   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHp75Vc0H6Cd=knnx3Sv2zLXfqPp2J48VQDFBo4miLo5vMVftg@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=andy@infradead.org \
    --cc=ayman.bagabas@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.