From patchwork Mon Jan 20 15:18:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3513291 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5AF6FC02DC for ; Mon, 20 Jan 2014 15:18:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FF2720161 for ; Mon, 20 Jan 2014 15:18:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4117220160 for ; Mon, 20 Jan 2014 15:18:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751669AbaATPSx (ORCPT ); Mon, 20 Jan 2014 10:18:53 -0500 Received: from mail-pd0-f176.google.com ([209.85.192.176]:56130 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751627AbaATPSx (ORCPT ); Mon, 20 Jan 2014 10:18:53 -0500 Received: by mail-pd0-f176.google.com with SMTP id w10so1689260pde.21 for ; Mon, 20 Jan 2014 07:18:51 -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=coOh4aZXyMSlvlY82OMhLSqUP9O9hgfA0YXsd0UDTxM=; b=K6UWpFLIe4WfQzsF3y6xPFcF3kKiCkbXxrxbT6EyloNPZPMuipPWiv8RiryNZdznMN EQj8OaEFWlEfrXxTPIapJt17vWhBOLcet82FMadran52qs/cfuwgvI7VutGeWF2oLvtp I+9RNpo6J8vWTJK/L/FtoUCvjix9BSSPNBwLdDZvOTp1TGOdVKeJwt53xim+394afMBO oFC1nIkh0Z4y3oaWnuBV6ObksYD2Ci0N1hOpSRjl6bplWoDoR4T+0TSEGjZOvaCOswcV Yf/dh45lBgJQK5k5EUU/frlFwckgBcxOZTF2HQ+qW1HOFJWtkjbnsEnxqLNFrPiVSsis Z07w== X-Gm-Message-State: ALoCoQn9SA1FAx5nXwZe68n4FODPJBQr7ZIYQq745QMjYULKP1j0q9rvWHQ86dah81QGDbXVKpgF X-Received: by 10.66.149.73 with SMTP id ty9mr19216153pab.36.1390231130257; Mon, 20 Jan 2014 07:18:50 -0800 (PST) Received: from [10.145.54.156] ([60.245.65.194]) by mx.google.com with ESMTPSA id x5sm3948837pbw.26.2014.01.20.07.18.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Jan 2014 07:18:49 -0800 (PST) Message-ID: <1390231125.11756.1.camel@phoenix> Subject: [PATCH] spi: sc18is602: Remove sc18is602_setup() because it is done by spi core From: Axel Lin To: Mark Brown Cc: Guenter Roeck , linux-spi@vger.kernel.org Date: Mon, 20 Jan 2014 23:18:45 +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.5 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 The checking for spi->mode is done in the implementation of spi_setup(). Calling sc18is602_check_transfer(spi, NULL, 0) is pointless because the code is equivent to checking if spi->max_speed_hz is 0. Note, sc18is602_check_transfer actually allows spi->max_speed_hz is 0 if t->speed_hz is set. So return error in sc18is602_setup() when spi->max_speed_hz is 0 does not make sense. Signed-off-by: Axel Lin Acked-by: Guenter Roeck --- drivers/spi/spi-sc18is602.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/spi/spi-sc18is602.c b/drivers/spi/spi-sc18is602.c index 121c2e1..b3ac776 100644 --- a/drivers/spi/spi-sc18is602.c +++ b/drivers/spi/spi-sc18is602.c @@ -245,14 +245,6 @@ error: return status; } -static int sc18is602_setup(struct spi_device *spi) -{ - if (spi->mode & ~(SPI_CPHA | SPI_CPOL | SPI_LSB_FIRST)) - return -EINVAL; - - return sc18is602_check_transfer(spi, NULL, 0); -} - static int sc18is602_probe(struct i2c_client *client, const struct i2c_device_id *id) { @@ -306,7 +298,6 @@ static int sc18is602_probe(struct i2c_client *client, master->bus_num = client->adapter->nr; master->mode_bits = SPI_CPHA | SPI_CPOL | SPI_LSB_FIRST; master->bits_per_word_mask = SPI_BPW_MASK(8); - master->setup = sc18is602_setup; master->transfer_one_message = sc18is602_transfer_one; master->dev.of_node = np;