From patchwork Tue Apr 25 13:45:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 13223357 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 9C24BC6FD18 for ; Tue, 25 Apr 2023 13:46:42 +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=3po8kXip22qveFjlHhRvgqSJOYQtXJSdlrPMeRBXP8E=; b=K1JkeLT6IabRKA D5sJ6gmN8qAvmUr4LXzvyDwh+HqGm9hi4D4LxzfhwSYPnonS5QbrgK5kZDj6COUE/hUk2fxOIa2HT MBuuM73anx5w3D7UH2w77MErchtOLkqwUUUY6AjtHm7yB/IjpW2nM5V8RcAyCfrAd+9fqu6ary6Kq JU1diGx1Tbi5k9AI0EB0Dl58F8pztZI8PKSaceb1aDckfecd4fEQ6VLFBJOmawU9oAMoIZb0H1LYq ot8QMjoljoUfQ8O38+tY2w8t3Ro36kKlwAzZt1iTmjUPYOCReAb0srVZki3gRchmDh0JCu0q349Sn S8fPKpT4D06es0ViUTyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1prIzS-001IOV-0j; Tue, 25 Apr 2023 13:45:54 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1prIzC-001IIW-0g for linux-arm-kernel@lists.infradead.org; Tue, 25 Apr 2023 13:45:40 +0000 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-94f910ea993so872039666b.3 for ; Tue, 25 Apr 2023 06:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; t=1682430333; x=1685022333; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E4sRdWC2cDHZjejBYhhOCUr1iFuyu6C1Fz1Mden7vTg=; b=Z+SKr1Ux8TXyogmCHsNc4/c9jBYnw/ezmC0VGtD1fZH6kazcZAF/QNVU+NXutbp4tt gDMLMyvaf3VlLPBJN6PxnB9PSBlCbSGoN3hQ67YfPy85ej2Efk2mrrPj5C3R+yEeu5bj b+ID2oi1EGUK8rhRUgZpj6hu8zzOpzOdayHS8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682430333; x=1685022333; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E4sRdWC2cDHZjejBYhhOCUr1iFuyu6C1Fz1Mden7vTg=; b=j+ASZRPeYXgBGFuczikJjAitRBkjsyMr/0b/e9Rg8nATujcU68elSyaqv3vfBbVZEu NomEGvFRsO0SN9pTi0YvlEftM8ijVzb3sKiNTq8PWXZapUE0RC7RiHIbWKzG36dXVxUv Ij1I90m3VTkENeqoShTVKrnetE779UEmRcjWOBfjlPaCqEfhi3K2+ZbdBJr9/ATW8Mbe i2tfzGzflQ/0vh2/0WFqijlQK4TMFvnsrf71nRGoJDG0KduTWmlYkRG2wxre9pnM3mYK 4zlOcq7dgZ/DyG6kIEtX6lvJyNgUwgq5pPMWZNkXLGeDoT095zuEnszV8+oIc/eu5OCu 5mcg== X-Gm-Message-State: AAQBX9ePvecPWFD+u1Ik4lugW27r9SnD6MyrXbj7hFl23rkjgF/GNKzE XfLNnu/tJNj73c9xIENC57AZWNVsvejRRl72BNlt+RVM X-Google-Smtp-Source: AKy350bel0saz0NNkLMsNuHNUBFgQRefYyEt6zhsCW5VrBurn20Uw4hMW3itsS+i0T2zY7/JuQWDyw== X-Received: by 2002:a17:906:7686:b0:956:f4f8:23b6 with SMTP id o6-20020a170906768600b00956f4f823b6mr13168543ejm.43.1682430332774; Tue, 25 Apr 2023 06:45:32 -0700 (PDT) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id f10-20020a170906048a00b0094eeea5c649sm6806822eja.114.2023.04.25.06.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 06:45:32 -0700 (PDT) From: Rasmus Villemoes To: Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: Marc Kleine-Budde , Rasmus Villemoes , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] spi: spi-imx: use "controller" variable consistently in spi_imx_probe() Date: Tue, 25 Apr 2023 15:45:25 +0200 Message-Id: <20230425134527.483607-2-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230425134527.483607-1-linux@rasmusvillemoes.dk> References: <20230425134527.483607-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230425_064538_246459_98E05955 X-CRM114-Status: GOOD ( 13.34 ) 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 Near the top of the function, spi_imx->controller is set to controller (and is of course never modified again). The rest of the function uses a mix of the two expressions. For consistency, readability and better code generation, drop all the spi_imx-> indirections. Signed-off-by: Rasmus Villemoes --- drivers/spi/spi-imx.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index e4ccd0c329d0..6fa53a82674a 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1725,20 +1725,20 @@ static int spi_imx_probe(struct platform_device *pdev) else controller->num_chipselect = 3; - spi_imx->controller->transfer_one = spi_imx_transfer_one; - spi_imx->controller->setup = spi_imx_setup; - spi_imx->controller->cleanup = spi_imx_cleanup; - spi_imx->controller->prepare_message = spi_imx_prepare_message; - spi_imx->controller->unprepare_message = spi_imx_unprepare_message; - spi_imx->controller->slave_abort = spi_imx_slave_abort; - spi_imx->controller->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_NO_CS; + controller->transfer_one = spi_imx_transfer_one; + controller->setup = spi_imx_setup; + controller->cleanup = spi_imx_cleanup; + controller->prepare_message = spi_imx_prepare_message; + controller->unprepare_message = spi_imx_unprepare_message; + controller->slave_abort = spi_imx_slave_abort; + controller->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_NO_CS; if (is_imx35_cspi(spi_imx) || is_imx51_ecspi(spi_imx) || is_imx53_ecspi(spi_imx)) - spi_imx->controller->mode_bits |= SPI_LOOP | SPI_READY; + controller->mode_bits |= SPI_LOOP | SPI_READY; if (is_imx51_ecspi(spi_imx) || is_imx53_ecspi(spi_imx)) - spi_imx->controller->mode_bits |= SPI_RX_CPHA_FLIP; + controller->mode_bits |= SPI_RX_CPHA_FLIP; if (is_imx51_ecspi(spi_imx) && device_property_read_u32(&pdev->dev, "cs-gpios", NULL)) @@ -1747,7 +1747,7 @@ static int spi_imx_probe(struct platform_device *pdev) * setting the burst length to the word size. This is * considerably faster than manually controlling the CS. */ - spi_imx->controller->mode_bits |= SPI_CS_WORD; + controller->mode_bits |= SPI_CS_WORD; spi_imx->spi_drctl = spi_drctl;