File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ static void __remove(struct device *dev)
410
410
411
411
if (oud -> disk )
412
412
put_disk (oud -> disk );
413
- ida_remove (& osd_minor_ida , oud -> minor );
413
+ ida_simple_remove (& osd_minor_ida , oud -> minor );
414
414
415
415
kfree (oud );
416
416
}
@@ -426,19 +426,12 @@ static int osd_probe(struct device *dev)
426
426
if (scsi_device -> type != TYPE_OSD )
427
427
return - ENODEV ;
428
428
429
- do {
430
- if (!ida_pre_get (& osd_minor_ida , GFP_KERNEL ))
431
- return - ENODEV ;
432
-
433
- error = ida_get_new (& osd_minor_ida , & minor );
434
- } while (error == - EAGAIN );
435
-
436
- if (error )
437
- return error ;
438
- if (minor >= SCSI_OSD_MAX_MINOR ) {
439
- error = - EBUSY ;
440
- goto err_retract_minor ;
441
- }
429
+ minor = ida_simple_get (& osd_minor_ida , 0 , SCSI_OSD_MAX_MINOR ,
430
+ GFP_KERNEL );
431
+ if (minor == - ENOSPC )
432
+ return - EBUSY ;
433
+ else if (minor < 0 )
434
+ return minor ;
442
435
443
436
error = - ENOMEM ;
444
437
oud = kzalloc (sizeof (* oud ), GFP_KERNEL );
@@ -514,7 +507,7 @@ static int osd_probe(struct device *dev)
514
507
dev_set_drvdata (dev , NULL );
515
508
kfree (oud );
516
509
err_retract_minor :
517
- ida_remove (& osd_minor_ida , minor );
510
+ ida_simple_remove (& osd_minor_ida , minor );
518
511
return error ;
519
512
}
520
513
You can’t perform that action at this time.
0 commit comments