diff mbox series

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

Message ID 20211019214320.2035704-40-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to kernel 5.15-rc6 | expand

Commit Message

Hauke Mehrtens Oct. 19, 2021, 9:43 p.m. UTC
With kernel 5.15 the return type of the bus_type->remove callback was
changed from int to void.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0102-remove-callback.patch | 63 ++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 patches/0102-remove-callback.patch
diff mbox series

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,