From patchwork Mon Apr 20 10:33:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1273249 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=I63VxZWD; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 495NNc6SLgz9sSd for ; Mon, 20 Apr 2020 20:34:24 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2DB4581C84; Mon, 20 Apr 2020 12:34:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="I63VxZWD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 13A5481C98; Mon, 20 Apr 2020 12:34:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,SUBJ_OBFU_PUNCT_FEW,SUBJ_OBFU_PUNCT_MANY, T_SPF_HELO_TEMPERROR autolearn=no autolearn_force=no version=3.4.2 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 704F181C9C for ; Mon, 20 Apr 2020 12:33:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pj1-x1043.google.com with SMTP id my1so72539pjb.1 for ; Mon, 20 Apr 2020 03:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id; bh=Mpw2FJdmEyqPSl5hSItWnlvzDnagVp8BPgS5nUh5Zxc=; b=I63VxZWDmGBS3oSv+N6V4AwAc8JCI0ENSvDr/NxAApBs3C5n8XkxYSadyHSMrqRX9Q vIxnx5+xzY/hg1sJ0PryWYdwWNlHnSB3ZWQdkkV4FekBhSJGPhbnsf/v5tPiBmH9nLDC VzTjw2HqxvakLDK8jn6QQ5xnZx03QJ2/Uibb8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Mpw2FJdmEyqPSl5hSItWnlvzDnagVp8BPgS5nUh5Zxc=; b=K6B/9WR4ViQtjCgIrQzKBL8hSTpa2ivwB56GURWdhRdqJiBfJ/Ji1A05Q2KROxtN2p Xf3fIabVFFzr56tgXY9x7GEHLX1Z6m01gdsHPKReW+LzAo5y0dqk/KPnaomlbLfmjgC7 iMgBE9PYdLxTG68FIJEfxPQXu+mJNtKJMi9hsIXWjOc6idOCeczifCcYeO89wlFXUsB9 1gTIgNvk35OSh2sJno8g81HVO8fQW1Q9aC/J5BBWBTzXDZs/ClCLVmGwPF8qer3ywSIa u6d3HXQLaTR9vxsdv/O1V6INuxzqfyfXwqgu5PEg/fTvam3gz45EaZlQpS0Bw6veCmX5 HqSQ== X-Gm-Message-State: AGi0Puaug/mdJA2Y73t5bPBFkuq8gl75/2ORhY+U5Y+6ZNSX8/XoGBzY fvHApCaERc6taWQJU2T1i98YphkjNWvRRA== X-Google-Smtp-Source: APiQypLvo0x4pVc/zVxRWQlwgbDITztYb7L43mAbrYb3Ln+SJTwzoPU/W98jubIiuwmr/pOKzIw6Qg== X-Received: by 2002:a17:902:eb13:: with SMTP id l19mr16157124plb.156.1587378836432; Mon, 20 Apr 2020 03:33:56 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:7ddc:e17b:a9b3:404]) by smtp.gmail.com with ESMTPSA id q97sm858695pjb.7.2020.04.20.03.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 03:33:55 -0700 (PDT) From: Jagan Teki To: u-boot@lists.denx.de Cc: Bin Meng , Bhargav Shah , Sagar Shrikant Kadam , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH] spi: sifive: Tidy up dm_spi_slave_platdata variable Date: Mon, 20 Apr 2020 16:03:46 +0530 Message-Id: <20200420103346.1621-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Usually variable name slave is used for spi_slave structure and plat_slave for the dm_spi_slave_platdata. Let's follow this meaningful notation by replacing slave with plat_slave for dm_spi_slave_platdata structure. Signed-off-by: Jagan Teki Reviewed-by: Bin Meng --- drivers/spi/spi-sifive.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/spi/spi-sifive.c b/drivers/spi/spi-sifive.c index 969bd4b75c..8f5efb51a3 100644 --- a/drivers/spi/spi-sifive.c +++ b/drivers/spi/spi-sifive.c @@ -95,25 +95,25 @@ struct sifive_spi { }; static void sifive_spi_prep_device(struct sifive_spi *spi, - struct dm_spi_slave_platdata *slave) + struct dm_spi_slave_platdata *slave_plat) { /* Update the chip select polarity */ - if (slave->mode & SPI_CS_HIGH) - spi->cs_inactive &= ~BIT(slave->cs); + if (slave_plat->mode & SPI_CS_HIGH) + spi->cs_inactive &= ~BIT(slave_plat->cs); else - spi->cs_inactive |= BIT(slave->cs); + spi->cs_inactive |= BIT(slave_plat->cs); writel(spi->cs_inactive, spi->regs + SIFIVE_SPI_REG_CSDEF); /* Select the correct device */ - writel(slave->cs, spi->regs + SIFIVE_SPI_REG_CSID); + writel(slave_plat->cs, spi->regs + SIFIVE_SPI_REG_CSID); } static int sifive_spi_set_cs(struct sifive_spi *spi, - struct dm_spi_slave_platdata *slave) + struct dm_spi_slave_platdata *slave_plat) { u32 cs_mode = SIFIVE_SPI_CSMODE_MODE_HOLD; - if (slave->mode & SPI_CS_HIGH) + if (slave_plat->mode & SPI_CS_HIGH) cs_mode = SIFIVE_SPI_CSMODE_MODE_AUTO; writel(cs_mode, spi->regs + SIFIVE_SPI_REG_CSMODE); @@ -128,7 +128,7 @@ static void sifive_spi_clear_cs(struct sifive_spi *spi) static void sifive_spi_prep_transfer(struct sifive_spi *spi, bool is_rx_xfer, - struct dm_spi_slave_platdata *slave) + struct dm_spi_slave_platdata *slave_plat) { u32 cr; @@ -141,14 +141,14 @@ static void sifive_spi_prep_transfer(struct sifive_spi *spi, /* LSB first? */ cr &= ~SIFIVE_SPI_FMT_ENDIAN; - if (slave->mode & SPI_LSB_FIRST) + if (slave_plat->mode & SPI_LSB_FIRST) cr |= SIFIVE_SPI_FMT_ENDIAN; /* Number of wires ? */ cr &= ~SIFIVE_SPI_FMT_PROTO_MASK; - if ((slave->mode & SPI_TX_QUAD) || (slave->mode & SPI_RX_QUAD)) + if ((slave_plat->mode & SPI_TX_QUAD) || (slave_plat->mode & SPI_RX_QUAD)) cr |= SIFIVE_SPI_FMT_PROTO_QUAD; - else if ((slave->mode & SPI_TX_DUAL) || (slave->mode & SPI_RX_DUAL)) + else if ((slave_plat->mode & SPI_TX_DUAL) || (slave_plat->mode & SPI_RX_DUAL)) cr |= SIFIVE_SPI_FMT_PROTO_DUAL; else cr |= SIFIVE_SPI_FMT_PROTO_SINGLE; @@ -191,21 +191,21 @@ static int sifive_spi_xfer(struct udevice *dev, unsigned int bitlen, { struct udevice *bus = dev->parent; struct sifive_spi *spi = dev_get_priv(bus); - struct dm_spi_slave_platdata *slave = dev_get_parent_platdata(dev); + struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev); const unsigned char *tx_ptr = dout; u8 *rx_ptr = din; u32 remaining_len; int ret; if (flags & SPI_XFER_BEGIN) { - sifive_spi_prep_device(spi, slave); + sifive_spi_prep_device(spi, slave_plat); - ret = sifive_spi_set_cs(spi, slave); + ret = sifive_spi_set_cs(spi, slave_plat); if (ret) return ret; } - sifive_spi_prep_transfer(spi, true, slave); + sifive_spi_prep_transfer(spi, true, slave_plat); remaining_len = bitlen / 8;