Commit 4b9d0d3b81ec0900971cbe8aba8ba0ae9c08a087
1 parent
2bdf914915
Exists in
master
and in
39 other branches
eisa: remove driver_data direct access of struct device
In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 3 changed files with 4 additions and 4 deletions Side-by-side Diff
drivers/eisa/pci_eisa.c
... | ... | @@ -31,11 +31,11 @@ |
31 | 31 | } |
32 | 32 | |
33 | 33 | pci_eisa_root.dev = &pdev->dev; |
34 | - pci_eisa_root.dev->driver_data = &pci_eisa_root; | |
35 | 34 | pci_eisa_root.res = pdev->bus->resource[0]; |
36 | 35 | pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start; |
37 | 36 | pci_eisa_root.slots = EISA_MAX_SLOTS; |
38 | 37 | pci_eisa_root.dma_mask = pdev->dma_mask; |
38 | + dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root); | |
39 | 39 | |
40 | 40 | if (eisa_root_register (&pci_eisa_root)) { |
41 | 41 | printk (KERN_ERR "pci_eisa : Could not register EISA root\n"); |
drivers/eisa/virtual_root.c
... | ... | @@ -57,7 +57,7 @@ |
57 | 57 | |
58 | 58 | eisa_bus_root.force_probe = force_probe; |
59 | 59 | |
60 | - eisa_root_dev.dev.driver_data = &eisa_bus_root; | |
60 | + dev_set_drvdata(&eisa_root_dev.dev, &eisa_bus_root); | |
61 | 61 | |
62 | 62 | if (eisa_root_register (&eisa_bus_root)) { |
63 | 63 | /* A real bridge may have been registered before |
include/linux/eisa.h
... | ... | @@ -78,12 +78,12 @@ |
78 | 78 | /* Mimics pci.h... */ |
79 | 79 | static inline void *eisa_get_drvdata (struct eisa_device *edev) |
80 | 80 | { |
81 | - return edev->dev.driver_data; | |
81 | + return dev_get_drvdata(&edev->dev); | |
82 | 82 | } |
83 | 83 | |
84 | 84 | static inline void eisa_set_drvdata (struct eisa_device *edev, void *data) |
85 | 85 | { |
86 | - edev->dev.driver_data = data; | |
86 | + dev_set_drvdata(&edev->dev, data); | |
87 | 87 | } |
88 | 88 | |
89 | 89 | /* The EISA root device. There's rumours about machines with multiple |