From patchwork Wed Feb 7 14:56:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 10205321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2C1D6056E for ; Wed, 7 Feb 2018 14:56:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF1B928FC3 for ; Wed, 7 Feb 2018 14:56:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3C6028FE1; Wed, 7 Feb 2018 14:56:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C60C28FC7 for ; Wed, 7 Feb 2018 14:56:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754421AbeBGO4S (ORCPT ); Wed, 7 Feb 2018 09:56:18 -0500 Received: from mga11.intel.com ([192.55.52.93]:25917 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754401AbeBGO4Q (ORCPT ); Wed, 7 Feb 2018 09:56:16 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2018 06:56:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,473,1511856000"; d="scan'208";a="32843067" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 07 Feb 2018 06:56:11 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 12A7EC5; Wed, 7 Feb 2018 16:56:10 +0200 (EET) From: Andy Shevchenko To: dmaengine , "Rafael J . Wysocki" , linux-acpi@vger.kernel.org, Mika Westerberg Cc: Andy Shevchenko , Sinan Kaya , Sakari Ailus , Vinod Koul Subject: [PATCH v3 1/5] ACPI / bus: Return error code from __acpi_match_device() in one case Date: Wed, 7 Feb 2018 16:56:06 +0200 Message-Id: <20180207145610.88434-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.15.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of playing tricks with last invalid entry, return simple -ENODATA error code cast to pointer. It would be good for future in case caller passes NULL pointer for ID table. Moreover, caller can check the code to be sure what happened inside callee. Fixes: 2b9c698efa58 ("ACPI / scan: Take the PRP0001 position in the list of IDs into account") Cc: Sinan Kaya Cc: Sakari Ailus Cc: Vinod Koul Signed-off-by: Andy Shevchenko --- drivers/acpi/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 58239abb0a72..761286e50067 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -769,7 +769,7 @@ static const struct acpi_device_id *__acpi_match_device( */ if (!strcmp(ACPI_DT_NAMESPACE_HID, hwid->id) && acpi_of_match_device(device, of_ids)) - return id; + return ERR_PTR(-ENODATA); } return NULL; }