From patchwork Thu Feb 1 20:20:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 10195969 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 C54A2605F5 for ; Thu, 1 Feb 2018 20:40:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B456B2841E for ; Thu, 1 Feb 2018 20:40:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B31262858F; Thu, 1 Feb 2018 20:40:10 +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 7E3C528765 for ; Thu, 1 Feb 2018 20:35:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754900AbeBAUUV (ORCPT ); Thu, 1 Feb 2018 15:20:21 -0500 Received: from mga05.intel.com ([192.55.52.43]:52169 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754892AbeBAUUT (ORCPT ); Thu, 1 Feb 2018 15:20:19 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2018 12:20:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,444,1511856000"; d="scan'208";a="15212715" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 01 Feb 2018 12:20:14 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 29E69141; Thu, 1 Feb 2018 22:20:12 +0200 (EET) From: Andy Shevchenko To: dmaengine , "Rafael J . Wysocki" , linux-acpi@vger.kernel.org Cc: Andy Shevchenko , Sinan Kaya , Sakari Ailus , Vinod Koul Subject: [PATCH v2 1/6] ACPI / bus: Return error code from __acpi_match_device() in one case Date: Thu, 1 Feb 2018 22:20:07 +0200 Message-Id: <20180201202012.36524-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 casted 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 --- v2: new patch 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 f87ed3be779a..a87a97bf75f8 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -762,7 +762,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; }