Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1272352imu; Wed, 16 Jan 2019 16:08:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Ru6/WRzDMNbB+DCogfy69StAuO66HeJVv+NobrXqoOvcgQ+aQOJ69T+NH6BGArFRfADRn X-Received: by 2002:a62:1e45:: with SMTP id e66mr12499775pfe.152.1547683726556; Wed, 16 Jan 2019 16:08:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547683726; cv=none; d=google.com; s=arc-20160816; b=Njq6SSkNZVVEpSG1BBWZjv59dIo5GB1QI89NvoVLgP1FvUqJCUdhriA5ukrbUZufdz s9HoaxWi9KwBYT64cgSG4/SrYqlwzo6ELgdJL6ApkHo2O9M+H8lHVX1uCsOTHmxN6Bb3 rByjkQdPiZpwayYNf8LGhcUbekdev1/WiNB+HCshbHgGUwIbwbEqZtNbP6CLdkUoLlft nQfikr4tWzbY+c3lV3D6ENSIwRnufO7Ia9LD2ShEL1fTGx0pNqRKGCE0mMWuQAG/1HTY wd9RhuFDbd7lZVCy2h3nYs+gEaRzpwBCQZB7zVdNGuiCc0ZHIDZp4M0eZ2ZMucN/2Ad1 SV+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=cXhqusiDaaYrKPnz6LBFNGfXqrqpYsIka4z0SU2ktfQ=; b=Y4sJ7b3dtFvNUyv8UfQFruwPkhXUSL5hK0bPf7ClBtcVNpaxuWr7FE3nd2xxbzRQ/h S0ImPijl7tDYUQdGr5Pg2ZH0vjpbSvgkxt2rsmeHkPhohEJBEEGdPBzbha3LUQjvDJVu hK7TkmxN+ctM8LrvLwEWiBIlqOXDV0KQA1YcfaKpW9kup6swlhGK+DfJsFZq3YpGDsTL K4e79sCIrJyWVZqDRrUDOgkQP21cTJyYKkbQdFT2/18lwC67vxRY4RJpD494Ua6JjHlp zv0FNY/Wm/5Kc/JwJN05VOVl7QFci5QoOB16RiCGyoDQF7wBOIF+AuMIJ4HUzVOoYQZL BD4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c6si7480710plr.414.2019.01.16.16.08.28; Wed, 16 Jan 2019 16:08:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729851AbfAPS4l (ORCPT + 99 others); Wed, 16 Jan 2019 13:56:41 -0500 Received: from smtp1-g21.free.fr ([212.27.42.1]:61494 "EHLO smtp1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729085AbfAPS4l (ORCPT ); Wed, 16 Jan 2019 13:56:41 -0500 Received: from localhost.localdomain (unknown [IPv6:2a02:8108:4840:8f74:a08c:f56:b2dd:7ae0]) (Authenticated sender: albeu) by smtp1-g21.free.fr (Postfix) with ESMTPA id E772BB00490; Wed, 16 Jan 2019 19:56:30 +0100 (CET) From: Alban Bedel To: linux-kernel@vger.kernel.org Cc: Alban Bedel , Mark Brown , linux-spi@vger.kernel.org Subject: [PATCH 4/6] spi: ath79: Remove now useless code Date: Wed, 16 Jan 2019 19:55:47 +0100 Message-Id: <20190116185549.23295-4-albeu@free.fr> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190116185549.23295-1-albeu@free.fr> References: <20190116185549.23295-1-albeu@free.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The custom setup/cleanup routines included in the ath79 driver only take care of setting the initial CS state. However that is already handled by the bitbang code, so this code can be removed. Signed-off-by: Alban Bedel --- drivers/spi/spi-ath79.c | 43 ++--------------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/drivers/spi/spi-ath79.c b/drivers/spi/spi-ath79.c index 09c4fb7fcf7a..847f354ebef1 100644 --- a/drivers/spi/spi-ath79.c +++ b/drivers/spi/spi-ath79.c @@ -109,44 +109,6 @@ static void ath79_spi_disable(struct ath79_spi *sp) ath79_spi_wr(sp, AR71XX_SPI_REG_FS, 0); } -static int ath79_spi_setup_cs(struct spi_device *spi) -{ - struct ath79_spi *sp = ath79_spidev_to_sp(spi); - - if (!spi->cs_gpiod) { - u32 cs_bit = AR71XX_SPI_IOC_CS(spi->chip_select); - - if (spi->mode & SPI_CS_HIGH) - sp->ioc_base &= ~cs_bit; - else - sp->ioc_base |= cs_bit; - - ath79_spi_wr(sp, AR71XX_SPI_REG_IOC, sp->ioc_base); - } - - return 0; -} - -static int ath79_spi_setup(struct spi_device *spi) -{ - int status = 0; - - if (!spi->controller_state) { - status = ath79_spi_setup_cs(spi); - if (status) - return status; - } - - status = spi_bitbang_setup(spi); - - return status; -} - -static void ath79_spi_cleanup(struct spi_device *spi) -{ - spi_bitbang_cleanup(spi); -} - static u32 ath79_spi_txrx_mode0(struct spi_device *spi, unsigned int nsecs, u32 word, u8 bits, unsigned flags) { @@ -199,8 +161,8 @@ static int ath79_spi_probe(struct platform_device *pdev) master->use_gpio_descriptors = true; master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32); - master->setup = ath79_spi_setup; - master->cleanup = ath79_spi_cleanup; + master->setup = spi_bitbang_setup; + master->cleanup = spi_bitbang_cleanup; if (pdata) { master->bus_num = pdata->bus_num; master->num_chipselect = pdata->num_chipselect; @@ -209,7 +171,6 @@ static int ath79_spi_probe(struct platform_device *pdev) sp->bitbang.master = master; sp->bitbang.chipselect = ath79_spi_chipselect; sp->bitbang.txrx_word[SPI_MODE_0] = ath79_spi_txrx_mode0; - sp->bitbang.setup_transfer = spi_bitbang_setup_transfer; sp->bitbang.flags = SPI_CS_HIGH; r = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- 2.19.1