Skip to contentSkip to conversation

Staging: dt3155: properly export the module parameter

PATCH In review H Hartley Sweeten 3 participants 6 messages Jul 28, 2010 – Aug 3, 2010 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: dt3155: properly export the module parameter

Make the module parameter dt3155_major static and add the proper wrappers to export it.

Cc Greg Kroah-Hartman <[email protected]>
Cc Scott Smedley <[email protected]>

---

drivers/staging/dt3155/dt3155_drv.c +3 -1
index 7316996..220eaf9 100644
@@ -99,7 +99,9 @@ wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS];
 
 /* set to dynamicaly allocate, but it is tunable: */
 /* insmod DT_3155 dt3155 dt3155_major=XX */
-int dt3155_major = 0;
+static int dt3155_major;
+module_param(dt3155_major, int, 0);
+MODULE_PARM_DESC(dt3155_major, "Major device number");
 
 /* The minor numbers are 0 and 1 ... they are not tunable.
  * They are used as the indices for the structure vectors,
#1 lore raw
Quoted 13 lines · H Hartley Sweeten

Make the module parameter dt3155_major static and add the proper wrappers to export it.

Cc Greg Kroah-Hartman <[email protected]>
Cc Scott Smedley <[email protected]>

---

drivers/staging/dt3155/dt3155_drv.c +0 -0
index 7316996..220eaf9 100644

drivers/staging/dt3155/dt3155_drv.c wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS]; · line 104

Quoted 7 lines
drivers/staging/dt3155/dt3155_drv.c +3 -1
@@ -99,7 +99,9 @@ wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS];
 
 /* set to dynamicaly allocate, but it is tunable: */
 /* insmod DT_3155 dt3155 dt3155_major=XX */
-int dt3155_major = 0;
+static int dt3155_major;
+module_param(dt3155_major, int, 0);
+MODULE_PARM_DESC(dt3155_major, "Major device number");

Is it necessary in the age of udev?

I would personally get rid of that completely...

regards,

Signature · 1 line
js
#2 lore raw
Quoted 24 lines · Jiri Slaby
Quoted 13 lines · H Hartley Sweeten

Make the module parameter dt3155_major static and add the proper wrappers to export it.

Cc Greg Kroah-Hartman <[email protected]>
Cc Scott Smedley <[email protected]>

---

drivers/staging/dt3155/dt3155_drv.c +0 -0
index 7316996..220eaf9 100644

drivers/staging/dt3155/dt3155_drv.c wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS]; · line 104

Quoted 7 lines
drivers/staging/dt3155/dt3155_drv.c +3 -1
@@ -99,7 +99,9 @@ wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS];
 
 /* set to dynamicaly allocate, but it is tunable: */
 /* insmod DT_3155 dt3155 dt3155_major=XX */
-int dt3155_major = 0;
+static int dt3155_major;
+module_param(dt3155_major, int, 0);
+MODULE_PARM_DESC(dt3155_major, "Major device number");

Is it necessary in the age of udev?

Quoted 1 line

I would personally get rid of that completely...

I agree but I'm not quite sure if the user space app is ready to handle that.

Scott, can you provide any input?

Regards,
Hartley

#3 lore raw
Quoted 15 lines · H Hartley Sweeten
Quoted 14 lines · Jiri Slaby

drivers/staging/dt3155/dt3155_drv.c wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS]; · line 104

Quoted 10 lines · H Hartley Sweeten
drivers/staging/dt3155/dt3155_drv.c +3 -1
@@ -99,7 +99,9 @@ wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS];
 
 /* set to dynamicaly allocate, but it is tunable: */
 /* insmod DT_3155 dt3155 dt3155_major=XX */
-int dt3155_major = 0;
+static int dt3155_major;
+module_param(dt3155_major, int, 0);
+MODULE_PARM_DESC(dt3155_major, "Major device number");

Is it necessary in the age of udev?

Quoted 3 lines
Quoted 1 line

I would personally get rid of that completely...

I agree but I'm not quite sure if the user space app is ready to handle that.

Given it was never exposed as a parameter, applications should handle that. 0 means allocate major dynamically...

regards,

Signature · 1 line
js
#4 lore raw
Quoted 16 lines · Jiri Slaby
Quoted 15 lines · H Hartley Sweeten
Quoted 14 lines · Jiri Slaby

drivers/staging/dt3155/dt3155_drv.c wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS]; · line 104

Quoted 10 lines · H Hartley Sweeten
drivers/staging/dt3155/dt3155_drv.c +3 -1
@@ -99,7 +99,9 @@ wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS];
 
 /* set to dynamicaly allocate, but it is tunable: */
 /* insmod DT_3155 dt3155 dt3155_major=XX */
-int dt3155_major = 0;
+static int dt3155_major;
+module_param(dt3155_major, int, 0);
+MODULE_PARM_DESC(dt3155_major, "Major device number");

Is it necessary in the age of udev?

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I would personally get rid of that completely...

I agree but I'm not quite sure if the user space app is ready to handle that.

Given it was never exposed as a parameter, applications should handle that. 0 means allocate major dynamically...

Understood.

I finally found the "official" site for the "DT3155 Framegrabber Linux Device Driver"

http://sourceforge.net/projects/dt3155a/

The script provided to load the module does grep /proc/devices to determine the major device number and then mknod's the appropriate devices.

I will update my patch and remove the "parameter" since it is not needed.

Thanks,
Hartley

#5 lore raw
Quoted 26 lines · H Hartley Sweeten
Quoted 16 lines · Jiri Slaby
Quoted 15 lines · H Hartley Sweeten
Quoted 14 lines · Jiri Slaby

drivers/staging/dt3155/dt3155_drv.c wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS]; · line 104

Quoted 10 lines · H Hartley Sweeten
drivers/staging/dt3155/dt3155_drv.c +3 -1
@@ -99,7 +99,9 @@ wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS];
 
 /* set to dynamicaly allocate, but it is tunable: */
 /* insmod DT_3155 dt3155 dt3155_major=XX */
-int dt3155_major = 0;
+static int dt3155_major;
+module_param(dt3155_major, int, 0);
+MODULE_PARM_DESC(dt3155_major, "Major device number");

Is it necessary in the age of udev?

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I would personally get rid of that completely...

I agree but I'm not quite sure if the user space app is ready to handle that.

Given it was never exposed as a parameter, applications should handle that. 0 means allocate major dynamically...

Understood.

Quoted 8 lines

I finally found the "official" site for the "DT3155 Framegrabber Linux Device Driver"

http://sourceforge.net/projects/dt3155a/

The script provided to load the module does grep /proc/devices to determine the major device number and then mknod's the appropriate devices.

I will update my patch and remove the "parameter" since it is not needed.

As there is another driver already in the tree for this device, dt3155v4l, I'm about to delete the dt3155 driver as it's no longer needed. So you might want to reconsider your work on this driver for the near future.

thanks,

greg k-h