[PATCH 39/47] patches: Adapt signature of bus_type->remove callback

Hauke Mehrtens <[email protected]>
Newsgroups org.kernel.vger.backports
Message-ID <[email protected]>
With kernel 5.15 the return type of the bus_type->remove callback was
changed from int to void.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
 patches/0102-remove-callback.patch | 63 ++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 patches/0102-remove-callback.patch

diff --git a/patches/0102-remove-callback.patch b/patches/0102-remove-callback.patch
new file mode 100644
index 00000000..9f5a54f1
--- /dev/null
+++ b/patches/0102-remove-callback.patch
@@ -0,0 +1,63 @@
+--- a/drivers/bcma/main.c
++++ b/drivers/bcma/main.c
+@@ -28,6 +28,7 @@ static DEFINE_MUTEX(bcma_buses_mutex);
+ static int bcma_bus_match(struct device *dev, struct device_driver *drv);
+ static int bcma_device_probe(struct device *dev);
+ static void bcma_device_remove(struct device *dev);
++static int bcma_device_remove_bp(struct device *dev);
+ static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env);
+ 
+ static ssize_t manuf_show(struct device *dev, struct device_attribute *attr, char *buf)
+@@ -71,7 +72,11 @@ static struct bus_type bcma_bus_type = {
+ 	.name		= "bcma",
+ 	.match		= bcma_bus_match,
+ 	.probe		= bcma_device_probe,
++#if LINUX_VERSION_IS_GEQ(5,15,0)
+ 	.remove		= bcma_device_remove,
++#else
++	.remove		= bcma_device_remove_bp,
++#endif
+ 	.uevent		= bcma_device_uevent,
+ 	.dev_groups	= bcma_device_groups,
+ };
+@@ -625,6 +630,12 @@ static void bcma_device_remove(struct de
+ 	put_device(dev);
+ }
+ 
++static int bcma_device_remove_bp(struct device *dev)
++{
++	bcma_device_remove(dev);
++	return 0;
++}
++
+ static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env)
+ {
+ 	struct bcma_device *core = container_of(dev, struct bcma_device, dev);
+--- a/drivers/ssb/main.c
++++ b/drivers/ssb/main.c
+@@ -293,6 +293,13 @@ static void ssb_device_remove(struct dev
+ 	ssb_device_put(ssb_dev);
+ }
+ 
++static int ssb_device_remove_bp(struct device *dev)
++{
++	ssb_device_remove(dev);
++
++	return 0;
++}
++
+ static int ssb_device_probe(struct device *dev)
+ {
+ 	struct ssb_device *ssb_dev = dev_to_ssb_dev(dev);
+@@ -388,7 +395,11 @@ static struct bus_type ssb_bustype = {
+ 	.name		= "ssb",
+ 	.match		= ssb_bus_match,
+ 	.probe		= ssb_device_probe,
++#if LINUX_VERSION_IS_GEQ(5,15,0)
+ 	.remove		= ssb_device_remove,
++#else
++	.remove		= ssb_device_remove_bp,
++#endif
+ 	.shutdown	= ssb_device_shutdown,
+ 	.suspend	= ssb_device_suspend,
+ 	.resume		= ssb_device_resume,
-- 
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.