Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752862AbYJTKyk (ORCPT ); Mon, 20 Oct 2008 06:54:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751587AbYJTKy3 (ORCPT ); Mon, 20 Oct 2008 06:54:29 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:61007 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751548AbYJTKy2 (ORCPT ); Mon, 20 Oct 2008 06:54:28 -0400 Message-ID: <48FC6310.7020808@cn.fujitsu.com> Date: Mon, 20 Oct 2008 18:53:04 +0800 From: Zhaolei User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Greg KH CC: Alan Stern , linux-kernel@vger.kernel.org, dbrownell@users.sourceforge.net, linux-usb@vger.kernel.org Subject: [PATCH v2] Fix debugfs_create_file's error checking method for usb/gadget/ References: <4F580DA88E8146FC8BDA0789613AB813@zhaoleiwin> <20081020034639.GB26650@kroah.com> In-Reply-To: <20081020034639.GB26650@kroah.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1195 Lines: 35 debugfs_create_file() returns NULL if an error occurs, returns -ENODEV when debugfs is not enabled in the kernel. Signed-off-by: Zhao Lei --- drivers/usb/gadget/s3c2410_udc.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index 48f51b1..00ba06b 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c @@ -1894,11 +1894,8 @@ static int s3c2410_udc_probe(struct platform_device *pdev) udc->regs_info = debugfs_create_file("registers", S_IRUGO, s3c2410_udc_debugfs_root, udc, &s3c2410_udc_debugfs_fops); - if (IS_ERR(udc->regs_info)) { - dev_warn(dev, "debugfs file creation failed %ld\n", - PTR_ERR(udc->regs_info)); - udc->regs_info = NULL; - } + if (!udc->regs_info) + dev_warn(dev, "debugfs file creation failed\n"); } dev_dbg(dev, "probe ok\n"); -- 1.5.5.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/