Commit 1c184ba
rtc: cmos: Fix return value of nvmem callbacks
Read/write callbacks registered with nvmem core expect 0 to be returned
on success and a negative value to be returned on failure.
cmos_nvram_read()/cmos_nvram_write() currently return the number of
bytes read or written, fix to return 0 on success and -EIO incase number
of bytes requested was not read or written.
Fixes: 8b5b795 ("rtc: cmos: use generic nvmem")
Cc: [email protected]
Signed-off-by: Joy Chakraborty <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>1 parent 70f1ae5 commit 1c184ba
1 file changed
+4
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
646 | | - | |
647 | 646 | | |
648 | 647 | | |
649 | 648 | | |
650 | | - | |
| 649 | + | |
651 | 650 | | |
652 | 651 | | |
653 | 652 | | |
| |||
657 | 656 | | |
658 | 657 | | |
659 | 658 | | |
660 | | - | |
| 659 | + | |
661 | 660 | | |
662 | 661 | | |
663 | 662 | | |
664 | 663 | | |
665 | 664 | | |
666 | 665 | | |
667 | 666 | | |
668 | | - | |
669 | 667 | | |
670 | 668 | | |
671 | 669 | | |
| |||
674 | 672 | | |
675 | 673 | | |
676 | 674 | | |
677 | | - | |
| 675 | + | |
678 | 676 | | |
679 | 677 | | |
680 | 678 | | |
| |||
689 | 687 | | |
690 | 688 | | |
691 | 689 | | |
692 | | - | |
| 690 | + | |
693 | 691 | | |
694 | 692 | | |
695 | 693 | | |
| |||
0 commit comments