alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Hui Wang <hui.wang@canonical.com>
To: Lukas Wunner <lukas@wunner.de>,
	linux-acpi@vger.kernel.org, devel@acpica.org
Cc: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: Re: [alsa-devel] [PATCH 4/5] ALSA: hda - Use acpi_dev_present
Date: Tue, 24 Nov 2015 09:51:13 +0800	[thread overview]
Message-ID: <5653C291.9090607@canonical.com> (raw)
In-Reply-To: <515643b09b28cd6b4445a1ff194bf62b0d02989c.1448282995.git.lukas@wunner.de>

On 11/23/2015 10:34 PM, Lukas Wunner wrote:
> Use shiny new acpi_dev_present and remove all the boilerplate to search
> for a particular ACPI device. No functional change.
>
> Cc: Hui Wang <hui.wang@canonical.com>
The [PATCH 4/5] looks fine to me.

Acked-by: Hui Wang <hui.wang@canonical.com>
> Cc: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> ---
>   sound/pci/hda/thinkpad_helper.c | 17 ++---------------
>   1 file changed, 2 insertions(+), 15 deletions(-)
>
> diff --git a/sound/pci/hda/thinkpad_helper.c b/sound/pci/hda/thinkpad_helper.c
> index 0a4ad5f..59ab6ce 100644
> --- a/sound/pci/hda/thinkpad_helper.c
> +++ b/sound/pci/hda/thinkpad_helper.c
> @@ -10,23 +10,10 @@
>   static int (*led_set_func)(int, bool);
>   static void (*old_vmaster_hook)(void *, int);
>   
> -static acpi_status acpi_check_cb(acpi_handle handle, u32 lvl, void *context,
> -				 void **rv)
> -{
> -	bool *found = context;
> -	*found = true;
> -	return AE_OK;
> -}
> -
>   static bool is_thinkpad(struct hda_codec *codec)
>   {
> -	bool found = false;
> -	if (codec->core.subsystem_id >> 16 != 0x17aa)
> -		return false;
> -	if (ACPI_SUCCESS(acpi_get_devices("LEN0068", acpi_check_cb, &found, NULL)) && found)
> -		return true;
> -	found = false;
> -	return ACPI_SUCCESS(acpi_get_devices("IBM0068", acpi_check_cb, &found, NULL)) && found;
> +	return (codec->core.subsystem_id >> 16 == 0x17aa) &&
> +	       (acpi_dev_present("LEN0068") || acpi_dev_present("IBM0068"));
>   }
>   
>   static void update_tpacpi_mute_led(void *private_data, int enabled)


  reply	other threads:[~2015-11-24  1:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23 14:34 [PATCH 0/5] Add acpi_dev_present Lukas Wunner
2015-11-23 14:34 ` [PATCH 4/5] ALSA: hda - Use acpi_dev_present Lukas Wunner
2015-11-24  1:51   ` Hui Wang [this message]
2015-11-23 14:34 ` [PATCH 1/5] ACPICA: Add acpi_dev_present Lukas Wunner
2015-11-23 22:34   ` Rafael J. Wysocki
2015-11-23 22:22     ` Moore, Robert
2015-11-23 23:32       ` Lukas Wunner
2015-11-24  4:40         ` Hanjun Guo
2015-11-24 14:15           ` Moore, Robert
2015-11-24 14:22           ` Rafael J. Wysocki
2015-11-24 14:54             ` Hanjun Guo
2015-11-23 14:34 ` [PATCH 5/5] ASoC: Intel: Use acpi_dev_present Lukas Wunner
2015-11-23 14:48   ` Mark Brown
2015-11-23 22:37     ` Rafael J. Wysocki

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=5653C291.9090607@canonical.com \
    --to=hui.wang@canonical.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=devel@acpica.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=tiwai@suse.de \
    /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 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).