From patchwork Sat Jul 22 07:34:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 9858017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AABDB600F5 for ; Sat, 22 Jul 2017 07:37:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98E492861A for ; Sat, 22 Jul 2017 07:37:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BE5228621; Sat, 22 Jul 2017 07:37:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D0592861A for ; Sat, 22 Jul 2017 07:37:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=ScT/iZ3OHsQINhMCELAFf64PqaXDcpXBXMnyqoK7uVY=; b=ZFWpj6/DMeOYCM l0AK13TZ1BtUF7C+vVhDJRRSMVsgnI3j0eY7pbSLn//drHQvC/MjemJ0ZbRljmy/OthoRtkYQb8ro qx44Djj3b3rDtWEoq7rxdotn9Jgu4GXnd+y9/4L0UG8SYRxyswszySM/acAESJdafGeQiTQIsDJh4 wyNELUbi0ifaMpotUBowGHEXWAJ3SYZGkY3Z7MD+llYPyP3kxhBszsfDfKVfzTb+3O4nkcJYkvVQ/ XGiDN4zZTbD5e1PQvVGoBgoU23PP64GPweE5od0id0zZ0KP1lLgO7KFS7kavFQotUyR7SxQomE5oU xb8sxDRVOKAS7G90lMng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dYoxd-0000cG-LH; Sat, 22 Jul 2017 07:36:25 +0000 Received: from aserp1040.oracle.com ([141.146.126.69]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dYoxa-0000bp-9d for linux-arm-kernel@lists.infradead.org; Sat, 22 Jul 2017 07:36:24 +0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v6M7ZvbM016789 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 22 Jul 2017 07:35:57 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v6M7ZuRY021180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 22 Jul 2017 07:35:57 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v6M7ZpNk015004; Sat, 22 Jul 2017 07:35:51 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 22 Jul 2017 00:35:04 -0700 Date: Sat, 22 Jul 2017 10:34:57 +0300 From: Dan Carpenter To: Qiang Zhao Subject: [PATCH 2/2] fsl/qe: Cleanup error paths in ucc_of_parse_tdm() Message-ID: <20170722073457.zyrqoufpopwg6il5@mwanda> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170722073335.tb6byaaarqvloh3a@mwanda> X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170609 (1.8.3) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170722_003622_424001_4EAA6565 X-CRM114-Status: UNSURE ( 8.16 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Li Yang Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The most important part of this change is that it not propogates error codes instead of returning -EINVAL. There was also a tab missing, and a couple other minor cleanups which don't affect runtime. Signed-off-by: Dan Carpenter --- Not tested, but I don't think propogating the errors will cause a problem. diff --git a/drivers/soc/fsl/qe/qe_tdm.c b/drivers/soc/fsl/qe/qe_tdm.c index ec7a853053c3..ce071a78209b 100644 --- a/drivers/soc/fsl/qe/qe_tdm.c +++ b/drivers/soc/fsl/qe/qe_tdm.c @@ -42,7 +42,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm, struct ucc_tdm_info *ut_info) { const char *sprop; - int ret = 0; + int ret; u32 val; struct resource *res; struct device_node *np2; @@ -68,7 +68,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm, if ((ut_info->uf_info.tx_sync < QE_CLK_NONE) || (ut_info->uf_info.tx_sync > QE_TSYNC_PIN)) { pr_err("QE-TDM: Invalid tx-sync-clock property\n"); - return -EINVAL; + return -EINVAL; } } else { pr_err("QE-TDM: Invalid tx-sync-clock property\n"); @@ -78,13 +78,12 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm, ret = of_property_read_u32_index(np, "fsl,tx-timeslot-mask", 0, &val); if (ret) { pr_err("QE-TDM: Invalid tx-timeslot-mask property\n"); - return -EINVAL; + return ret; } utdm->tx_ts_mask = val; ret = of_property_read_u32_index(np, "fsl,rx-timeslot-mask", 0, &val); if (ret) { - ret = -EINVAL; pr_err("QE-TDM: Invalid rx-timeslot-mask property\n"); return ret; } @@ -92,7 +91,6 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm, ret = of_property_read_u32_index(np, "fsl,tdm-id", 0, &val); if (ret) { - ret = -EINVAL; pr_err("QE-TDM: No fsl,tdm-id property for this UCC\n"); return ret; } @@ -106,18 +104,16 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm, sprop = of_get_property(np, "fsl,tdm-framer-type", NULL); if (!sprop) { - ret = -EINVAL; pr_err("QE-TDM: No tdm-framer-type property for UCC\n"); - return ret; + return -EINVAL; } ret = set_tdm_framer(sprop); if (ret < 0) - return -EINVAL; + return ret; utdm->tdm_framer_type = ret; ret = of_property_read_u32_index(np, "fsl,siram-entry-id", 0, &val); if (ret) { - ret = -EINVAL; pr_err("QE-TDM: No siram entry id for UCC\n"); return ret; } @@ -164,7 +160,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm, siram_init_flag = 1; } - return ret; + return 0; } EXPORT_SYMBOL(ucc_of_parse_tdm);