diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2010-08-12 01:04:38 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-08-11 09:34:39 -0400 |
commit | 1a8bff5b404909436fcf03cac167a76ceaaa5547 (patch) | |
tree | da700485559d6d5f3d762627aeb45c06a0d7af9a | |
parent | c8ba6c52e19c13c2b6fb9ca9e5188799c753914c (diff) |
ide: use module_param_named rather than module_param_call
It has the additional benefit of typechecking (in this case, an unsigned int).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | drivers/ide/ide.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 3cb9c4e056ff..fa896210ed7b 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -177,7 +177,7 @@ EXPORT_SYMBOL_GPL(ide_pci_clk); | |||
177 | module_param_named(pci_clock, ide_pci_clk, int, 0); | 177 | module_param_named(pci_clock, ide_pci_clk, int, 0); |
178 | MODULE_PARM_DESC(pci_clock, "PCI bus clock frequency (in MHz)"); | 178 | MODULE_PARM_DESC(pci_clock, "PCI bus clock frequency (in MHz)"); |
179 | 179 | ||
180 | static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp) | 180 | static int ide_set_dev_param_mask(const char *s, const struct kernel_param *kp) |
181 | { | 181 | { |
182 | int a, b, i, j = 1; | 182 | int a, b, i, j = 1; |
183 | unsigned int *dev_param_mask = (unsigned int *)kp->arg; | 183 | unsigned int *dev_param_mask = (unsigned int *)kp->arg; |
@@ -200,34 +200,40 @@ static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp) | |||
200 | return 0; | 200 | return 0; |
201 | } | 201 | } |
202 | 202 | ||
203 | static struct kernel_param_ops param_ops_ide_dev_mask = { | ||
204 | .set = ide_set_dev_param_mask | ||
205 | }; | ||
206 | |||
207 | #define param_check_ide_dev_mask(name, p) param_check_uint(name, p) | ||
208 | |||
203 | static unsigned int ide_nodma; | 209 | static unsigned int ide_nodma; |
204 | 210 | ||
205 | module_param_call(nodma, ide_set_dev_param_mask, NULL, &ide_nodma, 0); | 211 | module_param_named(nodma, ide_nodma, ide_dev_mask, 0); |
206 | MODULE_PARM_DESC(nodma, "disallow DMA for a device"); | 212 | MODULE_PARM_DESC(nodma, "disallow DMA for a device"); |
207 | 213 | ||
208 | static unsigned int ide_noflush; | 214 | static unsigned int ide_noflush; |
209 | 215 | ||
210 | module_param_call(noflush, ide_set_dev_param_mask, NULL, &ide_noflush, 0); | 216 | module_param_named(noflush, ide_noflush, ide_dev_mask, 0); |
211 | MODULE_PARM_DESC(noflush, "disable flush requests for a device"); | 217 | MODULE_PARM_DESC(noflush, "disable flush requests for a device"); |
212 | 218 | ||
213 | static unsigned int ide_nohpa; | 219 | static unsigned int ide_nohpa; |
214 | 220 | ||
215 | module_param_call(nohpa, ide_set_dev_param_mask, NULL, &ide_nohpa, 0); | 221 | module_param_named(nohpa, ide_nohpa, ide_dev_mask, 0); |
216 | MODULE_PARM_DESC(nohpa, "disable Host Protected Area for a device"); | 222 | MODULE_PARM_DESC(nohpa, "disable Host Protected Area for a device"); |
217 | 223 | ||
218 | static unsigned int ide_noprobe; | 224 | static unsigned int ide_noprobe; |
219 | 225 | ||
220 | module_param_call(noprobe, ide_set_dev_param_mask, NULL, &ide_noprobe, 0); | 226 | module_param_named(noprobe, ide_noprobe, ide_dev_mask, 0); |
221 | MODULE_PARM_DESC(noprobe, "skip probing for a device"); | 227 | MODULE_PARM_DESC(noprobe, "skip probing for a device"); |
222 | 228 | ||
223 | static unsigned int ide_nowerr; | 229 | static unsigned int ide_nowerr; |
224 | 230 | ||
225 | module_param_call(nowerr, ide_set_dev_param_mask, NULL, &ide_nowerr, 0); | 231 | module_param_named(nowerr, ide_nowerr, ide_dev_mask, 0); |
226 | MODULE_PARM_DESC(nowerr, "ignore the ATA_DF bit for a device"); | 232 | MODULE_PARM_DESC(nowerr, "ignore the ATA_DF bit for a device"); |
227 | 233 | ||
228 | static unsigned int ide_cdroms; | 234 | static unsigned int ide_cdroms; |
229 | 235 | ||
230 | module_param_call(cdrom, ide_set_dev_param_mask, NULL, &ide_cdroms, 0); | 236 | module_param_named(cdrom, ide_cdroms, ide_dev_mask, 0); |
231 | MODULE_PARM_DESC(cdrom, "force device as a CD-ROM"); | 237 | MODULE_PARM_DESC(cdrom, "force device as a CD-ROM"); |
232 | 238 | ||
233 | struct chs_geom { | 239 | struct chs_geom { |