summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-bsp/i2cdev/i2cdev/fix-musl.patch122
-rw-r--r--meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb1
2 files changed, 123 insertions, 0 deletions
diff --git a/meta-oe/recipes-bsp/i2cdev/i2cdev/fix-musl.patch b/meta-oe/recipes-bsp/i2cdev/i2cdev/fix-musl.patch
new file mode 100644
index 0000000000..59fd379dec
--- /dev/null
+++ b/meta-oe/recipes-bsp/i2cdev/i2cdev/fix-musl.patch
@@ -0,0 +1,122 @@
1From ce3affeb45a65649dda1edc9a4f0586e9db47ada Mon Sep 17 00:00:00 2001
2Message-Id: <ce3affeb45a65649dda1edc9a4f0586e9db47ada.1705064898.git.joerg.sommer@navimatix.de>
3From: =?UTF-8?q?J=C3=B6rg=20Sommer?= <joerg.sommer@navimatix.de>
4Date: Fri, 12 Jan 2024 13:59:51 +0100
5Subject: [PATCH] lsi2c: Replace error() by fprintf, drop error.h
6
7The MUSL C library doesn't support error.h. Because the only usage of this
8is the *error* function in lsi2c.c, this gets replaced by a *fprintf*. This
9doesn't print the program name, but keeps the message and the error
10description.
11
12Upstream-Status: Submitted [https://github.com/costad2/i2cdev/pull/5]
13---
14 libi2cdev/access.c | 1 -
15 libi2cdev/i2c-bus-parser.c | 1 -
16 libi2cdev/i2c-dev-path.c | 1 -
17 libi2cdev/i2c-error.c | 1 -
18 libi2cdev/init.c | 2 --
19 libi2cdev/sysfs.c | 1 -
20 lsi2c/lsi2c.c | 4 ++--
21 7 files changed, 2 insertions(+), 9 deletions(-)
22
23diff --git a/libi2cdev/access.c b/libi2cdev/access.c
24index 62a3f59..2e77659 100644
25--- a/libi2cdev/access.c
26+++ b/libi2cdev/access.c
27@@ -16,7 +16,6 @@
28
29 #include "busses.h"
30 #include "data.h"
31-#include "error.h"
32 #include "sysfs.h"
33
34 #include "i2cdiscov.h"
35diff --git a/libi2cdev/i2c-bus-parser.c b/libi2cdev/i2c-bus-parser.c
36index c4b8688..8c760e0 100644
37--- a/libi2cdev/i2c-bus-parser.c
38+++ b/libi2cdev/i2c-bus-parser.c
39@@ -27,7 +27,6 @@
40 #include <dirent.h>
41 #include <fcntl.h>
42 #include <errno.h>
43-#include <error.h>
44 #include <alloca.h>
45 #include <search.h>
46
47diff --git a/libi2cdev/i2c-dev-path.c b/libi2cdev/i2c-dev-path.c
48index b156db7..361761c 100644
49--- a/libi2cdev/i2c-dev-path.c
50+++ b/libi2cdev/i2c-dev-path.c
51@@ -11,7 +11,6 @@
52 #include <string.h>
53 #include <errno.h>
54 #include <stdio.h>
55-#include <error.h>
56
57 #include <linux/limits.h>
58
59diff --git a/libi2cdev/i2c-error.c b/libi2cdev/i2c-error.c
60index f92fb6b..540c112 100644
61--- a/libi2cdev/i2c-error.c
62+++ b/libi2cdev/i2c-error.c
63@@ -9,7 +9,6 @@
64
65 #include <stdlib.h>
66 #include <stdio.h>
67-#include <error.h>
68 #include <errno.h>
69 #include <stdbool.h>
70 #include <stdarg.h>
71diff --git a/libi2cdev/init.c b/libi2cdev/init.c
72index 99a7edd..dfc4090 100644
73--- a/libi2cdev/init.c
74+++ b/libi2cdev/init.c
75@@ -16,10 +16,8 @@
76 #include <errno.h>
77 #include <dirent.h>
78 #include <unistd.h>
79-#include <error.h>
80 #include <limits.h>
81 #include <ctype.h>
82-#include <error.h>
83 #include <fcntl.h>
84 #include <assert.h>
85
86diff --git a/libi2cdev/sysfs.c b/libi2cdev/sysfs.c
87index 2811500..a7e13a8 100644
88--- a/libi2cdev/sysfs.c
89+++ b/libi2cdev/sysfs.c
90@@ -17,7 +17,6 @@
91 #include <assert.h>
92 #include <string.h>
93 #include <fcntl.h>
94-#include <error.h>
95 #include <errno.h>
96
97 #include <sys/types.h>
98diff --git a/lsi2c/lsi2c.c b/lsi2c/lsi2c.c
99index 7af5313..34c6225 100644
100--- a/lsi2c/lsi2c.c
101+++ b/lsi2c/lsi2c.c
102@@ -38,7 +38,6 @@
103 #include <stdlib.h>
104 #include <string.h>
105 #include <errno.h>
106-#include <error.h>
107 #include <getopt.h>
108 #include <stdbool.h>
109
110@@ -205,7 +204,8 @@ static int read_config_file(const char *config_file_name)
111 if (err < 0) {
112 err = -err;
113 }
114- error(0, err, "Failed to initialize i2cdevices");
115+ fflush(stdout);
116+ fprintf(stderr, "Failed to initialize i2cdevices: %s", strerror(err));
117 if (config_file) {
118 fclose(config_file);
119 }
120--
1212.34.1
122
diff --git a/meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb b/meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb
index b41ecffae4..b2b5fda09e 100644
--- a/meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb
+++ b/meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb
@@ -17,6 +17,7 @@ PR = "git${SRCPV}"
17SRC_URI = "\ 17SRC_URI = "\
18 git://github.com/costad2/i2cdev.git;protocol=https;branch=master \ 18 git://github.com/costad2/i2cdev.git;protocol=https;branch=master \
19 file://fix-lsi2c-makefile.patch \ 19 file://fix-lsi2c-makefile.patch \
20 file://fix-musl.patch \
20" 21"
21SRCREV = "ed9ad777d842880e7ac6ca5e0de4bd2d3b4d02dc" 22SRCREV = "ed9ad777d842880e7ac6ca5e0de4bd2d3b4d02dc"
22 23