230-can_remove_driver_data_direct_access.patch 1.4 KB

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