Re: composite.c: module parameters

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

 



On Wed, Apr 14, 2010 at 06:41:00PM +0200, Micha?? Nazarewicz wrote:
Hello everyone,

I've noticed that composite.c declares several module parameters
to let one change various device IDs, however, those have
permissions set to zero.  Is there any reason why not to set them
to 0644?

On Wed, 14 Apr 2010 18:59:49 +0200, Greg KH <greg@xxxxxxxxx> wrote:
I think it is because you can't change these after the module is loaded,
it needs to be there before the connection happens, right?

Oh...  So zero as perm means that one can set the value as a module
parameter but then it won't be seen in sysfs? Now I get it, thanks!

Still, since with FunctionFS the composite device may be registered
and deregistered several times while the module is running would it
make sense to create a macro for changing the perm? I'm thinking of

#v+
#ifndef USB_COMPOSITE_PARAM_PERM
#  define USB_COMPOSITE_PARAM_PERM 0
#endif

static ushort idVendor;
module_param(idVendor, ushort, USB_COMPOSITE_PARAM_PERM);
MODULE_PARM_DESC(idVendor, "USB Vendor ID");

/* ... */
#v-

#v+
#define USB_COMPOSITE_PARAM_PERM 0644
#include "composite.c"
#v-

Or is it too ugly?  For me, the other solution would be duplicating
similar functionality in the g_ffs (see my patches last week) which
I would like to avoid.

--
Best regards,                                           _     _
 .o. | Liege of Serenely Enlightened Majesty of       o' \,=./ `o
 ..o | Computer Science,  Michał "mina86" Nazarewicz     (o o)
 ooo +---[mina86@xxxxxxxxxx]---[mina86@jabber.org]---ooO--(_)--Ooo--
--
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