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: 792452 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xDzxP702Qz9rxl for ; Sat, 22 Jul 2017 17:37:29 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xDzxP6C5czDrFY for ; Sat, 22 Jul 2017 17:37:29 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xDzwB0jkgzDqpV for ; Sat, 22 Jul 2017 17:36:25 +1000 (AEST) 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-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List 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 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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);