Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp886087pxx; Tue, 27 Oct 2020 03:03:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0tq4GYnbltqzYKWolsxM06jyxzTFiMN67nneOs3kuTvQ40AZlpjwOJPf52BtiSpTUU155 X-Received: by 2002:a50:d2d3:: with SMTP id q19mr1424662edg.22.1603793010633; Tue, 27 Oct 2020 03:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603793010; cv=none; d=google.com; s=arc-20160816; b=MSCpFe9OK/QuiGhgfHkz75ebsXxI9f0ob6a9FZXnK02N93ay4JJCSJm/XriQmrJqVk bh2pr3Pjb41kHLJpD0XX0b+BVtJwomqJDNtjBlYJn+n3QR7vHmr9H9VPQurPQK3FaK1n EwIxe1mAl5baDK594YydL8B1PoB9MuHWMvADzklRZEru4FoLhqfOCpyJvkvDeCGbBOs0 lhVKVxPyMisTxMjapiUxVPgL8Nr1C3rRa9NDf20HuvQ0zKKNwMpC+GftigJm3StyORhT +9LvRAloHCpYCE5q3Ic7XHA/NjYYtEFsPQcsBB8U9T2uMk2jvZALK+2ynTK5WQIgnPnF HN1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EvVqnqz0W6tUFGHbPf7aZ4A+FieHGP57K3YE61DLD5w=; b=QBrxm/MR1YglkHz5zIwzz4U1PujVfuJ5DdNglvKwfB8SOEv0NjNbNVGl753JENsW5i IQpqpBYJCVE4QCaGslQTTL2R4iaYWWW13IlSlbYWN/qN8JmA2X7fjDw42B6tjfQ/sEnR QowZQciCYy6ncku31EZpMxNhjgDsOpBl7cY0vcKclo2AyQUJpPnrsmDfllPmoj2jaYPJ 070aCwvoGWWGMvnbrlo8ZunLrSXPLKOonG2JG6MkhNIOeUChQDcbvEINiGWoNtTyeiBE BXQLs0KQKE+UPsfcGAgh1lv3uxmBIj3Iz1qTdXwYpS8zx04DOiut1SqsnQuQ7uO8mUt2 OBkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ctK3Ryhd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t13si499838edv.198.2020.10.27.03.03.07; Tue, 27 Oct 2020 03:03:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ctK3Ryhd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437147AbgJ0AAJ (ORCPT + 99 others); Mon, 26 Oct 2020 20:00:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:37062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436587AbgJZX4p (ORCPT ); Mon, 26 Oct 2020 19:56:45 -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 3C57220B1F; Mon, 26 Oct 2020 23:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603756604; bh=kimPBqWed+z7MO6/kt7ceO6BFzvIcBOD8kPrrQL2rlk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ctK3RyhdOAAmivFpEh93k+zTxPnNBba3TzzRYlPllB/AO3VqFDGe70kfy0caER+f2 mUMr1WTlzRf36AudJJXV4WgwMxL01dAUf23HFafCG7AUXDLLYzwcmaVP/jEoIfV5Li aQMJxCKKhaid9AcqGfW+8gnqRels84EAgRxY1/iw= 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 5.4 73/80] memory: emif: Remove bogus debugfs error handling Date: Mon, 26 Oct 2020 19:55:09 -0400 Message-Id: <20201026235516.1025100-73-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026235516.1025100-1-sashal@kernel.org> References: <20201026235516.1025100-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 402c6bc8e621d..af296b6fcbbdc 100644 --- a/drivers/memory/emif.c +++ b/drivers/memory/emif.c @@ -163,35 +163,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