From patchwork Sat Jul 9 00:07:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12912001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50516C43334 for ; Sat, 9 Jul 2022 00:07:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229594AbiGIAHz (ORCPT ); Fri, 8 Jul 2022 20:07:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiGIAHQ (ORCPT ); Fri, 8 Jul 2022 20:07:16 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEDCF66B85; Fri, 8 Jul 2022 17:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657325229; x=1688861229; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cpONHfvICP0pLZXFSpNN1+uSymjEqhVrTSEJEUFETFI=; b=kUqRGrkshvFWGaxINcdFvZsGEVFUoHgehsmv1AUvshWSA2ThYv1CYbHW 0iFEKWcvyAXG+PipFD54k+Dvo/6xzkCU4drBx4vLHDivbVuX2j8xdKWq0 nROOjQx4t4FGWpcrBXm1Rw/Wmum9q99ifWLCmQ2/Y3xK9As7eJTtPCwAH z2e0GRV9oHOIqWO88xQudxSAejtJ78/mfu6QrKDxuekVjelezfL9aH5tR 6C1gHZWEU3AzZncjMgPenryH4sz1AAw5q/zeFaarCxPj21wpW6GGL9iKa 8R6k7Fem5lgGNh4JZAwJhyM+YAsFynemrTxq88yiPfiIepeKVKzpChLv3 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10402"; a="284411926" X-IronPort-AV: E=Sophos;i="5.92,256,1650956400"; d="scan'208";a="284411926" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2022 17:07:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,256,1650956400"; d="scan'208";a="840459575" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 08 Jul 2022 17:07:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C44D1CE; Sat, 9 Jul 2022 03:07:14 +0300 (EEST) From: Andy Shevchenko To: Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 1/2] spi: propagate error code to the caller of acpi_spi_device_alloc() Date: Sat, 9 Jul 2022 03:07:08 +0300 Message-Id: <20220709000709.35622-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Since acpi_spi_device_alloc() has been designed to return an error pointer we may now properly propagate error codes to the caller of it. It helps debugging a lot. Signed-off-by: Andy Shevchenko --- drivers/spi/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 0690f018c413..d4a8665410ea 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2565,7 +2565,7 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr, if (ret < 0) /* Found SPI in _CRS but it points to another controller */ - return ERR_PTR(-ENODEV); + return ERR_PTR(ret); if (!lookup.max_speed_hz && ACPI_SUCCESS(acpi_get_parent(adev->handle, &parent_handle)) &&