File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1376,8 +1376,7 @@ static struct switchtec_dev *stdev_create(struct pci_dev *pdev)
13761376 dev -> groups = switchtec_device_groups ;
13771377 dev -> release = stdev_release ;
13781378
1379- minor = ida_simple_get (& switchtec_minor_ida , 0 , 0 ,
1380- GFP_KERNEL );
1379+ minor = ida_alloc (& switchtec_minor_ida , GFP_KERNEL );
13811380 if (minor < 0 ) {
13821381 rc = minor ;
13831382 goto err_put ;
@@ -1692,7 +1691,7 @@ static int switchtec_pci_probe(struct pci_dev *pdev,
16921691err_devadd :
16931692 stdev_kill (stdev );
16941693err_put :
1695- ida_simple_remove (& switchtec_minor_ida , MINOR (stdev -> dev .devt ));
1694+ ida_free (& switchtec_minor_ida , MINOR (stdev -> dev .devt ));
16961695 put_device (& stdev -> dev );
16971696 return rc ;
16981697}
@@ -1704,7 +1703,7 @@ static void switchtec_pci_remove(struct pci_dev *pdev)
17041703 pci_set_drvdata (pdev , NULL );
17051704
17061705 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 ));
17081707 dev_info (& stdev -> dev , "unregistered.\n" );
17091708 stdev_kill (stdev );
17101709 put_device (& stdev -> dev );
You can’t perform that action at this time.
0 commit comments