public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, LKML <linux-kernel@vger.kernel.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH] sound: Replace acpi_bus_get_device()
Date: Tue, 01 Feb 2022 08:11:24 +0100	[thread overview]
Message-ID: <s5hzgnb83j7.wl-tiwai@suse.de> (raw)
In-Reply-To: <2828205.e9J7NaK4W3@kreacher>

On Wed, 26 Jan 2022 20:48:49 +0100,
Rafael J. Wysocki wrote:
> 
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Replace acpi_bus_get_device() that is going to be dropped with
> acpi_fetch_acpi_dev().
> 
> No intentional functional impact.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Thanks, applied now to for-linus branch.

Mark, JFYI, this touches an ASoC code slightly, too.


Takashi

> ---
>  sound/hda/intel-sdw-acpi.c |    7 +++----
>  sound/soc/soc-acpi.c       |    7 ++-----
>  2 files changed, 5 insertions(+), 9 deletions(-)
> 
> Index: linux-pm/sound/hda/intel-sdw-acpi.c
> ===================================================================
> --- linux-pm.orig/sound/hda/intel-sdw-acpi.c
> +++ linux-pm/sound/hda/intel-sdw-acpi.c
> @@ -50,11 +50,11 @@ static bool is_link_enabled(struct fwnod
>  static int
>  sdw_intel_scan_controller(struct sdw_intel_acpi_info *info)
>  {
> -	struct acpi_device *adev;
> +	struct acpi_device *adev = acpi_fetch_acpi_dev(info->handle);
>  	int ret, i;
>  	u8 count;
>  
> -	if (acpi_bus_get_device(info->handle, &adev))
> +	if (!adev)
>  		return -EINVAL;
>  
>  	/* Found controller, find links supported */
> @@ -119,7 +119,6 @@ static acpi_status sdw_intel_acpi_cb(acp
>  				     void *cdata, void **return_value)
>  {
>  	struct sdw_intel_acpi_info *info = cdata;
> -	struct acpi_device *adev;
>  	acpi_status status;
>  	u64 adr;
>  
> @@ -127,7 +126,7 @@ static acpi_status sdw_intel_acpi_cb(acp
>  	if (ACPI_FAILURE(status))
>  		return AE_OK; /* keep going */
>  
> -	if (acpi_bus_get_device(handle, &adev)) {
> +	if (!acpi_fetch_acpi_dev(handle)) {
>  		pr_err("%s: Couldn't find ACPI handle\n", __func__);
>  		return AE_NOT_FOUND;
>  	}
> Index: linux-pm/sound/soc/soc-acpi.c
> ===================================================================
> --- linux-pm.orig/sound/soc/soc-acpi.c
> +++ linux-pm/sound/soc/soc-acpi.c
> @@ -55,16 +55,13 @@ EXPORT_SYMBOL_GPL(snd_soc_acpi_find_mach
>  static acpi_status snd_soc_acpi_find_package(acpi_handle handle, u32 level,
>  					     void *context, void **ret)
>  {
> -	struct acpi_device *adev;
> +	struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
>  	acpi_status status;
>  	struct snd_soc_acpi_package_context *pkg_ctx = context;
>  
>  	pkg_ctx->data_valid = false;
>  
> -	if (acpi_bus_get_device(handle, &adev))
> -		return AE_OK;
> -
> -	if (adev->status.present && adev->status.functional) {
> +	if (adev && adev->status.present && adev->status.functional) {
>  		struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
>  		union acpi_object  *myobj = NULL;
>  
> 
> 
> 

      reply	other threads:[~2022-02-01  7:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26 19:48 [PATCH] sound: Replace acpi_bus_get_device() Rafael J. Wysocki
2022-02-01  7:11 ` Takashi Iwai [this message]

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=s5hzgnb83j7.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=tiwai@suse.com \
    /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