diff options
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r-- | drivers/ide/ide.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 258805da15c3..0920e3b0c962 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -337,6 +337,7 @@ static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp) | |||
337 | int a, b, i, j = 1; | 337 | int a, b, i, j = 1; |
338 | unsigned int *dev_param_mask = (unsigned int *)kp->arg; | 338 | unsigned int *dev_param_mask = (unsigned int *)kp->arg; |
339 | 339 | ||
340 | /* controller . device (0 or 1) [ : 1 (set) | 0 (clear) ] */ | ||
340 | if (sscanf(s, "%d.%d:%d", &a, &b, &j) != 3 && | 341 | if (sscanf(s, "%d.%d:%d", &a, &b, &j) != 3 && |
341 | sscanf(s, "%d.%d", &a, &b) != 2) | 342 | sscanf(s, "%d.%d", &a, &b) != 2) |
342 | return -EINVAL; | 343 | return -EINVAL; |
@@ -349,7 +350,7 @@ static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp) | |||
349 | if (j) | 350 | if (j) |
350 | *dev_param_mask |= (1 << i); | 351 | *dev_param_mask |= (1 << i); |
351 | else | 352 | else |
352 | *dev_param_mask &= (1 << i); | 353 | *dev_param_mask &= ~(1 << i); |
353 | 354 | ||
354 | return 0; | 355 | return 0; |
355 | } | 356 | } |
@@ -392,6 +393,8 @@ static int ide_set_disk_chs(const char *str, struct kernel_param *kp) | |||
392 | { | 393 | { |
393 | int a, b, c = 0, h = 0, s = 0, i, j = 1; | 394 | int a, b, c = 0, h = 0, s = 0, i, j = 1; |
394 | 395 | ||
396 | /* controller . device (0 or 1) : Cylinders , Heads , Sectors */ | ||
397 | /* controller . device (0 or 1) : 1 (use CHS) | 0 (ignore CHS) */ | ||
395 | if (sscanf(str, "%d.%d:%d,%d,%d", &a, &b, &c, &h, &s) != 5 && | 398 | if (sscanf(str, "%d.%d:%d,%d,%d", &a, &b, &c, &h, &s) != 5 && |
396 | sscanf(str, "%d.%d:%d", &a, &b, &j) != 3) | 399 | sscanf(str, "%d.%d:%d", &a, &b, &j) != 3) |
397 | return -EINVAL; | 400 | return -EINVAL; |
@@ -407,7 +410,7 @@ static int ide_set_disk_chs(const char *str, struct kernel_param *kp) | |||
407 | if (j) | 410 | if (j) |
408 | ide_disks |= (1 << i); | 411 | ide_disks |= (1 << i); |
409 | else | 412 | else |
410 | ide_disks &= (1 << i); | 413 | ide_disks &= ~(1 << i); |
411 | 414 | ||
412 | ide_disks_chs[i].cyl = c; | 415 | ide_disks_chs[i].cyl = c; |
413 | ide_disks_chs[i].head = h; | 416 | ide_disks_chs[i].head = h; |
@@ -469,6 +472,8 @@ static int ide_set_ignore_cable(const char *s, struct kernel_param *kp) | |||
469 | { | 472 | { |
470 | int i, j = 1; | 473 | int i, j = 1; |
471 | 474 | ||
475 | /* controller (ignore) */ | ||
476 | /* controller : 1 (ignore) | 0 (use) */ | ||
472 | if (sscanf(s, "%d:%d", &i, &j) != 2 && sscanf(s, "%d", &i) != 1) | 477 | if (sscanf(s, "%d:%d", &i, &j) != 2 && sscanf(s, "%d", &i) != 1) |
473 | return -EINVAL; | 478 | return -EINVAL; |
474 | 479 | ||
@@ -478,7 +483,7 @@ static int ide_set_ignore_cable(const char *s, struct kernel_param *kp) | |||
478 | if (j) | 483 | if (j) |
479 | ide_ignore_cable |= (1 << i); | 484 | ide_ignore_cable |= (1 << i); |
480 | else | 485 | else |
481 | ide_ignore_cable &= (1 << i); | 486 | ide_ignore_cable &= ~(1 << i); |
482 | 487 | ||
483 | return 0; | 488 | return 0; |
484 | } | 489 | } |