File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -725,6 +725,39 @@ static void idxd_cleanup(struct idxd_device *idxd)
725
725
idxd_disable_sva (idxd -> pdev );
726
726
}
727
727
728
+ /*
729
+ * Attach IDXD device to IDXD driver.
730
+ */
731
+ static int idxd_bind (struct device_driver * drv , const char * buf )
732
+ {
733
+ const struct bus_type * bus = drv -> bus ;
734
+ struct device * dev ;
735
+ int err = - ENODEV ;
736
+
737
+ dev = bus_find_device_by_name (bus , NULL , buf );
738
+ if (dev )
739
+ err = device_driver_attach (drv , dev );
740
+
741
+ put_device (dev );
742
+
743
+ return err ;
744
+ }
745
+
746
+ /*
747
+ * Detach IDXD device from driver.
748
+ */
749
+ static void idxd_unbind (struct device_driver * drv , const char * buf )
750
+ {
751
+ const struct bus_type * bus = drv -> bus ;
752
+ struct device * dev ;
753
+
754
+ dev = bus_find_device_by_name (bus , NULL , buf );
755
+ if (dev && dev -> driver == drv )
756
+ device_release_driver (dev );
757
+
758
+ put_device (dev );
759
+ }
760
+
728
761
/*
729
762
* Probe idxd PCI device.
730
763
* If idxd is not given, need to allocate idxd and set up its data.
You can’t perform that action at this time.
0 commit comments