]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.4
authorSasha Levin <sashal@kernel.org>
Mon, 12 Jun 2023 03:51:40 +0000 (23:51 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 12 Jun 2023 03:51:40 +0000 (23:51 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.4/eeprom-at24-also-select-regmap.patch [new file with mode: 0644]
queue-5.4/i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/eeprom-at24-also-select-regmap.patch b/queue-5.4/eeprom-at24-also-select-regmap.patch
new file mode 100644 (file)
index 0000000..f9a6fac
--- /dev/null
@@ -0,0 +1,49 @@
+From 24f3b85250eddc8e49ab8eb0cd35eaf31f7015df Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 7 Jun 2023 19:54:24 -0700
+Subject: eeprom: at24: also select REGMAP
+
+From: Randy Dunlap <rdunlap@infradead.org>
+
+[ Upstream commit 7f3c782b3914e510b646a77aedc3adeac2e4a63b ]
+
+Selecting only REGMAP_I2C can leave REGMAP unset, causing build errors,
+so also select REGMAP to prevent the build errors.
+
+../drivers/misc/eeprom/at24.c:540:42: warning: 'struct regmap_config' declared inside parameter list will not be visible outside of this definition or declaration
+  540 |                                   struct regmap_config *regmap_config)
+../drivers/misc/eeprom/at24.c: In function 'at24_make_dummy_client':
+../drivers/misc/eeprom/at24.c:552:18: error: implicit declaration of function 'devm_regmap_init_i2c' [-Werror=implicit-function-declaration]
+  552 |         regmap = devm_regmap_init_i2c(dummy_client, regmap_config);
+../drivers/misc/eeprom/at24.c:552:16: warning: assignment to 'struct regmap *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
+  552 |         regmap = devm_regmap_init_i2c(dummy_client, regmap_config);
+../drivers/misc/eeprom/at24.c: In function 'at24_probe':
+../drivers/misc/eeprom/at24.c:586:16: error: variable 'regmap_config' has initializer but incomplete type
+  586 |         struct regmap_config regmap_config = { };
+../drivers/misc/eeprom/at24.c:586:30: error: storage size of 'regmap_config' isn't known
+  586 |         struct regmap_config regmap_config = { };
+../drivers/misc/eeprom/at24.c:586:30: warning: unused variable 'regmap_config' [-Wunused-variable]
+
+Fixes: 5c015258478e ("eeprom: at24: add basic regmap_i2c support")
+Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/misc/eeprom/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/misc/eeprom/Kconfig b/drivers/misc/eeprom/Kconfig
+index 0f791bfdc1f58..c92f2cdf40263 100644
+--- a/drivers/misc/eeprom/Kconfig
++++ b/drivers/misc/eeprom/Kconfig
+@@ -6,6 +6,7 @@ config EEPROM_AT24
+       depends on I2C && SYSFS
+       select NVMEM
+       select NVMEM_SYSFS
++      select REGMAP
+       select REGMAP_I2C
+       help
+         Enable this driver to get read/write support to most I2C EEPROMs
+-- 
+2.39.2
+
diff --git a/queue-5.4/i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch b/queue-5.4/i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch
new file mode 100644 (file)
index 0000000..27fee56
--- /dev/null
@@ -0,0 +1,53 @@
+From 71da6ba635bf88717d982c056550c4c44a0c2ff9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 9 Mar 2023 10:58:19 +0100
+Subject: i2c: sprd: Delete i2c adapter in .remove's error path
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+
+[ Upstream commit ca0aa17f2db3468fd017038d23a78e17388e2f67 ]
+
+If pm runtime resume fails the .remove callback used to exit early. This
+resulted in an error message by the driver core but the device gets
+removed anyhow. This lets the registered i2c adapter stay around with an
+unbound parent device.
+
+So only skip clk disabling if resume failed, but do delete the adapter.
+
+Fixes: 8b9ec0719834 ("i2c: Add Spreadtrum I2C controller driver")
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
+Signed-off-by: Wolfram Sang <wsa@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/i2c/busses/i2c-sprd.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/i2c/busses/i2c-sprd.c b/drivers/i2c/busses/i2c-sprd.c
+index 92ba0183fd8a0..ef0dc06a3778e 100644
+--- a/drivers/i2c/busses/i2c-sprd.c
++++ b/drivers/i2c/busses/i2c-sprd.c
+@@ -577,12 +577,14 @@ static int sprd_i2c_remove(struct platform_device *pdev)
+       struct sprd_i2c *i2c_dev = platform_get_drvdata(pdev);
+       int ret;
+-      ret = pm_runtime_resume_and_get(i2c_dev->dev);
++      ret = pm_runtime_get_sync(i2c_dev->dev);
+       if (ret < 0)
+-              return ret;
++              dev_err(&pdev->dev, "Failed to resume device (%pe)\n", ERR_PTR(ret));
+       i2c_del_adapter(&i2c_dev->adap);
+-      clk_disable_unprepare(i2c_dev->clk);
++
++      if (ret >= 0)
++              clk_disable_unprepare(i2c_dev->clk);
+       pm_runtime_put_noidle(i2c_dev->dev);
+       pm_runtime_disable(i2c_dev->dev);
+-- 
+2.39.2
+
index 158515200bacf9aa45c38578b686ee8c5c9b6582..08d71b6e1ed50fc2450bbb23a6f4cedbf7dea094 100644 (file)
@@ -32,3 +32,5 @@ pinctrl-meson-axg-add-missing-gpioa_18-gpio-group.patch
 usb-usbfs-enforce-page-requirements-for-mmap.patch
 usb-usbfs-use-consistent-mmap-functions.patch
 bonding-gcc13-synchronize-bond_-a-t-lb_xmit-types.patch
+i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch
+eeprom-at24-also-select-regmap.patch