All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Zhang Rui <rui.zhang@intel.com>
Cc: rjw@sisk.pl, linux-pm@vger.kernel.org,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 11/27] i915: intel_acpi: convert acpi_get_handle() to acpi_has_method()
Date: Mon, 9 Sep 2013 10:57:48 +0200	[thread overview]
Message-ID: <20130909085748.GD27291@phenom.ffwll.local> (raw)
In-Reply-To: <1378168335-22556-12-git-send-email-rui.zhang@intel.com>

On Tue, Sep 03, 2013 at 08:31:59AM +0800, Zhang Rui wrote:
> acpi_has_method() is a new ACPI API introduced to check
> the existence of an ACPI control method.
> 
> It can be used to replace acpi_get_handle() in the case that
> 1. the calling function doesn't need the ACPI handle of the control method.
> and
> 2. the calling function doesn't care the reason why the method is unavailable.
> 
> Convert acpi_get_handle() to acpi_has_method()
> in drivers/gpu/drm/i915/intel_acpi.c in this patch.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> CC: Daniel Vetter <daniel.vetter@ffwll.ch>

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/i915/intel_acpi.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_acpi.c b/drivers/gpu/drm/i915/intel_acpi.c
> index 57fe1ae..43959ed 100644
> --- a/drivers/gpu/drm/i915/intel_acpi.c
> +++ b/drivers/gpu/drm/i915/intel_acpi.c
> @@ -193,16 +193,14 @@ static void intel_dsm_platform_mux_info(void)
>  
>  static bool intel_dsm_pci_probe(struct pci_dev *pdev)
>  {
> -	acpi_handle dhandle, intel_handle;
> -	acpi_status status;
> +	acpi_handle dhandle;
>  	int ret;
>  
>  	dhandle = DEVICE_ACPI_HANDLE(&pdev->dev);
>  	if (!dhandle)
>  		return false;
>  
> -	status = acpi_get_handle(dhandle, "_DSM", &intel_handle);
> -	if (ACPI_FAILURE(status)) {
> +	if (!acpi_has_method(dhandle, "_DSM")) {
>  		DRM_DEBUG_KMS("no _DSM method for intel device\n");
>  		return false;
>  	}
> -- 
> 1.8.1.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2013-09-09  8:57 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03  0:31 [PATCH 00/27] ACPI AML helper conversion Zhang Rui
2013-09-03  0:31 ` [PATCH 01/27] olpc_xo15_sci: convert acpi_evaluate_object() to acpi_execute_simple_method() Zhang Rui
2013-09-03  0:31 ` [PATCH 02/27] gpiolib-acpi: " Zhang Rui
2013-09-03  7:17   ` Mika Westerberg
2013-09-03  7:42   ` Mathias Nyman
2013-09-17 12:55   ` Linus Walleij
2013-09-03  0:31 ` [PATCH 03/27] eeepc-laptop: " Zhang Rui
2013-09-03  0:31 ` [PATCH 04/27] fujitsu-laptop: " Zhang Rui
2013-09-03 13:11   ` Jonathan Woithe
2013-09-03  0:31 ` [PATCH 05/27] intel-rst: " Zhang Rui
2013-09-03  0:31 ` [PATCH 06/27] intel-smartconnect: " Zhang Rui
2013-09-03  0:31 ` [PATCH 07/27] topstar-laptop: " Zhang Rui
2013-09-03  0:31 ` [PATCH 08/27] toshiba_acpi: " Zhang Rui
2013-09-03  0:31 ` [PATCH 09/27] wmi: " Zhang Rui
2013-09-03  0:31 ` [PATCH 10/27] pcc_freq: convert acpi_get_handle() to acpi_has_method() Zhang Rui
2013-09-03  0:31 ` [PATCH 11/27] i915: intel_acpi: " Zhang Rui
2013-09-09  8:57   ` Daniel Vetter [this message]
2013-09-03  0:32 ` [PATCH 12/27] nouveau_acpi: " Zhang Rui
2013-09-03  0:32 ` [PATCH 13/27] acpi_pcihp: " Zhang Rui
2013-09-03  0:32 ` [PATCH 14/27] pci-acpi: " Zhang Rui
2013-09-03  0:32 ` [PATCH 15/27] fujitsu-laptop: " Zhang Rui
2013-09-03 13:11   ` Jonathan Woithe
2013-09-03  0:32 ` [PATCH 16/27] intel_menlow: " Zhang Rui
2013-09-03  0:32 ` [PATCH 17/27] sony-laptop: " Zhang Rui
2013-09-03  0:32 ` [PATCH 18/27] toshiba_acpi: " Zhang Rui
2013-09-03  0:32 ` [PATCH 19/27] wmi: " Zhang Rui
2013-09-03  0:32 ` [PATCH 20/27] pnpacpi: " Zhang Rui
2013-09-03  0:32 ` [PATCH 21/27] acpi_processor: convert acpi_evaluate_object() to acpi_evaluate_integer() Zhang Rui
2013-09-03  0:32 ` [PATCH 22/27] ACPI: dock: " Zhang Rui
2013-09-03  0:32 ` [PATCH 23/27] i2c-hid: " Zhang Rui
2013-09-04 10:14   ` Jiri Kosina
2013-09-06  8:17     ` Benjamin Tissoires
2013-09-03  0:32 ` [PATCH 24/27] fujitsu-laptop: " Zhang Rui
2013-09-03 13:12   ` Jonathan Woithe
2013-09-03  0:32 ` [PATCH 25/27] intel-rst: " Zhang Rui
2013-09-03  0:32 ` [PATCH 26/27] intel-smartconnect: " Zhang Rui
2013-09-03  0:32 ` [PATCH 27/27] toshiba_acpi: " Zhang Rui
2013-09-03 11:24 ` [PATCH 00/27] ACPI AML helper conversion 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=20130909085748.GD27291@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=rui.zhang@intel.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 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.