Skip to content

Commit

Permalink
direct access to hci_dev->driver_data for old kernels
Browse files Browse the repository at this point in the history
  • Loading branch information
loimu committed Nov 18, 2016
1 parent d347b05 commit 09858f0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions rtbth_core_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ static int rtbt_pci_suspend(struct pci_dev *pdev, pm_message_t state)
return -1;
}

os_ctrl = (struct rtbt_os_ctrl *)hci_get_drvdata(hci_dev);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
os_ctrl = (struct rtbt_os_ctrl *)hci_get_drvdata(hci_dev);
#else
os_ctrl = (struct rtbt_os_ctrl *)(hci_dev->driver_data);
#endif
if (os_ctrl == NULL) {
printk("%s(): hci_dev->driver_data is NULL!\n", __FUNCTION__);
return -1;
Expand All @@ -84,7 +88,11 @@ static int rtbt_pci_resume(struct pci_dev *pdev)
return -1;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
os_ctrl = (struct rtbt_os_ctrl *)hci_get_drvdata(hci_dev);
#else
os_ctrl = (struct rtbt_os_ctrl *)(hci_dev->driver_data);
#endif
if (os_ctrl == NULL) {
printk("%s(): hci_dev->driver_data is NULL!\n", __FUNCTION__);
return -1;
Expand Down Expand Up @@ -237,7 +245,11 @@ static void rtbt_pci_remove(struct pci_dev *pdev)
return;
}

os_ctrl = (struct rtbt_os_ctrl *)hci_get_drvdata(hci_dev);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
os_ctrl = (struct rtbt_os_ctrl *)hci_get_drvdata(hci_dev);
#else
os_ctrl = (struct rtbt_os_ctrl *)(hci_dev->driver_data);
#endif
if (os_ctrl == NULL) {
printk("%s(): hci_dev->driver_data is NULL!\n", __FUNCTION__);
return;
Expand Down

0 comments on commit 09858f0

Please sign in to comment.