Re: [PATCH] USB: mon: Allow to use usbmon without debugfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue,  5 Jul 2011 13:37:50 +0200
Tobias Klauser <tklauser@xxxxxxxxxx> wrote:

> Do not bail out in mon_init() if debugfs is not available, instead just
> print the warning but go ahead loading the binary API.

> --- a/drivers/usb/mon/mon_main.c
>  
> -	if ((rc = mon_text_init()) != 0)
> -		goto err_text;
> +	if (mon_text_init() != 0)
> +		printk(KERN_WARNING TAG ": debugfs is not available\n");
>  	if ((rc = mon_bin_init()) != 0)
> @@ -739,14 +742,9 @@ int __init mon_text_init(void)
>  
>  	mondir = debugfs_create_dir("usbmon", usb_debug_root);
> -	if (IS_ERR(mondir)) {
> -		printk(KERN_NOTICE TAG ": debugfs is not available\n");
> -		return -ENODEV;
> -	}
> -	if (mondir == NULL) {
> -		printk(KERN_NOTICE TAG ": unable to create usbmon directory\n");
> +	if (IS_ERR_OR_NULL(mondir))
>  		return -ENODEV;
> -	}
> +
>  	mon_dir = mondir;

This looks like going in the right direction, but do we even want the
warning anymore? Perhaps we ought to retain the split: if debugfs_create_dir
exited with -ENODEV, skip mon_text_init quietly, otherwise print a
specific message (my original code is guilty in dumping all error
returns in one pile).

-- Pete
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux