mirror of
https://github.com/openwrt/openwrt.git
synced 2025-04-07 19:34:48 +00:00
ramips: 5.15: handle return from device_reset in I2C driver
Handle return from device reset in I2C driver. Don't fail on device_reset error but print a warning. Fix compilation warning: sound/soc/ralink/ralink-i2s.c: In function 'ralink_i2s_probe': sound/soc/ralink/ralink-i2s.c:885:9: error: ignoring return value of 'device_reset' declared with attribute 'warn_unused_result' [-Werror=unused-result] 885 | device_reset(&pdev->dev); | ^~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
parent
7f54fa575b
commit
b786d744ef
@ -69,7 +69,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
obj-$(CONFIG_I2C_QUP) += i2c-qup.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-ralink.c
|
||||
@@ -0,0 +1,435 @@
|
||||
@@ -0,0 +1,440 @@
|
||||
+/*
|
||||
+ * drivers/i2c/busses/i2c-ralink.c
|
||||
+ *
|
||||
@ -245,7 +245,12 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
+
|
||||
+static void rt_i2c_reset(struct rt_i2c *i2c)
|
||||
+{
|
||||
+ device_reset(i2c->adap.dev.parent);
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = device_reset(i2c->adap.dev.parent);
|
||||
+ if (ret)
|
||||
+ dev_err(i2c->dev, "Failed to reset device");
|
||||
+
|
||||
+ barrier();
|
||||
+ rt_i2c_w32(i2c, i2c->clk_div, REG_CLKDIV_REG);
|
||||
+}
|
||||
|
Loading…
x
Reference in New Issue
Block a user