From patchwork Tue May 29 15:31:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10436261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3AC06601C7 for ; Tue, 29 May 2018 15:32:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ADA52888E for ; Tue, 29 May 2018 15:32:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F6B22889A; Tue, 29 May 2018 15:32:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 951612888E for ; Tue, 29 May 2018 15:32:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935545AbeE2PcW (ORCPT ); Tue, 29 May 2018 11:32:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:40052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935260AbeE2PcV (ORCPT ); Tue, 29 May 2018 11:32:21 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 2088920899; Tue, 29 May 2018 15:32:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527607940; bh=cwFAduPJyU0R4pGKj7Z5KBPdK84zst/FGd1dcyXUE+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CqjglRCyHoIXBkL4SwmfPXGJO1JcJqCi22/CV7msN1bEMUPi64hvSNNDCZNO+MzlQ DLwZGK/K+KUblBpppt+bhRg6eHUmI8VEFqVeT5hRsnFK1iPcN98Csggi7+unez3XpD rs0xWnifrEzx4WL1vX/tN7Uz2wH/zj6Q11OAqXAs= From: Greg Kroah-Hartman To: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Felipe Balbi , Yoshihiro Shimoda , Simon Horman , Geert Uytterhoeven Subject: [PATCH 21/22] USB: gadget: udc: renesas_usb3: no need to check return value of debugfs_create functions Date: Tue, 29 May 2018 17:31:06 +0200 Message-Id: <20180529153107.12791-21-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180529153107.12791-1-gregkh@linuxfoundation.org> References: <20180529153107.12791-1-gregkh@linuxfoundation.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Felipe Balbi Cc: Yoshihiro Shimoda Cc: Simon Horman Cc: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman Acked-by: Yoshihiro Shimoda --- drivers/usb/gadget/udc/renesas_usb3.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c index 5caf78bbbf7c..977ea1a02cf9 100644 --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -2391,22 +2391,10 @@ static const struct file_operations renesas_usb3_b_device_fops = { static void renesas_usb3_debugfs_init(struct renesas_usb3 *usb3, struct device *dev) { - struct dentry *root, *file; + usb3->dentry = debugfs_create_dir(dev_name(dev), NULL); - root = debugfs_create_dir(dev_name(dev), NULL); - if (IS_ERR_OR_NULL(root)) { - dev_info(dev, "%s: Can't create the root\n", __func__); - return; - } - - file = debugfs_create_file("b_device", 0644, root, usb3, - &renesas_usb3_b_device_fops); - if (!file) { - dev_info(dev, "%s: Can't create debugfs mode\n", __func__); - debugfs_remove_recursive(root); - } else { - usb3->dentry = root; - } + debugfs_create_file("b_device", 0644, usb3->dentry, usb3, + &renesas_usb3_b_device_fops); } /*------- platform_driver ------------------------------------------------*/