Search Linux Wireless

Re: [PATCH v3 1/2] rt2x00: debugfs support - allow a register to be empty

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

 



Hi,

I'm almost completely happy with this patch. :)

> @@ -694,25 +693,29 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
>        if (IS_ERR(intf->register_folder) || !intf->register_folder)
>                goto exit;
>
> -#define RT2X00DEBUGFS_CREATE_REGISTER_ENTRY(__intf, __name)    \
> -({                                                             \
> -       (__intf)->__name##_off_entry =                          \
> -           debugfs_create_u32(__stringify(__name) "_offset",   \
> -                              S_IRUSR | S_IWUSR,               \
> -                              (__intf)->register_folder,       \
> -                              &(__intf)->offset_##__name);     \
> -       if (IS_ERR((__intf)->__name##_off_entry)                \
> -                       || !(__intf)->__name##_off_entry)       \
> -               goto exit;                                      \
> -                                                               \
> -       (__intf)->__name##_val_entry =                          \
> -           debugfs_create_file(__stringify(__name) "_value",   \
> -                               S_IRUSR | S_IWUSR,              \
> -                               (__intf)->register_folder,      \
> -                               (__intf), &rt2x00debug_fop_##__name);\
> -       if (IS_ERR((__intf)->__name##_val_entry)                \
> -                       || !(__intf)->__name##_val_entry)       \
> -               goto exit;                                      \
> +#define RT2X00DEBUGFS_CREATE_REGISTER_ENTRY(__intf, __name)                    \
> +({                                                                             \
> +       if(debug->__name.read) {                                                \
> +               (__intf)->__name##_off_entry =                                  \
> +               debugfs_create_u32(__stringify(__name) "_offset",               \
> +                                      S_IRUSR | S_IWUSR,                       \
> +                                      (__intf)->register_folder,               \
> +                                      &(__intf)->offset_##__name);             \
> +               if (IS_ERR((__intf)->__name##_off_entry)                        \
> +                               || !(__intf)->__name##_off_entry)               \
> +                       goto exit;                                              \
> +                                                                               \
> +               (__intf)->__name##_val_entry =                                  \
> +               debugfs_create_file(__stringify(__name) "_value",               \
> +                                       S_IRUSR | S_IWUSR,                      \
> +                                       (__intf)->register_folder,              \
> +                                       (__intf), &rt2x00debug_fop_##__name);   \
> +               if (IS_ERR((__intf)->__name##_val_entry)                        \
> +                               || !(__intf)->__name##_val_entry)               \
> +                       goto exit;                                              \
> +       } else                                                                  \
> +               DEBUG(rt2x00dev, "Unsupported register on this device: "        \
> +                       __stringify(__name) "\n");                              \
>  })

I don't think we need to print error messages to the log, this will
only confuse users.
The driver intentionally didn't register the register type, so it is
not worth the warning to the user.

Ivo
ÿôèº{.nÇ+?·?®?­?+%?Ëÿ±éݶ¥?wÿº{.nÇ+?·¥?{±ÿ«zW¬³ø§¶?¡Ü¨}©?²Æ zÚ&j:+v?¨þø¯ù®w¥þ?à2?Þ?¨è­Ú&¢)ß¡«a¶Úÿÿûàz¿äz¹Þ?ú+?ù???Ý¢jÿ?wèþf



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux