lkml.org 
[lkml]   [2008]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH v2] Fix debugfs_create_file's error checking method for usb/gadget/
    debugfs_create_file() returns NULL if an error occurs, returns -ENODEV
    when debugfs is not enabled in the kernel.

    Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
    ---
    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



    \
     
     \ /
      Last update: 2008-10-20 12:57    [W:0.042 / U:62.016 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site