Page MenuHomeFreeBSD

D30519.id90049.diff
No OneTemporary

D30519.id90049.diff

Index: sys/compat/linuxkpi/common/include/linux/device.h
===================================================================
--- sys/compat/linuxkpi/common/include/linux/device.h
+++ sys/compat/linuxkpi/common/include/linux/device.h
@@ -483,6 +483,39 @@
device_unregister(device_get_softc(bsddev));
}
+static inline int
+device_reprobe(struct device *dev)
+{
+ int error;
+
+ mtx_lock(&Giant);
+ error = BUS_RESCAN(dev->bsddev);
+ mtx_unlock(&Giant);
+ if (error == 0)
+ return (0);
+ /* Should we clear the driver? */
+ return (-error);
+}
+
+static inline void
+device_release_driver(struct device *dev)
+{
+ int error;
+
+ mtx_lock(&Giant);
+ error = device_is_attached(dev->bsddev);
+ if (error) {
+ error = device_detach(dev->bsddev);
+ if (error)
+ goto unlock;
+ }
+ device_set_devclass(dev->bsddev, NULL);
+ /* Who or what clears dev internal flags? */
+ device_probe_and_attach(dev->bsddev);
+unlock:
+ mtx_unlock(&Giant);
+}
+
#define dev_pm_set_driver_flags(dev, flags) do { \
} while (0)

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 3, 9:42 PM (11 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30780365
Default Alt Text
D30519.id90049.diff (1015 B)

Event Timeline