From patchwork Mon Jan 13 02:00:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3473401 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 83EB99F2ED for ; Mon, 13 Jan 2014 02:00:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A183020122 for ; Mon, 13 Jan 2014 02:00:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C7E020121 for ; Mon, 13 Jan 2014 02:00:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751214AbaAMCAx (ORCPT ); Sun, 12 Jan 2014 21:00:53 -0500 Received: from mail-pb0-f44.google.com ([209.85.160.44]:40140 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751110AbaAMCAw (ORCPT ); Sun, 12 Jan 2014 21:00:52 -0500 Received: by mail-pb0-f44.google.com with SMTP id rr13so6940pbb.17 for ; Sun, 12 Jan 2014 18:00:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=g5Zr2fPVfNrywvK8gbmkEG6Sktq/mdrIS0i/pR2m7wQ=; b=MCtLJT6EAA0H6ZjkHi41rCybyTn4pj+5tv9+qgi62H2HOnYfdMhxSj0EdVPl9AZhW0 hSZHL0J3FYDJTnvIK1bVhPCARLNBuGEtDiZDaPA4YwumsxNOFRm8xMqh59BJWE4BsFPb qP09we+pi8cmTc35J5mv9ScZPAbEzpIARUU0Xd0R9oRAec+D3GUWcIZRMZleo3fwNy/s CDOuUuMzyi8BJcP2p1u/K+ztySPfGa9DJriVXZ6o4JwUSJzn3HVDF5SBbVRRxhdU0adw s5LR1ZAvCycfPxVd2cvsGcURFMlKvhCY3yY1dz6Ng1LaamUEAeXYJO1wXcqhYtHIFOfc xsQw== X-Gm-Message-State: ALoCoQmd/Pv2uqDU62NJfOx9/y71xcrFxCOqJ3odSWTk2YD64mHzLkeInAvTB/vG1UdrJukfC8lI X-Received: by 10.68.239.230 with SMTP id vv6mr26490238pbc.34.1389578452348; Sun, 12 Jan 2014 18:00:52 -0800 (PST) Received: from [192.168.0.102] (218-164-102-115.dynamic.hinet.net. [218.164.102.115]) by mx.google.com with ESMTPSA id iu7sm33707043pbc.45.2014.01.12.18.00.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 12 Jan 2014 18:00:51 -0800 (PST) Message-ID: <1389578444.18562.1.camel@phoenix> Subject: [PATCH] spi: sh: Use spi_sh_clear_bit() instead of open-coded From: Axel Lin To: Mark Brown Cc: Yoshihiro Shimoda , linux-spi@vger.kernel.org Date: Mon, 13 Jan 2014 10:00:44 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We have a spi_sh_clear_bit() function, there's no reason not to use it. Signed-off-by: Axel Lin --- drivers/spi/spi-sh.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-sh.c b/drivers/spi/spi-sh.c index c120a70..9fea8cc 100644 --- a/drivers/spi/spi-sh.c +++ b/drivers/spi/spi-sh.c @@ -171,7 +171,6 @@ static int spi_sh_send(struct spi_sh_data *ss, struct spi_message *mesg, int remain = t->len; int cur_len; unsigned char *data; - unsigned long tmp; long ret; if (t->len) @@ -213,9 +212,7 @@ static int spi_sh_send(struct spi_sh_data *ss, struct spi_message *mesg, } if (list_is_last(&t->transfer_list, &mesg->transfers)) { - tmp = spi_sh_read(ss, SPI_SH_CR1); - tmp = tmp & ~(SPI_SH_SSD | SPI_SH_SSDB); - spi_sh_write(ss, tmp, SPI_SH_CR1); + spi_sh_clear_bit(ss, SPI_SH_SSD | SPI_SH_SSDB, SPI_SH_CR1); spi_sh_set_bit(ss, SPI_SH_SSA, SPI_SH_CR1); ss->cr1 &= ~SPI_SH_TBE; @@ -239,7 +236,6 @@ static int spi_sh_receive(struct spi_sh_data *ss, struct spi_message *mesg, int remain = t->len; int cur_len; unsigned char *data; - unsigned long tmp; long ret; if (t->len > SPI_SH_MAX_BYTE) @@ -247,9 +243,7 @@ static int spi_sh_receive(struct spi_sh_data *ss, struct spi_message *mesg, else spi_sh_write(ss, t->len, SPI_SH_CR3); - tmp = spi_sh_read(ss, SPI_SH_CR1); - tmp = tmp & ~(SPI_SH_SSD | SPI_SH_SSDB); - spi_sh_write(ss, tmp, SPI_SH_CR1); + spi_sh_clear_bit(ss, SPI_SH_SSD | SPI_SH_SSDB, SPI_SH_CR1); spi_sh_set_bit(ss, SPI_SH_SSA, SPI_SH_CR1); spi_sh_wait_write_buffer_empty(ss);