From 8739ed289ed5c5fb961d84d664ebdd24949c01bc Mon Sep 17 00:00:00 2001
From: Joseph Poirier <jdpoirier@gmail.com>
Date: Mon, 23 Nov 2015 14:15:41 -0600
Subject: [PATCH] revert WriteEeprom return logic

---
 rtlsdr.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rtlsdr.go b/rtlsdr.go
index b3f7320..0bd515c 100644
--- a/rtlsdr.go
+++ b/rtlsdr.go
@@ -271,15 +271,15 @@ func (dev *Context) WriteEeprom(data []uint8, offset uint8, leng uint16) (err er
 		C.uint8_t(offset),
 		C.uint16_t(leng)))
 	switch {
-	case i == 0:
-		return
+	default:
+		err = nil
 	case i == -1:
 		err = errors.New("device handle is invalid")
 	case i == -2:
 		err = errors.New("EEPROM size exceeded")
 	case i == -3:
 		err = errors.New("no EEPROM was found")
-	default:
+	case i < -4:
 		err = errors.New("unknown error")
 	}
 	return