aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Hainke <vincent@systemli.org>2023-05-26 21:01:01 +0200
committerNick Hainke <vincent@systemli.org>2024-02-10 13:06:05 +0100
commit3358045d1db3c50f252f19d0c2f0e0ccaae396ae (patch)
tree0b8ffb3ef64006296d1f9ea05415d404847417fe
parent0561613319f403dc139c339790511682785e2cfc (diff)
downloadupstream-3358045d1db3c50f252f19d0c2f0e0ccaae396ae.tar.gz
upstream-3358045d1db3c50f252f19d0c2f0e0ccaae396ae.tar.bz2
upstream-3358045d1db3c50f252f19d0c2f0e0ccaae396ae.zip
ramips: 6.1: pinctrl: fix compilation with 6.1
Upstream changed in ed5c2f5fd10d ("i2c: Make remove callback return void") the i2c driver's remove function to return no value. Adapt the driver code to compile with 5.15 and 6.1 like it is done in other projects [0]. Fixes errors in the form of: make[8]: Leaving directory '/home/nick/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-6.1.29' CC drivers/pinctrl/pinctrl-aw9523.o drivers/pinctrl/pinctrl-aw9523.c:1117:19: error: initialization of 'void (*)(struct i2c_client *)' from incompatible pointer type 'int (*)(struct i2c_client *)' [-Werror=incompatible-pointer-types] 1117 | .remove = aw9523_remove, | ^~~~~~~~~~~~~ drivers/pinctrl/pinctrl-aw9523.c:1117:19: note: (near initialization for 'aw9523_driver.remove') cc1: all warnings being treated as errors [0] - https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux/-/merge_requests/10/diffs Signed-off-by: Nick Hainke <vincent@systemli.org>
-rw-r--r--target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c b/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c
index 4900c5a0c0e..e151f445901 100644
--- a/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c
+++ b/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c
@@ -1097,6 +1097,13 @@ static int aw9523_remove(struct i2c_client *client)
return 0;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+static void aw9523_remove_void(struct i2c_client *client)
+{
+ aw9523_remove(client);
+}
+#endif
+
static const struct i2c_device_id aw9523_i2c_id_table[] = {
{ "aw9523_i2c", 0 },
{ }
@@ -1114,7 +1121,11 @@ static struct i2c_driver aw9523_driver = {
.of_match_table = of_aw9523_i2c_match,
},
.probe = aw9523_probe,
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+ .remove = aw9523_remove_void,
+ #else
.remove = aw9523_remove,
+ #endif
.id_table = aw9523_i2c_id_table,
};
module_i2c_driver(aw9523_driver);