Message ID | 20230118080419.20880-1-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2220464wrn; Wed, 18 Jan 2023 00:55:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXvoyUea49fGnzxqQrfbswOAu7xHQO9iVYtXkJVi7L8aEv+1v3T+fcGhXCBhIgqNSAbDyEF2 X-Received: by 2002:a17:907:971d:b0:870:d15a:c2dc with SMTP id jg29-20020a170907971d00b00870d15ac2dcmr7389230ejc.74.1674032148188; Wed, 18 Jan 2023 00:55:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674032148; cv=none; d=google.com; s=arc-20160816; b=qKPzk6BOF5KUA8Q40LkxBdtw+ZqKAJeKnfACCB4UP+8lIzWb2V41D/Utnt5GIOTFab GoG6wSlyIC800FjAZwylQNoWqERj9S65qQf3AONl3fJpJwUhjR0cDfRRVZmVFO2ae2xw /15bTj/mo1gyFlJ18x+DwqOguDPCxosfNsAvAhL9ZNeueCePt7J8Ubwiemsc15D8TJWq 3L4wRMc1DTmWb4enB6h+uY5qfldCUNlyymjsoW/teuTg58JqPeb3CkLAVlN+BixrG5Hh CbaNeEOoJBYuhiPGRWxCyxO3IfgqoG98kZF6rlrnOcrwJr1TRq9CWgDTUVAB+B/MHAuc 3Y5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7kT+IIhFCXHjNvylfgsbgtBvKHTr6XgOxLB9MS8Z47k=; b=uTTss+T0ND1hg+8U15tAbFKtyByidZHqkqq/uKSj3/Ph2Z8Ph+B6lOSUpEVR0VGyjX dFdw9kLzbZIU5Tym5KGgggYZLucSBe3j1BAeR4HK1EfD+sbpq7iUSYG2rCToM7RU9dRU PG0nsm8PFMjBUnB/3EfPYep6LS6omf6hDHVmHgKJJoK5oIgq5o+GpXWWMBaIrtB3yJ9T yjB48zI5p5/JpN/hOD1SpulG9HnzOw7PhVUS0IU7YIafzojWLUoNpK9IwD760RAJdaUm RS3jT93B5VYIV74YZ1tsUEPSASe3gvw+rH0Gfq+EtcUv/L7wL8yHl+XQnUeJfdX8AMXZ fgig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fciArdk0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cx18-20020a170906c81200b00870ecd1a337si7293226ejb.460.2023.01.18.00.55.23; Wed, 18 Jan 2023 00:55:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fciArdk0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229657AbjARIwg (ORCPT <rfc822;pfffrao@gmail.com> + 99 others); Wed, 18 Jan 2023 03:52:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbjARIwJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 18 Jan 2023 03:52:09 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1354B5D917; Wed, 18 Jan 2023 00:04:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674029051; x=1705565051; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=JbyoyULxuDQD7DcV3gzSYDDU8vRCK87BqFyBt9ZRusA=; b=fciArdk0vwXamoxyjYmG9jN+aLCPdUSk4YSVq02Oeuiu+J/+xDqCtUdh FiGYPpH1tpzi9Wix1So1UsH+4BRxgtV3CinH0OnHfHno2iMCip+WilKFi nRK0gKsbGShrj7elv/W8uiJgEwAr6QEBUximgcffuLz/AX7X1RAqqf6M+ eHA+N1+tOHUwmvm9R8BiN0V6RLaDUiPcvpaTP3dSHR+j/2R/YQz98FjkH dFWhZexnoZm8DpQYGE/CgYh9ge21tN1RJY2ipjl/ue8rBI2qtUN4PIypG FaTGIYqzPKMc29WrbrPW280HjGmJfr4TZttkVcT8cyKV26mC/Nstk/0AI Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="411164489" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="411164489" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 00:03:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="637176612" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="637176612" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 18 Jan 2023 00:03:47 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id D64CD256; Wed, 18 Jan 2023 10:04:21 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Mathias Nyman <mathias.nyman@linux.intel.com>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com> Subject: [PATCH v1 1/1] usb: acpi: Switch to use acpi_evaluate_dsm_typed() Date: Wed, 18 Jan 2023 10:04:19 +0200 Message-Id: <20230118080419.20880-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755349933741268957?= X-GMAIL-MSGID: =?utf-8?q?1755349933741268957?= |
Series |
[v1,1/1] usb: acpi: Switch to use acpi_evaluate_dsm_typed()
|
|
Commit Message
Andy Shevchenko
Jan. 18, 2023, 8:04 a.m. UTC
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/usb/core/usb-acpi.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
Comments
On Wed, Jan 18, 2023 at 10:04:19AM +0200, 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> > --- > drivers/usb/core/usb-acpi.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c > index 533baa85083c..a34b22537d7c 100644 > --- a/drivers/usb/core/usb-acpi.c > +++ b/drivers/usb/core/usb-acpi.c > @@ -81,15 +81,11 @@ int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index) > return -ENODEV; > } > > - obj = acpi_evaluate_dsm(port_handle, &guid, 0, > - USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL); > - > - if (!obj) > - return -ENODEV; > - > - if (obj->type != ACPI_TYPE_INTEGER) { > + obj = acpi_evaluate_dsm_typed(port_handle, &guid, 0, > + USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL, > + ACPI_TYPE_INTEGER); > + if (!obj) { > dev_dbg(&hdev->dev, "evaluate port-%d _DSM failed\n", port1); > - ACPI_FREE(obj); > return -EINVAL; > } > > -- > 2.39.0 > Fails to apply to my tree :(
On Thu, Jan 19, 2023 at 02:11:15PM +0100, Greg Kroah-Hartman wrote: > On Wed, Jan 18, 2023 at 10:04:19AM +0200, 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. ... > Fails to apply to my tree :( It seems it's against usb-linus as Mathias' original patch is there.
On Thu, Jan 19, 2023 at 04:37:12PM +0200, Andy Shevchenko wrote: > On Thu, Jan 19, 2023 at 02:11:15PM +0100, Greg Kroah-Hartman wrote: > > On Wed, Jan 18, 2023 at 10:04:19AM +0200, 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. > > ... > > > Fails to apply to my tree :( > > It seems it's against usb-linus as Mathias' original patch is there. Ah, then that can wait until it merges into my usb-next branch. Can you resend it in a week or so when that happens? thanks, greg k-h
On Thu, Jan 19, 2023 at 04:14:23PM +0100, Greg Kroah-Hartman wrote: > On Thu, Jan 19, 2023 at 04:37:12PM +0200, Andy Shevchenko wrote: > > On Thu, Jan 19, 2023 at 02:11:15PM +0100, Greg Kroah-Hartman wrote: > > > On Wed, Jan 18, 2023 at 10:04:19AM +0200, Andy Shevchenko wrote: ... > > > Fails to apply to my tree :( > > > > It seems it's against usb-linus as Mathias' original patch is there. > > Ah, then that can wait until it merges into my usb-next branch. Can you > resend it in a week or so when that happens? Sure, thanks!
diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c index 533baa85083c..a34b22537d7c 100644 --- a/drivers/usb/core/usb-acpi.c +++ b/drivers/usb/core/usb-acpi.c @@ -81,15 +81,11 @@ int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index) return -ENODEV; } - obj = acpi_evaluate_dsm(port_handle, &guid, 0, - USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL); - - if (!obj) - return -ENODEV; - - if (obj->type != ACPI_TYPE_INTEGER) { + obj = acpi_evaluate_dsm_typed(port_handle, &guid, 0, + USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL, + ACPI_TYPE_INTEGER); + if (!obj) { dev_dbg(&hdev->dev, "evaluate port-%d _DSM failed\n", port1); - ACPI_FREE(obj); return -EINVAL; }