mirror of
https://github.com/kidoman/embd
synced 2024-06-01 08:38:05 +02:00
Code cleanup in NewGPIODriver func.
Don't assign the object to a variable just return it right away.
This commit is contained in:
parent
919b01a3a2
commit
e1a90ade4f
|
@ -34,7 +34,7 @@ type gpioDriver struct {
|
||||||
// NewGPIODriver returns a GPIODriver interface which allows control
|
// NewGPIODriver returns a GPIODriver interface which allows control
|
||||||
// over the GPIO subsystem.
|
// over the GPIO subsystem.
|
||||||
func NewGPIODriver(pinMap PinMap, dpf digitalPinFactory, apf analogPinFactory, ppf pwmPinFactory) GPIODriver {
|
func NewGPIODriver(pinMap PinMap, dpf digitalPinFactory, apf analogPinFactory, ppf pwmPinFactory) GPIODriver {
|
||||||
driver := &gpioDriver{
|
return &gpioDriver{
|
||||||
pinMap: pinMap,
|
pinMap: pinMap,
|
||||||
dpf: dpf,
|
dpf: dpf,
|
||||||
apf: apf,
|
apf: apf,
|
||||||
|
@ -43,7 +43,6 @@ func NewGPIODriver(pinMap PinMap, dpf digitalPinFactory, apf analogPinFactory, p
|
||||||
watchEventCallbacks: map[int]InterruptPin{},
|
watchEventCallbacks: map[int]InterruptPin{},
|
||||||
initializedPins: map[string]pin{},
|
initializedPins: map[string]pin{},
|
||||||
}
|
}
|
||||||
return driver
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var epollFD int
|
var epollFD int
|
||||||
|
|
Loading…
Reference in New Issue
Block a user