Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [PATCH v1 1/1] mmc: sdhci-pci: Switch to use acpi_evaluate_dsm_typed()
@ 2023-10-02 13:51 Andy Shevchenko
  2023-10-09 16:15 ` Adrian Hunter
  2023-10-10 14:27 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2023-10-02 13:51 UTC (permalink / raw)
  To: Ulf Hansson, Adrian Hunter, linux-mmc, linux-kernel; +Cc: Andy Shevchenko

The acpi_evaluate_dsm_typed() provides a way to check the type of the
object evaluated by _DSM call. Use it instead of open coded variant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mmc/host/sdhci-pci-core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
index 7c14feb5db77..025b31aa712c 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -483,11 +483,12 @@ static int __intel_dsm(struct intel_host *intel_host, struct device *dev,
 	int err = 0;
 	size_t len;
 
-	obj = acpi_evaluate_dsm(ACPI_HANDLE(dev), &intel_dsm_guid, 0, fn, NULL);
+	obj = acpi_evaluate_dsm_typed(ACPI_HANDLE(dev), &intel_dsm_guid, 0, fn, NULL,
+				      ACPI_TYPE_BUFFER);
 	if (!obj)
 		return -EOPNOTSUPP;
 
-	if (obj->type != ACPI_TYPE_BUFFER || obj->buffer.length < 1) {
+	if (obj->buffer.length < 1) {
 		err = -EINVAL;
 		goto out;
 	}
-- 
2.40.0.1.gaa8946217a0b


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

* Re: [PATCH v1 1/1] mmc: sdhci-pci: Switch to use acpi_evaluate_dsm_typed()
  2023-10-02 13:51 [PATCH v1 1/1] mmc: sdhci-pci: Switch to use acpi_evaluate_dsm_typed() Andy Shevchenko
@ 2023-10-09 16:15 ` Adrian Hunter
  2023-10-10 14:27 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2023-10-09 16:15 UTC (permalink / raw)
  To: Andy Shevchenko, Ulf Hansson, linux-mmc, linux-kernel

On 2/10/23 16:51, Andy Shevchenko wrote:
> The acpi_evaluate_dsm_typed() provides a way to check the type of the
> object evaluated by _DSM call. Use it instead of open coded variant.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-pci-core.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
> index 7c14feb5db77..025b31aa712c 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -483,11 +483,12 @@ static int __intel_dsm(struct intel_host *intel_host, struct device *dev,
>  	int err = 0;
>  	size_t len;
>  
> -	obj = acpi_evaluate_dsm(ACPI_HANDLE(dev), &intel_dsm_guid, 0, fn, NULL);
> +	obj = acpi_evaluate_dsm_typed(ACPI_HANDLE(dev), &intel_dsm_guid, 0, fn, NULL,
> +				      ACPI_TYPE_BUFFER);
>  	if (!obj)
>  		return -EOPNOTSUPP;
>  
> -	if (obj->type != ACPI_TYPE_BUFFER || obj->buffer.length < 1) {
> +	if (obj->buffer.length < 1) {
>  		err = -EINVAL;
>  		goto out;
>  	}


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

* Re: [PATCH v1 1/1] mmc: sdhci-pci: Switch to use acpi_evaluate_dsm_typed()
  2023-10-02 13:51 [PATCH v1 1/1] mmc: sdhci-pci: Switch to use acpi_evaluate_dsm_typed() Andy Shevchenko
  2023-10-09 16:15 ` Adrian Hunter
@ 2023-10-10 14:27 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2023-10-10 14:27 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Adrian Hunter, linux-mmc, linux-kernel

On Mon, 2 Oct 2023 at 15:51, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> The acpi_evaluate_dsm_typed() provides a way to check the type of the
> object evaluated by _DSM call. Use it instead of open coded variant.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-pci-core.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
> index 7c14feb5db77..025b31aa712c 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -483,11 +483,12 @@ static int __intel_dsm(struct intel_host *intel_host, struct device *dev,
>         int err = 0;
>         size_t len;
>
> -       obj = acpi_evaluate_dsm(ACPI_HANDLE(dev), &intel_dsm_guid, 0, fn, NULL);
> +       obj = acpi_evaluate_dsm_typed(ACPI_HANDLE(dev), &intel_dsm_guid, 0, fn, NULL,
> +                                     ACPI_TYPE_BUFFER);
>         if (!obj)
>                 return -EOPNOTSUPP;
>
> -       if (obj->type != ACPI_TYPE_BUFFER || obj->buffer.length < 1) {
> +       if (obj->buffer.length < 1) {
>                 err = -EINVAL;
>                 goto out;
>         }
> --
> 2.40.0.1.gaa8946217a0b
>

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

end of thread, other threads:[~2023-10-10 14:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-02 13:51 [PATCH v1 1/1] mmc: sdhci-pci: Switch to use acpi_evaluate_dsm_typed() Andy Shevchenko
2023-10-09 16:15 ` Adrian Hunter
2023-10-10 14:27 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox