aboutsummaryrefslogtreecommitdiffstats
path: root/package/ep80579-drivers/patches/230-can_remove_driver_data_direct_access.patch
blob: 19dbb7e0b2282533db556658ba95aace1b84e7cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- a/Embedded/src/CAN/can_main.c
+++ b/Embedded/src/CAN/can_main.c
@@ -214,8 +214,8 @@ int can_pci_probe(struct pci_dev *dev, c
     spin_lock_init(&(g_can_os[can_num].int_spinlock));
     spin_lock_init(&(g_can_os[can_num].open_spinlock));
 
-    dev->dev.driver_data = (void *) &(g_can_os[can_num]);
-    if (!dev->dev.driver_data)
+    dev_set_drvdata(&dev->dev, (void *) &(g_can_os[can_num]));
+    if (!dev_get_drvdata(&dev->dev))
     {
         printk("Couldn't create CAN device %d. Exiting.\n",
             dev->device);
@@ -237,7 +237,7 @@ int can_pci_probe(struct pci_dev *dev, c
  *****************************************************************************/
 void can_pci_remove(struct pci_dev *dev)
 {
-    can_os_t *can_os = dev->dev.driver_data;
+    can_os_t *can_os = dev_get_drvdata(&dev->dev);
 
     iounmap(can_os->pci_remap);
     icp_can_destroy(can_os->can);
@@ -251,7 +251,7 @@ int can_pci_suspend(struct pci_dev *dev,
 {
     unsigned int i;
     unsigned int int_status;
-    can_os_t *can_os = dev->dev.driver_data;
+    can_os_t *can_os = dev_get_drvdata(&dev->dev);
     int err;
 
 	/* Indicate that we are suspending */
@@ -322,7 +322,7 @@ int can_pci_suspend(struct pci_dev *dev,
 int can_pci_resume(struct pci_dev *dev)
 {
     unsigned int i;
-    can_os_t *can_os = dev->dev.driver_data;
+    can_os_t *can_os = dev_get_drvdata(&dev->dev);
 
 	/* Restore PCI CFG space */
 	pci_restore_state(dev);