On Mon, May 07, 2018 at 11:20:36AM +1000, James Kelly wrote:
> @@ -463,6 +549,16 @@ static int clk_wzrd_debug_init(struct clk_hw *hw, struct 
> dentry *dentry)
>       struct dentry *d;
>       struct clk_wzrd_clk_data *cwc = to_clk_wzrd_clk_data(hw);
>  
> +     d = debugfs_create_u16("clk_ratio_min", 0444, dentry,
> +                            (u16 *)&cwc->ratio_limit->min);
> +     if (IS_ERR(d))
> +             return PTR_ERR(d);
> +
> +     d = debugfs_create_u16("clk_ratio_max", 0444, dentry,
> +                            (u16 *)&cwc->ratio_limit->max);
> +     if (IS_ERR(d))
> +             return PTR_ERR(d);


All these debugfs stuff should be tests for NULL.

 *
 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
 * returned.  It is not wise to check for this value, but rather, check for
 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
 * code.

regards,
dan carpenter

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to