Beispiel #1
0
// Parent returns the parent Device, or nil if the receiver has no parent Device
func (d *Device) Parent() *Device {
	d.lock()
	defer d.unlock()
	ptr := C.udev_device_get_parent(d.ptr)
	if ptr != nil {
		C.udev_device_ref(ptr)
	}
	return d.u.newDevice(ptr)
}
Beispiel #2
0
func (d Device) Parent() Device {
	return Device{C.udev_device_get_parent(d.ptr)}
}