Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp873371pxx; Tue, 27 Oct 2020 02:36:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy08QDkh+HPNc+E7p6MdDv6jW3wP3jlwK82EJspVRkjfz/u+LVqfJ698939PEE6Aep0tp0u X-Received: by 2002:a17:906:cc50:: with SMTP id mm16mr1513978ejb.145.1603791408048; Tue, 27 Oct 2020 02:36:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603791408; cv=none; d=google.com; s=arc-20160816; b=zbJ97HJ1pSG8BwOTRoIemlPQzTX3JDTdV1n9ouQIubau3787gH5hjM41nrMy1ls4z+ LSms6Ppy/0q9PYY9xpft4mTYq6MxZWrwTXTnY7Mu+opi26QhEaz87G/ODypiXxz2rtqm w7HJ+i5e5JtWs9qRJsyyLhEI9RQtwOvvjq4Wf0DZSXH6wxOvbXPq2ZAuGd7qNk+7wiC9 y0QT4hJWiNQv2Vj1JfWzPatDJsgSM/AHaw3kk2WpxcXm3d1EcczcTATT/pUSH2UnNPIJ RltPNaGfOX9NF+toV3lgvkOHUFVTk9opQTl91IWl3cNPXsNZISG9A8IE687Vpjx78aCs mtEA== 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=cUCwuvECa/0C/HcoBRcChaLSwgO3PIQWELS2/LZHATI=; b=E6wRptKe6w/naNxvqOyMfZyzKygIvVkhOeqlhephwyh1NpWnE/6oMconPoEo/vYXeO rGg7OtbVgHZNWfbSacM0Q4mJrcCo6Ci/sMZC0bF3cOBjzzjcCNqiC9VDVC2k6Lcfr7Ut /WXHWxkFE/McOR0I5s0ZJggjtyfetbnlwNcJpHHYSuBeHH0/+2q+cSJYwZFZrbm16Ng/ BEbMYWNYR0kf3s0BcGd5KvWCg9rmqvzlzIHOmLry7rPnYM6DtYikpRav2tdPkFhpQZ1x ZaZuPpsk4aVj1pgLB/xiYJH0hSS7CB6g9mEYb0Wv6PbZ+bfw1QBRSsoh6iWVo0mmpuLO oNHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GWAIw3fW; 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 jr8si632271ejb.304.2020.10.27.02.36.25; Tue, 27 Oct 2020 02:36:48 -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=GWAIw3fW; 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 S2409630AbgJZXwF (ORCPT + 99 others); Mon, 26 Oct 2020 19:52:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:53124 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409527AbgJZXvs (ORCPT ); Mon, 26 Oct 2020 19:51:48 -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 E4953221F7; Mon, 26 Oct 2020 23:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603756307; bh=dmsfJ8ipZvgGI28PnEwHEvnxNTV6rN2NO2SDCDLL+wg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GWAIw3fWVniT4EjbRUn2CgWUoyyOmsQDUBmzY9ML1OJI4XIkYhG9Fz22iIi/AYiZt StCOodPyzq8x/Ya/nflfKCWnYDLc2EzPqDAYtobFS1YcNi/Kb8xvc5K18Bu4PlARnw xPZCfmBmBWT1Qpdt+sW/xdMDpV/ULqgqvaiQUCTk= 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.9 132/147] memory: emif: Remove bogus debugfs error handling Date: Mon, 26 Oct 2020 19:48:50 -0400 Message-Id: <20201026234905.1022767-132-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026234905.1022767-1-sashal@kernel.org> References: <20201026234905.1022767-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 bb6a71d267988..5c4d8319c9cfb 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