machine/spi: do not compare slices against nil, same as #612 but for all platforms that use shared SPI implementation for Tx

Signed-off-by: Ron Evans <ron@hybridgroup.com>
Этот коммит содержится в:
Ron Evans 2019-10-11 08:49:46 +02:00 коммит произвёл Ayke
родитель ba49148644
коммит be9e4f439c

Просмотреть файл

@ -5,7 +5,6 @@ package machine
import "errors" import "errors"
var ( var (
ErrTxSlicesRequired = errors.New("SPI Tx requires a write or read slice, or both")
ErrTxInvalidSliceSize = errors.New("SPI write and read slices must be same size") ErrTxInvalidSliceSize = errors.New("SPI write and read slices must be same size")
) )
@ -28,10 +27,6 @@ var (
// spi.Tx(nil, rx) // spi.Tx(nil, rx)
// //
func (spi SPI) Tx(w, r []byte) error { func (spi SPI) Tx(w, r []byte) error {
if w == nil && r == nil {
return ErrTxSlicesRequired
}
var err error var err error
switch { switch {