Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp828687pxb; Tue, 3 Nov 2020 13:43:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBo/0vJtai5rR0KM8Ee+bdTaJAWv20puDmrBd0NE/dMrWvXiPX8nVQLoNHwBLf+PaQqyRr X-Received: by 2002:a05:6402:1148:: with SMTP id g8mr24884486edw.271.1604439831723; Tue, 03 Nov 2020 13:43:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604439831; cv=none; d=google.com; s=arc-20160816; b=CT7ZM860k4EMEXcIyZ4BtXvx7PBNXwsfy3pZ12R+EtzP+gPmG9jb9OwsQMT7yunpgu AKg+IipxeO5GrAZ5PR2hx5P4Cxqmj9LkkWthRHUd/9LVz+SNBka8QX6BjZVtMTUDRXit OL4ZTZAqYtKWlm7rAZVUvmcwmO4mrdukttW9ZXEiyvwgYRMdX2y6Q2qsKQY0iBOWWUGC VAUd8NGOsmzVnHOJO35D4MXsTy5XQn6g+HWgVSwaUBMSZVYXzqj6idwHWBUyFWcB5fjy 6xlOpX0O5jEZCsCK6VL37AajM4sEdrCPqANk9KaY3aet42tgDWyCwImMuvOW5ckj6Kpw +/Ng== 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=03BjY75MMljPTBRveXMPEGZOMzpWRej8N+cbbQWbg4A=; b=HQX/b1fkhhuheADMRXtUZxOWANqJMqBQe8dKAiMC07+fpIaCnkwLM6VAIAP57jP5ax L31EJ2iQ8q1JO039kjkTWVpWLZ1yQ5vjdi8CwTELeH2Hn0AcZbTLvNw48Km7TxEPycof nvLIdVWjkZ6x5smosykZM6iZEP1tEYQbg2c3eRDuhHvmexjw3qYh4y3HCvmxCkSmjxat hMrbROxfELg/NxfSl+fgyI5IoyMx6/LzbaGXKyaUMLX0a3uMEzmdfAkoZr9IDqucLSDV TfNAMHhhs1XbiGpo7S2cCp1QD+Ls+8rARUwcdu+jLCHJw8Kq2QQl6n/+vQ7TLHyF1FE/ tKHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PSCsFxEJ; 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 k7si40046ejp.590.2020.11.03.13.43.28; Tue, 03 Nov 2020 13:43:51 -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=PSCsFxEJ; 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 S1732447AbgKCU4H (ORCPT + 99 others); Tue, 3 Nov 2020 15:56:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:57382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732115AbgKCU4D (ORCPT ); Tue, 3 Nov 2020 15:56:03 -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 C5EBE223BF; Tue, 3 Nov 2020 20:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436963; bh=/5LWgQ/WVYbMHfGvzmqDtdA71HwyE7u5qWhtd/GkzsQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PSCsFxEJHZN4jRi2e2DopgN6aLP+jKHgWs8KVaDNWqJzkfd5Db5rm9zdny1K/JVHQ SJFAQKxIgQPX8xQhmsLvbjfkItEX5pEjaKXsQqCX0pjNR3SZVvbwW7Q0Aj18xaYDjX ONx0TRe4MZZgjGSg5dZ+8T32GNK/4yihwkm+JWEo= 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 5.4 088/214] memory: emif: Remove bogus debugfs error handling Date: Tue, 3 Nov 2020 21:35:36 +0100 Message-Id: <20201103203258.637208207@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@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 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.27.0