From patchwork Tue Sep 16 11:17:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pramod Gurav X-Patchwork-Id: 4916571 Return-Path: X-Original-To: patchwork-linux-arm-msm@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 9C59ABEEA5 for ; Tue, 16 Sep 2014 11:15:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 087BC2015E for ; Tue, 16 Sep 2014 11:15:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3259201DC for ; Tue, 16 Sep 2014 11:15:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753919AbaIPLOc (ORCPT ); Tue, 16 Sep 2014 07:14:32 -0400 Received: from smtp78.ord1c.emailsrvr.com ([108.166.43.78]:34485 "EHLO smtp78.ord1c.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753890AbaIPLOa (ORCPT ); Tue, 16 Sep 2014 07:14:30 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 90014180690; Tue, 16 Sep 2014 07:14:29 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp2.relay.ord1c.emailsrvr.com (Authenticated sender: pramod.gurav-AT-smartplayin.com) with ESMTPSA id 4829518060E; Tue, 16 Sep 2014 07:14:27 -0400 (EDT) X-Sender-Id: pramod.gurav@smartplayin.com Received: from SPINITLTDL00278.smartplayin.local ([UNAVAILABLE]. [220.227.185.53]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:465 (trex/5.2.10); Tue, 16 Sep 2014 11:14:29 GMT From: Pramod Gurav To: linux-kernel@vger.kernel.org Cc: David Brown , Daniel Walker , Bryan Huntsman , Ulf Hansson , linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 5/5] mmc: msm_sdcc: Remove unwanted initializations in probe Date: Tue, 16 Sep 2014 16:47:48 +0530 Message-Id: <1410866268-15185-6-git-send-email-pramod.gurav@smartplayin.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1410866268-15185-1-git-send-email-pramod.gurav@smartplayin.com> References: <1410866268-15185-1-git-send-email-pramod.gurav@smartplayin.com> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 This removes unnecessary initialisations of resource pointers and does away with a lable and just returns error on fail instead. Cc: David Brown Cc: Daniel Walker Cc: Bryan Huntsman CC: Ulf Hansson CC: linux-mmc@vger.kernel.org CC: linux-arm-msm@vger.kernel.org Signed-off-by: Pramod Gurav --- drivers/mmc/host/msm_sdcc.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c index 5025364..2b0c4d9 100644 --- a/drivers/mmc/host/msm_sdcc.c +++ b/drivers/mmc/host/msm_sdcc.c @@ -1166,17 +1166,16 @@ msmsdcc_probe(struct platform_device *pdev) struct msm_mmc_platform_data *plat = pdev->dev.platform_data; struct msmsdcc_host *host; struct mmc_host *mmc; - struct resource *cmd_irqres = NULL; - struct resource *stat_irqres = NULL; - struct resource *memres = NULL; - struct resource *dmares = NULL; + struct resource *cmd_irqres; + struct resource *stat_irqres; + struct resource *memres; + struct resource *dmares; int ret; /* must have platform data */ if (!plat) { dev_err(&pdev->dev, "Platform data not available\n"); - ret = -EINVAL; - goto out; + return -EINVAL; } if (pdev->id < 1 || pdev->id > 4) @@ -1201,12 +1200,9 @@ msmsdcc_probe(struct platform_device *pdev) /* * Setup our host structure */ - mmc = mmc_alloc_host(sizeof(struct msmsdcc_host), &pdev->dev); - if (!mmc) { - ret = -ENOMEM; - goto out; - } + if (!mmc) + return -ENOMEM; host = mmc_priv(mmc); host->pdev_id = pdev->id; @@ -1402,7 +1398,7 @@ msmsdcc_probe(struct platform_device *pdev) tasklet_kill(&host->dma_tlet); host_free: mmc_free_host(mmc); - out: + return ret; }