From 9c06fde72f9f44697a9f18c79a94ca007e20c141 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Fri, 23 Aug 2013 12:28:19 +0200 Subject: [PATCH] backport: backport device_move() properly This was causing conflicts again when updating against wireless-next, so instead of adjusting the patches just provide a proper static inline backport. Signed-off-by: Johannes Berg Signed-off-by: Luis R. Rodriguez --- backport/backport-include/linux/device.h | 10 ++++++++ .../net_bluetooth_hci_sysfs.patch | 12 --------- .../net_bluetooth_rfcomm_tty.patch | 25 ------------------- 3 files changed, 10 insertions(+), 37 deletions(-) diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h index 518803e73e66..239fe39367b4 100644 --- a/backport/backport-include/linux/device.h +++ b/backport/backport-include/linux/device.h @@ -28,6 +28,16 @@ typedef int (backport_device_find_function_t)(struct device *, void *); dev_printk(KERN_CRIT , dev , format , ## arg) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) +static inline int +backport_device_move(struct device *dev, struct device *new_parent, + enum dpm_order dpm_order) +{ + return device_move(dev, new_parent); +} +#define device_move LINUX_BACKPORT(device_move) +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) /** * module_driver() - Helper macro for drivers that don't do anything diff --git a/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hci_sysfs.patch b/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hci_sysfs.patch index 4def823e351d..b4f7b1d5434f 100644 --- a/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hci_sysfs.patch +++ b/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hci_sysfs.patch @@ -12,18 +12,6 @@ &bt_link_group, NULL }; -@@ -141,7 +145,11 @@ void hci_conn_del_sysfs(struct hci_conn - dev = device_find_child(&conn->dev, NULL, __match_tty); - if (!dev) - break; -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) - device_move(dev, NULL, DPM_ORDER_DEV_LAST); -+#else -+ device_move(dev, NULL); -+#endif - put_device(dev); - } - @@ -378,7 +386,11 @@ static struct attribute_group bt_host_gr .attrs = bt_host_attrs, }; diff --git a/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_rfcomm_tty.patch b/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_rfcomm_tty.patch index 7653c0ba62a2..dac5ace50d14 100644 --- a/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_rfcomm_tty.patch +++ b/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_rfcomm_tty.patch @@ -1,30 +1,5 @@ --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c -@@ -708,8 +708,12 @@ static int rfcomm_tty_open(struct tty_st - remove_wait_queue(&dev->wait, &wait); - - if (err == 0) -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) - device_move(dev->tty_dev, rfcomm_get_device(dev), - DPM_ORDER_DEV_AFTER_PARENT); -+#else -+ device_move(dev->tty_dev, rfcomm_get_device(dev)); -+#endif - - rfcomm_tty_copy_pending(dev); - -@@ -733,7 +737,11 @@ static void rfcomm_tty_close(struct tty_ - if (!--dev->port.count) { - spin_unlock_irqrestore(&dev->port.lock, flags); - if (dev->tty_dev->parent) -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) - device_move(dev->tty_dev, NULL, DPM_ORDER_DEV_LAST); -+#else -+ device_move(dev->tty_dev, NULL); -+#endif - - /* Close DLC and dettach TTY */ - rfcomm_dlc_close(dev->dlc, 0); @@ -809,7 +817,11 @@ static int rfcomm_tty_write_room(struct return room; } -- 2.30.2