mirror of https://github.com/kidoman/embd
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
|
||||
// over the GPIO subsystem.
|
||||
func NewGPIODriver(pinMap PinMap, dpf digitalPinFactory, apf analogPinFactory, ppf pwmPinFactory) GPIODriver {
|
||||
driver := &gpioDriver{
|
||||
return &gpioDriver{
|
||||
pinMap: pinMap,
|
||||
dpf: dpf,
|
||||
apf: apf,
|
||||
|
@ -43,7 +43,6 @@ func NewGPIODriver(pinMap PinMap, dpf digitalPinFactory, apf analogPinFactory, p
|
|||
watchEventCallbacks: map[int]InterruptPin{},
|
||||
initializedPins: map[string]pin{},
|
||||
}
|
||||
return driver
|
||||
}
|
||||
|
||||
var epollFD int
|
||||
|
|
Loading…
Reference in New Issue