File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -1376,8 +1376,7 @@ static struct switchtec_dev *stdev_create(struct pci_dev *pdev)
1376
1376
dev -> groups = switchtec_device_groups ;
1377
1377
dev -> release = stdev_release ;
1378
1378
1379
- minor = ida_simple_get (& switchtec_minor_ida , 0 , 0 ,
1380
- GFP_KERNEL );
1379
+ minor = ida_alloc (& switchtec_minor_ida , GFP_KERNEL );
1381
1380
if (minor < 0 ) {
1382
1381
rc = minor ;
1383
1382
goto err_put ;
@@ -1692,7 +1691,7 @@ static int switchtec_pci_probe(struct pci_dev *pdev,
1692
1691
err_devadd :
1693
1692
stdev_kill (stdev );
1694
1693
err_put :
1695
- ida_simple_remove (& switchtec_minor_ida , MINOR (stdev -> dev .devt ));
1694
+ ida_free (& switchtec_minor_ida , MINOR (stdev -> dev .devt ));
1696
1695
put_device (& stdev -> dev );
1697
1696
return rc ;
1698
1697
}
@@ -1704,7 +1703,7 @@ static void switchtec_pci_remove(struct pci_dev *pdev)
1704
1703
pci_set_drvdata (pdev , NULL );
1705
1704
1706
1705
cdev_device_del (& stdev -> cdev , & stdev -> dev );
1707
- ida_simple_remove (& switchtec_minor_ida , MINOR (stdev -> dev .devt ));
1706
+ ida_free (& switchtec_minor_ida , MINOR (stdev -> dev .devt ));
1708
1707
dev_info (& stdev -> dev , "unregistered.\n" );
1709
1708
stdev_kill (stdev );
1710
1709
put_device (& stdev -> dev );
You can’t perform that action at this time.
0 commit comments