Example #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)
}
Example #2
0
File: udev.go Project: jessta/udev
func (d Device) Parent() Device {
	return Device{C.udev_device_get_parent(d.ptr)}
}