From patchwork Mon Dec 7 13:59:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11956061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79F86C4361B for ; Mon, 7 Dec 2020 14:02:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2DB1823444 for ; Mon, 7 Dec 2020 14:02:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DB1823444 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=X733NkabxriaJfHJDP4MK7UkZ9agc54nc6J0IGqSvQ8=; b=2vnZ8L4SYTTc87yhJIB9m5Tel 2ctsE54zUIUEcC7FCQ9I5me2dhvqzyMMA4WHgxIf0NgTQrJBJMALEmCvfUQ7hiUn6Ou0xR5Na+rjv jHp9wtwkPJnKyFCANmGAyh+RnSGuVBl7ePp9YJz21Ru3WQpyrrRlWv0CEkiNI2ZungO+ZnQyb+cz4 fy+qq3y40yuHMNcmk3af6OGiL2oOnFylvelu78JBiU93rp/hDEiforfHUTREDVqnAZfHACa/lk3jM KhO0Qc+ESukDhzVbpDMujoexavgSNi1eGNE026GorpOP0qIrZkmCr3a+X6Zz7Con+sFetC3bCYEAC kp2r2/uMA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmH4c-0008T4-78; Mon, 07 Dec 2020 14:01:06 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmH4N-0008Od-7J for linux-arm-kernel@lists.infradead.org; Mon, 07 Dec 2020 14:00:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1607349651; x=1638885651; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eeY1Cu1aRr4raFHWenqciKug7r63tyMvIkoHojS1q4Y=; b=X/iUkQpY+r84pSYIPk2dZkva8YL+Yl9NVnr7Y/RPbcfPxFHSFue95/+C C3Ley1yUiEyGrPUIyWtxT9ULB7t1qcAgi2CofSjP2N4wNZFTftvSDxsIK hVELZcVxyrd2syAom1moHnFwoQYz9aQJexkgXOL7gl1bNofKTayAUGDCk HJanrpKdL3e5tAAD755vOAlGzNsjXRncBd96klcCa7vrZXg18DOs4nFsI +vfbEVQgjReV0GDeOuZI1kLaltgzvZJ0tuER3Uzb2l9wpsZ6XibjyE712 cnPDgWm+Ah9r7BHCAaua7kZVU1MyX37DCR7OvL+qW0BX5Jh/tn0II9WA5 g==; IronPort-SDR: 2farel37RSxeDW+4apm/Dd357J901m99jMAViQJ00OL9CRQXVWb2Lr5oghYV9q81a5oOW8x4Db pjXGhdfiJ03nM7Wu9QZ1CqQI3yCHeSL0kFzbxsOBuJIXnOKwilRN/MgIIZnC17vHi+9OoMpkMH uuH9oUnKZjw+oU7bruFVHkA5dRzJlEhH63gHEUEWtA4UEweUukiprqpAwkSrg9KRLDHtxNc76V gvra2bQ2cVYCKMaKU4AiZQT712ueMaFROCCm671piT9s504gHQdWn0LECWDzIM2wIpMnE7392U SBc= X-IronPort-AV: E=Sophos;i="5.78,399,1599548400"; d="scan'208";a="101740189" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Dec 2020 07:00:48 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 7 Dec 2020 07:00:47 -0700 Received: from atudor-ThinkPad-T470p.amer.actel.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 7 Dec 2020 07:00:45 -0700 From: Tudor Ambarus To: , Subject: [PATCH 4/4] spi: atmel-quadspi: Move common code outside of if else Date: Mon, 7 Dec 2020 15:59:59 +0200 Message-ID: <20201207135959.154124-5-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201207135959.154124-1-tudor.ambarus@microchip.com> References: <20201207135959.154124-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201207_090051_586333_CEED1791 X-CRM114-Status: GOOD ( 10.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor Ambarus , linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, bugalski.piotr@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org QSPI_IFR is set as the last QSPI Instruction Frame register regardless of the sama5d2 or sam9x60 version of the IP. Move the writing of QSPI_IFR outside of the IP specific code. Signed-off-by: Tudor Ambarus --- drivers/spi/atmel-quadspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index 5fd0dc70bd74..f4f3d5c9ce50 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -394,15 +394,15 @@ static int atmel_qspi_set_cfg(struct atmel_qspi *aq, atmel_qspi_write(icr, aq, QSPI_RICR); else atmel_qspi_write(icr, aq, QSPI_WICR); - atmel_qspi_write(ifr, aq, QSPI_IFR); } else { if (op->data.nbytes && op->data.dir == SPI_MEM_DATA_OUT) ifr |= QSPI_IFR_SAMA5D2_WRITE_TRSFR; atmel_qspi_write(icr, aq, QSPI_ICR); - atmel_qspi_write(ifr, aq, QSPI_IFR); } + atmel_qspi_write(ifr, aq, QSPI_IFR); + return 0; }