From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C7A9C4363A for ; Tue, 27 Oct 2020 00:11:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C03C820709 for ; Tue, 27 Oct 2020 00:11:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603757472; bh=Q4lW0ZRY8m5v+ndh1u8zXIFNEpqNF45mteLJI1IeK+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=DE0NrAkQIhcqP5Eqa+np0S0ypfucNNyUQUQLdqBGESY0CVZeXSawDIIurNZIqCQTF 7Ttrz3MnYFIejScSIV+1blBOhOPSYFfGjBwqdk0lp134nIsODcMEgjkSBFuwjm0tsZ ZJSELblrpF2gngr41EE5KtBRuAGbQJWc+sVNVUU8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406388AbgJ0ALL (ORCPT ); Mon, 26 Oct 2020 20:11:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:59554 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394880AbgJ0AKe (ORCPT ); Mon, 26 Oct 2020 20:10:34 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C4F2420754; Tue, 27 Oct 2020 00:10:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603757434; bh=Q4lW0ZRY8m5v+ndh1u8zXIFNEpqNF45mteLJI1IeK+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WJHAByktC1FmGxvpBcQ2RSuU9D36BYckl4hocgqPDziQqOMubLCcCQPyu3ab4DMAN PJc4OYB8CBJBB5m+HmFNXkbcU2R5Xe0GB8O6Ujq4QRE57NNtvsb65olwXKvbutAUxt h9/W4pVTV7mO5Ul1Z5yDv1Q+FmpDNugerknf14gg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dan Carpenter , Santosh Shilimkar , Krzysztof Kozlowski , Sasha Levin Subject: [PATCH AUTOSEL 4.14 40/46] memory: emif: Remove bogus debugfs error handling Date: Mon, 26 Oct 2020 20:09:39 -0400 Message-Id: <20201027000946.1026923-40-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201027000946.1026923-1-sashal@kernel.org> References: <20201027000946.1026923-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit fd22781648080cc400772b3c68aa6b059d2d5420 ] Callers are generally not supposed to check the return values from debugfs functions. Debugfs functions never return NULL so this error handling will never trigger. (Historically debugfs functions used to return a mix of NULL and error pointers but it was eventually deemed too complicated for something which wasn't intended to be used in normal situations). Delete all the error handling. Signed-off-by: Dan Carpenter Acked-by: Santosh Shilimkar Link: https://lore.kernel.org/r/20200826113759.GF393664@mwanda Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sasha Levin --- drivers/memory/emif.c | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index 04644e7b42b12..88c32b8dc88a1 100644 --- a/drivers/memory/emif.c +++ b/drivers/memory/emif.c @@ -165,35 +165,12 @@ static const struct file_operations emif_mr4_fops = { static int __init_or_module emif_debugfs_init(struct emif_data *emif) { - struct dentry *dentry; - int ret; - - dentry = debugfs_create_dir(dev_name(emif->dev), NULL); - if (!dentry) { - ret = -ENOMEM; - goto err0; - } - emif->debugfs_root = dentry; - - dentry = debugfs_create_file("regcache_dump", S_IRUGO, - emif->debugfs_root, emif, &emif_regdump_fops); - if (!dentry) { - ret = -ENOMEM; - goto err1; - } - - dentry = debugfs_create_file("mr4", S_IRUGO, - emif->debugfs_root, emif, &emif_mr4_fops); - if (!dentry) { - ret = -ENOMEM; - goto err1; - } - + emif->debugfs_root = debugfs_create_dir(dev_name(emif->dev), NULL); + debugfs_create_file("regcache_dump", S_IRUGO, emif->debugfs_root, emif, + &emif_regdump_fops); + debugfs_create_file("mr4", S_IRUGO, emif->debugfs_root, emif, + &emif_mr4_fops); return 0; -err1: - debugfs_remove_recursive(emif->debugfs_root); -err0: - return ret; } static void __exit emif_debugfs_exit(struct emif_data *emif) -- 2.25.1