From patchwork Thu Feb 6 02:52:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3592691 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 A5ABFC02DC for ; Thu, 6 Feb 2014 02:52:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E871520142 for ; Thu, 6 Feb 2014 02:52:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2545E20145 for ; Thu, 6 Feb 2014 02:52:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751745AbaBFCw1 (ORCPT ); Wed, 5 Feb 2014 21:52:27 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:37671 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751296AbaBFCw1 (ORCPT ); Wed, 5 Feb 2014 21:52:27 -0500 Received: by mail-pa0-f46.google.com with SMTP id rd3so1122734pab.19 for ; Wed, 05 Feb 2014 18:52:26 -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=9tcEv3s3FwuGIsXFqmm0T6IOugyeho4dGbnFvzmxHDE=; b=hFxevQ7raXGqrwF5moN121ubw7DuTZNq3kfP4elOKBerXl22S9zLuRVJ2mIGaElwsb KnPTv3K8gkrCniuCjDWkAcVhM1v3Htl9xuV4DgxUZHnOp1ZpeR9Dxte6fAixEwLsi2Fh ktg303fPL/0ABjo5lLYGdVSjm9oY88Jpz/S7XEb0N+UAqpkyyJWYaPsmV7824NvJB5k4 sZ+sBwVn0v4o//ApQJ0BaDNvjxaRb3A5f3iAKh1ziP+xbSk1jddTzZi5N5jmDe1KNA9l 0mKVSF+zuKeyhRb5aDftRAuNDa3Xd246PDhbouIA4ZsMsZaoaGxd5C0PZtoXII6BQCHK NM5A== X-Gm-Message-State: ALoCoQm+NPHokFabFfJXJN1kBOgXel541xdAsfqA0YZRGfNuJjKaNHTHspEMx9XAEwUP1GkpXsHu X-Received: by 10.68.197.99 with SMTP id it3mr7874529pbc.37.1391655146767; Wed, 05 Feb 2014 18:52:26 -0800 (PST) Received: from [192.168.0.102] (36-239-208-123.dynamic-ip.hinet.net. [36.239.208.123]) by mx.google.com with ESMTPSA id iq10sm81465021pbc.14.2014.02.05.18.52.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 18:52:26 -0800 (PST) Message-ID: <1391655141.12574.1.camel@phoenix> Subject: [PATCH] spi: davinci: Remove unneeded NULL checking for dspi and dspi->bitbang.master From: Axel Lin To: Mark Brown Cc: Murali Karicheri , linux-spi@vger.kernel.org Date: Thu, 06 Feb 2014 10:52:21 +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.4 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 spi_master_get_devdata() never returns NULL when spi_alloc_master() success, so remove NULL test for dspi. We have ensured master is not NULL before assigning it to dspi->bitbang.master. So also remove NULL test for dspi->bitbang.master. Signed-off-by: Axel Lin --- drivers/spi/spi-davinci.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index 5e7389f..04d69b6 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -864,10 +864,6 @@ static int davinci_spi_probe(struct platform_device *pdev) platform_set_drvdata(pdev, master); dspi = spi_master_get_devdata(master); - if (dspi == NULL) { - ret = -ENOENT; - goto free_master; - } if (dev_get_platdata(&pdev->dev)) { pdata = dev_get_platdata(&pdev->dev); @@ -908,10 +904,6 @@ static int davinci_spi_probe(struct platform_device *pdev) goto free_master; dspi->bitbang.master = master; - if (dspi->bitbang.master == NULL) { - ret = -ENODEV; - goto free_master; - } dspi->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(dspi->clk)) {