From patchwork Fri May 17 19:47:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13667359 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 4A917C04FFE for ; Fri, 17 May 2024 19:54:24 +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=VRbBMB9NTg2ac6rZxhEJFeU5WNCoJ+Xn3Skk8hA+TDU=; b=JJe0mWGQCvTzvw +SvSPa2m2mRd9WOsGCZzRWyeCK/9RR2PTpAcL2vABBuxMKH/KK+oII2hH51AE0ma9girA6n53DJJp DEtAdWjTGHrmmbNDAZeMl10QcSa8D2zfduzqX4TUoJBqaMqjJcen+zeGROM8fjBORhc2QBAu3PYjB UrHiizVxdRJIQz2f0p+C9MKp4RU75+0efUsWN0rDk4o06jw5nIC1eSe/43OlgChSJQB4g8v+rbPVZ mK5FCxN2DMY1J0AyPl0+71NNEFdL+rMD63XoChF5vLrsAzD9OdQaz8ozs4OGWpzBCrvuyWjDY58Gq epNqJcfyBvIJcNJshFrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s83ee-00000008s54-0Ygf; Fri, 17 May 2024 19:54:12 +0000 Received: from mgamail.intel.com ([198.175.65.18]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s83eP-00000008ruS-231B for linux-arm-kernel@lists.infradead.org; Fri, 17 May 2024 19:53:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715975638; x=1747511638; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y0fN4jjiP8CI1asO2p9oSxaF0MzR6arWo4rn+6QIULI=; b=i714iwvFGrU0DJx+UEGeZyKlkIOSM1xCMY37oyRBUKLXWBrzt83gq2Lw MrZEUrfyb7SAfege3HH4sSAUqBAV+FjZABpjbNB+9ONO4BkHaFTeSW2w8 wQCIWBPu/8Givlr6G3d2UtHkH3x92tcrrv45+dGSHcGUwKaWjpSmAPMRB y4WttJMk+u/HX8idK/bfFQwYt99tK/pdauw3kiKOxGa73STR6OLZ4DHmr TyeiTJ0RMWN5amza5OwqK0gml+hYkOzSd/Jlf8jpRnsggx2CYEPE7e7Yg v4ip9dH+a45lDieypB0cT4TDtx+3RG87cAeY/IlkrxSv1isvg6xKzSqWo Q==; X-CSE-ConnectionGUID: 8UB1cqvhT4+7W2p57Jt1Eg== X-CSE-MsgGUID: 8qf3+Z/7SpyxqvVWU1HjcA== X-IronPort-AV: E=McAfee;i="6600,9927,11075"; a="12348677" X-IronPort-AV: E=Sophos;i="6.08,168,1712646000"; d="scan'208";a="12348677" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 12:53:52 -0700 X-CSE-ConnectionGUID: cp0OGmhWSwOiPsy7hw7/TA== X-CSE-MsgGUID: 44wEwEV0SbmoZyp3eCNvrw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,168,1712646000"; d="scan'208";a="31915017" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 17 May 2024 12:53:49 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 665A455A; Fri, 17 May 2024 22:53:45 +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 v1 07/10] spi: pxa2xx: Remove superflous check for Intel Atom SoCs Date: Fri, 17 May 2024 22:47:41 +0300 Message-ID: <20240517195344.813032-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240517195344.813032-1-andriy.shevchenko@linux.intel.com> References: <20240517195344.813032-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-20240517_125357_654036_94F033F7 X-CRM114-Status: GOOD ( 14.17 ) 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 cd28b798b53b..3ea4b9821a8e 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1371,23 +1371,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)