mirror of
https://github.com/kidoman/embd
synced 2025-07-04 20:37:46 +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
1 changed files with 1 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue