From patchwork Thu May 30 15:10:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13680535 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7303CC25B74 for ; Thu, 30 May 2024 15:12:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dnZBWsBTcCaikMCz8APIlMnxr4VR7/ZrtZ0smHcUiwY=; b=N3sAlq0A56wLXW 6qEwAc0Wa+AzCRdzciAWWrwFDEJyBWMRWhZFdwxf0YE0BrcwxokmpKtCmA4XThVVQHk7v2385rney dbxuwZ5O3TwBCPtfm8Cl29GCArUKNw/lgbVkjTFCFU7uvh7yc6YrgBBy6+7Sr1zTmWK9nbi+82lD+ L1P/rK50mtW85n8mF9wrkjeEERU4dtJ872r/fDklLd6Kfq9Ph52rYU0n2FCcsZniwV9V4wjyVG/6P j0KuS97NPQ0/QkoTHP5vbMgspSyFBwnCzAlD07EYTpxxO4F1MfzW+qwSesrW2qlXV/iHcMqNCj2QP q69GJo6S1/ffdYN24syA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sChRd-00000007f6F-2e2T; Thu, 30 May 2024 15:11:57 +0000 Received: from mgamail.intel.com ([198.175.65.10]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sChRB-00000007enA-1JTt for linux-arm-kernel@lists.infradead.org; Thu, 30 May 2024 15:11:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717081889; x=1748617889; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YN44JYZqoEKQIIQ+HPXBPHzx9SDRMV97fZqyIcUXYdE=; b=mJZeP/URwGMSnCpWylvdoe29ekyhbltR25yERAZzAlbrbPGsqzxgmyey wYqnP9c8MsD8tjmtfGAf1N5V5720zmBm3HTzlyHfH25AWZin7URD2ittE Et/VhiZGWCDif4rbgfJFd9EoV++KsoFS7HhuGvVt0+leeaCng5aLaYulM A7+WK6aVYdjywERiLqCLfCxzZAlrAkiIcC+yqq4OFhbpxIuXN8Qv3LTt0 0WUVxuW/bP12eU/yGq2o7mcfcdKKrb8iI2mrBqgOLKP3FlWSVWkHTAZrs wtH4vH2xbrNBVnmRKlYi5beGI3xo7XDFZVBUWt/oCp8E2bPJ3cjCaS+4K w==; X-CSE-ConnectionGUID: 1Imkd0SYRh6gi32IgbcBvw== X-CSE-MsgGUID: uUBZI/jpTy6NKZKONj+fkQ== X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="31067950" X-IronPort-AV: E=Sophos;i="6.08,201,1712646000"; d="scan'208";a="31067950" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 08:11:25 -0700 X-CSE-ConnectionGUID: s1k/pvsFTLmW63bqcbIURg== X-CSE-MsgGUID: ZULTayxvTv6OSYz0zy9cQA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,201,1712646000"; d="scan'208";a="73329437" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa001.jf.intel.com with ESMTP; 30 May 2024 08:11:24 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7677D700; Thu, 30 May 2024 18:11:19 +0300 (EEST) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , Linus Walleij , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: [PATCH v2 08/11] spi: pxa2xx: Remove superflous check for Intel Atom SoCs Date: Thu, 30 May 2024 18:10:04 +0300 Message-ID: <20240530151117.1130792-9-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240530151117.1130792-1-andriy.shevchenko@linux.intel.com> References: <20240530151117.1130792-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240530_081129_688556_8305CE89 X-CRM114-Status: GOOD ( 14.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org pxa2xx_spi_fw_translate_cs() checks for the ACPI companion device presence along with the SSP type. But the SSP type is uniquely determines the case. Hence remove the superflous check. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 9724d9455837..3c03a8cd9ee6 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1393,23 +1393,19 @@ static int pxa2xx_spi_fw_translate_cs(struct spi_controller *controller, { struct driver_data *drv_data = spi_controller_get_devdata(controller); - if (has_acpi_companion(drv_data->ssp->dev)) { - switch (drv_data->ssp_type) { - /* - * For Atoms the ACPI DeviceSelection used by the Windows - * driver starts from 1 instead of 0 so translate it here - * to match what Linux expects. - */ - case LPSS_BYT_SSP: - case LPSS_BSW_SSP: - return cs - 1; + switch (drv_data->ssp_type) { + /* + * For some of Intel Atoms the ACPI DeviceSelection used by the Windows + * driver starts from 1 instead of 0 so translate it here to match what + * Linux expects. + */ + case LPSS_BYT_SSP: + case LPSS_BSW_SSP: + return cs - 1; - default: - break; - } + default: + return cs; } - - return cs; } static size_t pxa2xx_spi_max_dma_transfer_size(struct spi_device *spi)