[PATCH 03/17] MIPS: ath79: Use errno to get error code from open_and_lseek()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Open_and_lseek() return actual error code via errno, so change the
code to use it instead of return value.

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
 arch/mips/mach-ath79/art.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/mach-ath79/art.c b/arch/mips/mach-ath79/art.c
index 984d08736..2a2099e9f 100644
--- a/arch/mips/mach-ath79/art.c
+++ b/arch/mips/mach-ath79/art.c
@@ -44,8 +44,8 @@ static int art_read_mac(struct device_d *dev, const char *file)
 	fd = open_and_lseek(file, O_RDONLY, AR93000_EPPROM_OFFSET);
 	if (fd < 0) {
 		dev_err(dev, "Failed to open eeprom path %s %d\n",
-		       file, fd);
-		return fd;
+		       file, -errno);
+		return -errno;
 	}
 
 	rbytes = read_full(fd, &eeprom, sizeof(eeprom));
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux