Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3211911pxb; Mon, 9 Nov 2020 05:43:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJymCAOYWtuMdpR73lAJ7VsXz/iXYJ1Rege5ZezXqWoqfIYpiIACVfK/vWmg3phbq6yRC+us X-Received: by 2002:a17:906:7f10:: with SMTP id d16mr14885989ejr.104.1604929401093; Mon, 09 Nov 2020 05:43:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929401; cv=none; d=google.com; s=arc-20160816; b=xJ6i8m49X92pblaBy0wYZNpaVrYRC+8SXeJwOWO4trW5vg+XV6tEwPN7HDh3DUXtIC y6ZsunFFk3pQK3XMUyLSIJeu8Z1gh7Id/EThj3y5rCT7DXKOpzhtxgpPU3OfEuELUJMd 43TWO1s6DpuTAFHpFteUWkprERl/P+rZKv+4mOEws00aEzBARRUCczR2mO799joPl8fD GkIUbMQtH29WMe1RkhEPaioWnn6WGqUMxWW3OgoGIBbcvs0mXg5Q2sD2Jm46xCWs/ogw bM/OIRNUEV9IQNru+3f1/oIWIXsCG7lrVMvvI0eFHD89aR8tZNmwzytQn2arrshO3ZMc XRng== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0X0vWW+9SNirYPx1Is9/ESoG68hCHKjMyDRjs3j2e9o=; b=JtoY4qpPyEnF56k4IrMW73nz4Z8e0TzmVboIcQe8fXkurKBOXsp1esJEWBnk8zrxt8 mUTOREeqQDOFT9szjWHcM8zIOZgmDmat/daOA16rjENfq0MBqEK1yrIJUcI8ULaMC1+5 /Q8EECcAk/amGLa6kwlCZnf/N4QCJRs6xXJ9sXFdVc5gDu9voCOwEWBZgNhA4avqaP13 2iNN7hEQaU6wX+Y+3vepkiSorEk516gap/ZOvYZTQODZ9eb83CgIe4AWDIumA60IlhFr gPv8nLtPkZDGrsiUB8Y1a9FRsZNoUKjBr0PyTx9lnIwmwbOVGxF+9zxP5pzuyXuM29w5 KSSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MSQZ31JA; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si8403800edn.216.2020.11.09.05.42.58; Mon, 09 Nov 2020 05:43:21 -0800 (PST) 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=MSQZ31JA; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731186AbgKINlj (ORCPT + 99 others); Mon, 9 Nov 2020 08:41:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:55624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730147AbgKINBh (ORCPT ); Mon, 9 Nov 2020 08:01:37 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AA05F206C0; Mon, 9 Nov 2020 13:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926897; bh=ZVere6ll14sNmvx4SfE3bvqZth8xPm0Z1tgh+hKBV20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MSQZ31JAEf5NGpcj5KwXvt3gel1K7QipVj6rrUwV5hzvJf/YJ4JvDYPvxlFJ7EE6V x1REQgWGz4hnenNOKY2Q7/Xcr5VP6JwZuu2Ybcsa6grRhPumTGUu3I+PuzZRob35C0 9o94Ib2vQslfoOsYFuTAJ8SAZ46baXGm9VcdlMn4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Santosh Shilimkar , Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 4.9 041/117] memory: emif: Remove bogus debugfs error handling Date: Mon, 9 Nov 2020 13:54:27 +0100 Message-Id: <20201109125027.606526959@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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.27.0