From patchwork Tue May 29 15:31:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 10436263 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 8306D601C7 for ; Tue, 29 May 2018 15:32:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7419D2889A for ; Tue, 29 May 2018 15:32:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68AE7288B2; Tue, 29 May 2018 15:32:26 +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 BEB562889A for ; Tue, 29 May 2018 15:32:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935550AbeE2PcY (ORCPT ); Tue, 29 May 2018 11:32:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:40080 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935260AbeE2PcX (ORCPT ); Tue, 29 May 2018 11:32:23 -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 C8D2F208A1; Tue, 29 May 2018 15:32:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527607943; bh=bAgOWTv87WOE/wO+PLCOZSPwxJv6mHhbDZtW7uWdZu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OBsdKbaA7Fju6uUYXnXLeOpDsIGRVS/7jpT4maFvU/Ll2Y2T8gTt5lfyDMSjX+prZ 2wn02Lf3YndK51Vd5Do21zM625dCchrsGY8V6v9/EVrJsnEDI2FuRokWnOz1wddA4Z 0gmqJ0pTOpadOZbT2TDCcY4EXhp6J5wu4k/lmIO0= From: Greg Kroah-Hartman To: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Felipe Balbi , Li Yang , Nicolas Ferre , Robert Jarzmik Subject: [PATCH 22/22] USB: gadget: udc: s3c2410_udc: no need to check return value of debugfs_create functions Date: Tue, 29 May 2018 17:31:07 +0200 Message-Id: <20180529153107.12791-22-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: Li Yang Cc: Nicolas Ferre Cc: Robert Jarzmik Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/s3c2410_udc.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c index f154f49e98c8..8bf5ad7a59ad 100644 --- a/drivers/usb/gadget/udc/s3c2410_udc.c +++ b/drivers/usb/gadget/udc/s3c2410_udc.c @@ -1871,13 +1871,9 @@ static int s3c2410_udc_probe(struct platform_device *pdev) if (retval) goto err_add_udc; - if (s3c2410_udc_debugfs_root) { - udc->regs_info = debugfs_create_file("registers", S_IRUGO, - s3c2410_udc_debugfs_root, - udc, &s3c2410_udc_debugfs_fops); - if (!udc->regs_info) - dev_warn(dev, "debugfs file creation failed\n"); - } + udc->regs_info = debugfs_create_file("registers", S_IRUGO, + s3c2410_udc_debugfs_root, udc, + &s3c2410_udc_debugfs_fops); dev_dbg(dev, "probe ok\n"); @@ -1994,11 +1990,6 @@ static int __init udc_init(void) dprintk(DEBUG_NORMAL, "%s\n", gadget_name); s3c2410_udc_debugfs_root = debugfs_create_dir(gadget_name, NULL); - if (IS_ERR(s3c2410_udc_debugfs_root)) { - pr_err("%s: debugfs dir creation failed %ld\n", - gadget_name, PTR_ERR(s3c2410_udc_debugfs_root)); - s3c2410_udc_debugfs_root = NULL; - } retval = platform_driver_register(&udc_driver_24x0); if (retval) @@ -2014,7 +2005,7 @@ static int __init udc_init(void) static void __exit udc_exit(void) { platform_driver_unregister(&udc_driver_24x0); - debugfs_remove(s3c2410_udc_debugfs_root); + debugfs_remove_recursive(s3c2410_udc_debugfs_root); } module_init(udc_init);