diff options
author | Jaroslav Kysela <perex@hera.kernel.org> | 2005-06-21 10:39:41 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@hera.kernel.org> | 2005-06-21 10:39:41 -0400 |
commit | fae6ec69c84d71b1d5bda9ede1a262c1681684aa (patch) | |
tree | eb4aff9a5c2b7d04ce09a3717bb1dd4a79fe7595 /drivers/char | |
parent | bbc0274e9bb2e3f1d724d445a2bd32566b9b66f7 (diff) | |
parent | 1d345dac1f30af1cd9f3a1faa12f9f18f17f236e (diff) |
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'drivers/char')
39 files changed, 216 insertions, 218 deletions
diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h index ad9c11391d81..c1fe013c64f3 100644 --- a/drivers/char/agp/agp.h +++ b/drivers/char/agp/agp.h | |||
@@ -278,6 +278,8 @@ void agp3_generic_cleanup(void); | |||
278 | #define AGP_GENERIC_SIZES_ENTRIES 11 | 278 | #define AGP_GENERIC_SIZES_ENTRIES 11 |
279 | extern struct aper_size_info_16 agp3_generic_sizes[]; | 279 | extern struct aper_size_info_16 agp3_generic_sizes[]; |
280 | 280 | ||
281 | #define virt_to_gart(x) (phys_to_gart(virt_to_phys(x))) | ||
282 | #define gart_to_virt(x) (phys_to_virt(gart_to_phys(x))) | ||
281 | 283 | ||
282 | extern int agp_off; | 284 | extern int agp_off; |
283 | extern int agp_try_unsupported_boot; | 285 | extern int agp_try_unsupported_boot; |
diff --git a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c index 0212febda654..9c9c9c2247ce 100644 --- a/drivers/char/agp/ali-agp.c +++ b/drivers/char/agp/ali-agp.c | |||
@@ -150,7 +150,7 @@ static void *m1541_alloc_page(struct agp_bridge_data *bridge) | |||
150 | pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); | 150 | pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); |
151 | pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, | 151 | pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, |
152 | (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | | 152 | (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | |
153 | virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN )); | 153 | virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN )); |
154 | return addr; | 154 | return addr; |
155 | } | 155 | } |
156 | 156 | ||
@@ -174,7 +174,7 @@ static void m1541_destroy_page(void * addr) | |||
174 | pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); | 174 | pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); |
175 | pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, | 175 | pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, |
176 | (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | | 176 | (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | |
177 | virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN)); | 177 | virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN)); |
178 | agp_generic_destroy_page(addr); | 178 | agp_generic_destroy_page(addr); |
179 | } | 179 | } |
180 | 180 | ||
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index e62a3c2c44a9..3a41672e4d66 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c | |||
@@ -43,7 +43,7 @@ static int amd_create_page_map(struct amd_page_map *page_map) | |||
43 | 43 | ||
44 | SetPageReserved(virt_to_page(page_map->real)); | 44 | SetPageReserved(virt_to_page(page_map->real)); |
45 | global_cache_flush(); | 45 | global_cache_flush(); |
46 | page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), | 46 | page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real), |
47 | PAGE_SIZE); | 47 | PAGE_SIZE); |
48 | if (page_map->remapped == NULL) { | 48 | if (page_map->remapped == NULL) { |
49 | ClearPageReserved(virt_to_page(page_map->real)); | 49 | ClearPageReserved(virt_to_page(page_map->real)); |
@@ -154,7 +154,7 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge) | |||
154 | 154 | ||
155 | agp_bridge->gatt_table_real = (u32 *)page_dir.real; | 155 | agp_bridge->gatt_table_real = (u32 *)page_dir.real; |
156 | agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; | 156 | agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; |
157 | agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); | 157 | agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real); |
158 | 158 | ||
159 | /* Get the address for the gart region. | 159 | /* Get the address for the gart region. |
160 | * This is a bus address even on the alpha, b/c its | 160 | * This is a bus address even on the alpha, b/c its |
@@ -167,7 +167,7 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge) | |||
167 | 167 | ||
168 | /* Calculate the agp offset */ | 168 | /* Calculate the agp offset */ |
169 | for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { | 169 | for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { |
170 | writel(virt_to_phys(amd_irongate_private.gatt_pages[i]->real) | 1, | 170 | writel(virt_to_gart(amd_irongate_private.gatt_pages[i]->real) | 1, |
171 | page_dir.remapped+GET_PAGE_DIR_OFF(addr)); | 171 | page_dir.remapped+GET_PAGE_DIR_OFF(addr)); |
172 | readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */ | 172 | readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */ |
173 | } | 173 | } |
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 399c042f68f0..1407945a5892 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
@@ -219,7 +219,7 @@ static struct aper_size_info_32 amd_8151_sizes[7] = | |||
219 | 219 | ||
220 | static int amd_8151_configure(void) | 220 | static int amd_8151_configure(void) |
221 | { | 221 | { |
222 | unsigned long gatt_bus = virt_to_phys(agp_bridge->gatt_table_real); | 222 | unsigned long gatt_bus = virt_to_gart(agp_bridge->gatt_table_real); |
223 | 223 | ||
224 | /* Configure AGP regs in each x86-64 host bridge. */ | 224 | /* Configure AGP regs in each x86-64 host bridge. */ |
225 | for_each_nb() { | 225 | for_each_nb() { |
@@ -591,7 +591,7 @@ static void __devexit agp_amd64_remove(struct pci_dev *pdev) | |||
591 | { | 591 | { |
592 | struct agp_bridge_data *bridge = pci_get_drvdata(pdev); | 592 | struct agp_bridge_data *bridge = pci_get_drvdata(pdev); |
593 | 593 | ||
594 | release_mem_region(virt_to_phys(bridge->gatt_table_real), | 594 | release_mem_region(virt_to_gart(bridge->gatt_table_real), |
595 | amd64_aperture_sizes[bridge->aperture_size_idx].size); | 595 | amd64_aperture_sizes[bridge->aperture_size_idx].size); |
596 | agp_remove_bridge(bridge); | 596 | agp_remove_bridge(bridge); |
597 | agp_put_bridge(bridge); | 597 | agp_put_bridge(bridge); |
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c index a65f8827c283..e572ced9100a 100644 --- a/drivers/char/agp/ati-agp.c +++ b/drivers/char/agp/ati-agp.c | |||
@@ -61,7 +61,7 @@ static int ati_create_page_map(ati_page_map *page_map) | |||
61 | 61 | ||
62 | SetPageReserved(virt_to_page(page_map->real)); | 62 | SetPageReserved(virt_to_page(page_map->real)); |
63 | err = map_page_into_agp(virt_to_page(page_map->real)); | 63 | err = map_page_into_agp(virt_to_page(page_map->real)); |
64 | page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), | 64 | page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real), |
65 | PAGE_SIZE); | 65 | PAGE_SIZE); |
66 | if (page_map->remapped == NULL || err) { | 66 | if (page_map->remapped == NULL || err) { |
67 | ClearPageReserved(virt_to_page(page_map->real)); | 67 | ClearPageReserved(virt_to_page(page_map->real)); |
@@ -343,7 +343,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge) | |||
343 | 343 | ||
344 | agp_bridge->gatt_table_real = (u32 *)page_dir.real; | 344 | agp_bridge->gatt_table_real = (u32 *)page_dir.real; |
345 | agp_bridge->gatt_table = (u32 __iomem *) page_dir.remapped; | 345 | agp_bridge->gatt_table = (u32 __iomem *) page_dir.remapped; |
346 | agp_bridge->gatt_bus_addr = virt_to_bus(page_dir.real); | 346 | agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real); |
347 | 347 | ||
348 | /* Write out the size register */ | 348 | /* Write out the size register */ |
349 | current_size = A_SIZE_LVL2(agp_bridge->current_size); | 349 | current_size = A_SIZE_LVL2(agp_bridge->current_size); |
@@ -373,7 +373,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge) | |||
373 | 373 | ||
374 | /* Calculate the agp offset */ | 374 | /* Calculate the agp offset */ |
375 | for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { | 375 | for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { |
376 | writel(virt_to_bus(ati_generic_private.gatt_pages[i]->real) | 1, | 376 | writel(virt_to_gart(ati_generic_private.gatt_pages[i]->real) | 1, |
377 | page_dir.remapped+GET_PAGE_DIR_OFF(addr)); | 377 | page_dir.remapped+GET_PAGE_DIR_OFF(addr)); |
378 | readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */ | 378 | readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */ |
379 | } | 379 | } |
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index 2f3dfb63bdc6..4d4e602fdc7e 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c | |||
@@ -148,7 +148,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge) | |||
148 | return -ENOMEM; | 148 | return -ENOMEM; |
149 | } | 149 | } |
150 | 150 | ||
151 | bridge->scratch_page_real = virt_to_phys(addr); | 151 | bridge->scratch_page_real = virt_to_gart(addr); |
152 | bridge->scratch_page = | 152 | bridge->scratch_page = |
153 | bridge->driver->mask_memory(bridge, bridge->scratch_page_real, 0); | 153 | bridge->driver->mask_memory(bridge, bridge->scratch_page_real, 0); |
154 | } | 154 | } |
@@ -189,7 +189,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge) | |||
189 | err_out: | 189 | err_out: |
190 | if (bridge->driver->needs_scratch_page) | 190 | if (bridge->driver->needs_scratch_page) |
191 | bridge->driver->agp_destroy_page( | 191 | bridge->driver->agp_destroy_page( |
192 | phys_to_virt(bridge->scratch_page_real)); | 192 | gart_to_virt(bridge->scratch_page_real)); |
193 | if (got_gatt) | 193 | if (got_gatt) |
194 | bridge->driver->free_gatt_table(bridge); | 194 | bridge->driver->free_gatt_table(bridge); |
195 | if (got_keylist) { | 195 | if (got_keylist) { |
@@ -214,7 +214,7 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge) | |||
214 | if (bridge->driver->agp_destroy_page && | 214 | if (bridge->driver->agp_destroy_page && |
215 | bridge->driver->needs_scratch_page) | 215 | bridge->driver->needs_scratch_page) |
216 | bridge->driver->agp_destroy_page( | 216 | bridge->driver->agp_destroy_page( |
217 | phys_to_virt(bridge->scratch_page_real)); | 217 | gart_to_virt(bridge->scratch_page_real)); |
218 | } | 218 | } |
219 | 219 | ||
220 | /* When we remove the global variable agp_bridge from all drivers | 220 | /* When we remove the global variable agp_bridge from all drivers |
diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c index 1383c3165ea1..ac19fdcd21c1 100644 --- a/drivers/char/agp/efficeon-agp.c +++ b/drivers/char/agp/efficeon-agp.c | |||
@@ -219,7 +219,7 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge) | |||
219 | 219 | ||
220 | efficeon_private.l1_table[index] = page; | 220 | efficeon_private.l1_table[index] = page; |
221 | 221 | ||
222 | value = __pa(page) | pati | present | index; | 222 | value = virt_to_gart(page) | pati | present | index; |
223 | 223 | ||
224 | pci_write_config_dword(agp_bridge->dev, | 224 | pci_write_config_dword(agp_bridge->dev, |
225 | EFFICEON_ATTPAGE, value); | 225 | EFFICEON_ATTPAGE, value); |
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index c321a924e38a..f0079e991bdc 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c | |||
@@ -153,7 +153,7 @@ void agp_free_memory(struct agp_memory *curr) | |||
153 | } | 153 | } |
154 | if (curr->page_count != 0) { | 154 | if (curr->page_count != 0) { |
155 | for (i = 0; i < curr->page_count; i++) { | 155 | for (i = 0; i < curr->page_count; i++) { |
156 | curr->bridge->driver->agp_destroy_page(phys_to_virt(curr->memory[i])); | 156 | curr->bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[i])); |
157 | } | 157 | } |
158 | } | 158 | } |
159 | agp_free_key(curr->key); | 159 | agp_free_key(curr->key); |
@@ -209,7 +209,7 @@ struct agp_memory *agp_allocate_memory(struct agp_bridge_data *bridge, | |||
209 | agp_free_memory(new); | 209 | agp_free_memory(new); |
210 | return NULL; | 210 | return NULL; |
211 | } | 211 | } |
212 | new->memory[i] = virt_to_phys(addr); | 212 | new->memory[i] = virt_to_gart(addr); |
213 | new->page_count++; | 213 | new->page_count++; |
214 | } | 214 | } |
215 | new->bridge = bridge; | 215 | new->bridge = bridge; |
@@ -295,19 +295,6 @@ int agp_num_entries(void) | |||
295 | EXPORT_SYMBOL_GPL(agp_num_entries); | 295 | EXPORT_SYMBOL_GPL(agp_num_entries); |
296 | 296 | ||
297 | 297 | ||
298 | static int check_bridge_mode(struct pci_dev *dev) | ||
299 | { | ||
300 | u32 agp3; | ||
301 | u8 cap_ptr; | ||
302 | |||
303 | cap_ptr = pci_find_capability(dev, PCI_CAP_ID_AGP); | ||
304 | pci_read_config_dword(dev, cap_ptr+AGPSTAT, &agp3); | ||
305 | if (agp3 & AGPSTAT_MODE_3_0) | ||
306 | return 1; | ||
307 | return 0; | ||
308 | } | ||
309 | |||
310 | |||
311 | /** | 298 | /** |
312 | * agp_copy_info - copy bridge state information | 299 | * agp_copy_info - copy bridge state information |
313 | * | 300 | * |
@@ -328,7 +315,7 @@ int agp_copy_info(struct agp_bridge_data *bridge, struct agp_kern_info *info) | |||
328 | info->version.minor = bridge->version->minor; | 315 | info->version.minor = bridge->version->minor; |
329 | info->chipset = SUPPORTED; | 316 | info->chipset = SUPPORTED; |
330 | info->device = bridge->dev; | 317 | info->device = bridge->dev; |
331 | if (check_bridge_mode(bridge->dev)) | 318 | if (bridge->mode & AGPSTAT_MODE_3_0) |
332 | info->mode = bridge->mode & ~AGP3_RESERVED_MASK; | 319 | info->mode = bridge->mode & ~AGP3_RESERVED_MASK; |
333 | else | 320 | else |
334 | info->mode = bridge->mode & ~AGP2_RESERVED_MASK; | 321 | info->mode = bridge->mode & ~AGP2_RESERVED_MASK; |
@@ -661,7 +648,7 @@ u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 requested_mode | |||
661 | bridge_agpstat &= ~AGPSTAT_FW; | 648 | bridge_agpstat &= ~AGPSTAT_FW; |
662 | 649 | ||
663 | /* Check to see if we are operating in 3.0 mode */ | 650 | /* Check to see if we are operating in 3.0 mode */ |
664 | if (check_bridge_mode(agp_bridge->dev)) | 651 | if (agp_bridge->mode & AGPSTAT_MODE_3_0) |
665 | agp_v3_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); | 652 | agp_v3_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); |
666 | else | 653 | else |
667 | agp_v2_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); | 654 | agp_v2_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); |
@@ -732,7 +719,7 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode) | |||
732 | 719 | ||
733 | /* Do AGP version specific frobbing. */ | 720 | /* Do AGP version specific frobbing. */ |
734 | if (bridge->major_version >= 3) { | 721 | if (bridge->major_version >= 3) { |
735 | if (check_bridge_mode(bridge->dev)) { | 722 | if (bridge->mode & AGPSTAT_MODE_3_0) { |
736 | /* If we have 3.5, we can do the isoch stuff. */ | 723 | /* If we have 3.5, we can do the isoch stuff. */ |
737 | if (bridge->minor_version >= 5) | 724 | if (bridge->minor_version >= 5) |
738 | agp_3_5_enable(bridge); | 725 | agp_3_5_enable(bridge); |
@@ -806,8 +793,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge) | |||
806 | break; | 793 | break; |
807 | } | 794 | } |
808 | 795 | ||
809 | table = (char *) __get_free_pages(GFP_KERNEL, | 796 | table = alloc_gatt_pages(page_order); |
810 | page_order); | ||
811 | 797 | ||
812 | if (table == NULL) { | 798 | if (table == NULL) { |
813 | i++; | 799 | i++; |
@@ -838,7 +824,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge) | |||
838 | size = ((struct aper_size_info_fixed *) temp)->size; | 824 | size = ((struct aper_size_info_fixed *) temp)->size; |
839 | page_order = ((struct aper_size_info_fixed *) temp)->page_order; | 825 | page_order = ((struct aper_size_info_fixed *) temp)->page_order; |
840 | num_entries = ((struct aper_size_info_fixed *) temp)->num_entries; | 826 | num_entries = ((struct aper_size_info_fixed *) temp)->num_entries; |
841 | table = (char *) __get_free_pages(GFP_KERNEL, page_order); | 827 | table = alloc_gatt_pages(page_order); |
842 | } | 828 | } |
843 | 829 | ||
844 | if (table == NULL) | 830 | if (table == NULL) |
@@ -853,7 +839,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge) | |||
853 | agp_gatt_table = (void *)table; | 839 | agp_gatt_table = (void *)table; |
854 | 840 | ||
855 | bridge->driver->cache_flush(); | 841 | bridge->driver->cache_flush(); |
856 | bridge->gatt_table = ioremap_nocache(virt_to_phys(table), | 842 | bridge->gatt_table = ioremap_nocache(virt_to_gart(table), |
857 | (PAGE_SIZE * (1 << page_order))); | 843 | (PAGE_SIZE * (1 << page_order))); |
858 | bridge->driver->cache_flush(); | 844 | bridge->driver->cache_flush(); |
859 | 845 | ||
@@ -861,11 +847,11 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge) | |||
861 | for (page = virt_to_page(table); page <= virt_to_page(table_end); page++) | 847 | for (page = virt_to_page(table); page <= virt_to_page(table_end); page++) |
862 | ClearPageReserved(page); | 848 | ClearPageReserved(page); |
863 | 849 | ||
864 | free_pages((unsigned long) table, page_order); | 850 | free_gatt_pages(table, page_order); |
865 | 851 | ||
866 | return -ENOMEM; | 852 | return -ENOMEM; |
867 | } | 853 | } |
868 | bridge->gatt_bus_addr = virt_to_phys(bridge->gatt_table_real); | 854 | bridge->gatt_bus_addr = virt_to_gart(bridge->gatt_table_real); |
869 | 855 | ||
870 | /* AK: bogus, should encode addresses > 4GB */ | 856 | /* AK: bogus, should encode addresses > 4GB */ |
871 | for (i = 0; i < num_entries; i++) { | 857 | for (i = 0; i < num_entries; i++) { |
@@ -919,7 +905,7 @@ int agp_generic_free_gatt_table(struct agp_bridge_data *bridge) | |||
919 | for (page = virt_to_page(table); page <= virt_to_page(table_end); page++) | 905 | for (page = virt_to_page(table); page <= virt_to_page(table_end); page++) |
920 | ClearPageReserved(page); | 906 | ClearPageReserved(page); |
921 | 907 | ||
922 | free_pages((unsigned long) bridge->gatt_table_real, page_order); | 908 | free_gatt_pages(bridge->gatt_table_real, page_order); |
923 | 909 | ||
924 | agp_gatt_table = NULL; | 910 | agp_gatt_table = NULL; |
925 | bridge->gatt_table = NULL; | 911 | bridge->gatt_table = NULL; |
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c index 6052bfa04c72..99762b6c19ae 100644 --- a/drivers/char/agp/hp-agp.c +++ b/drivers/char/agp/hp-agp.c | |||
@@ -110,7 +110,7 @@ static int __init hp_zx1_ioc_shared(void) | |||
110 | hp->gart_size = HP_ZX1_GART_SIZE; | 110 | hp->gart_size = HP_ZX1_GART_SIZE; |
111 | hp->gatt_entries = hp->gart_size / hp->io_page_size; | 111 | hp->gatt_entries = hp->gart_size / hp->io_page_size; |
112 | 112 | ||
113 | hp->io_pdir = phys_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE)); | 113 | hp->io_pdir = gart_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE)); |
114 | hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)]; | 114 | hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)]; |
115 | 115 | ||
116 | if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) { | 116 | if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) { |
@@ -248,7 +248,7 @@ hp_zx1_configure (void) | |||
248 | agp_bridge->mode = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS); | 248 | agp_bridge->mode = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS); |
249 | 249 | ||
250 | if (hp->io_pdir_owner) { | 250 | if (hp->io_pdir_owner) { |
251 | writel(virt_to_phys(hp->io_pdir), hp->ioc_regs+HP_ZX1_PDIR_BASE); | 251 | writel(virt_to_gart(hp->io_pdir), hp->ioc_regs+HP_ZX1_PDIR_BASE); |
252 | readl(hp->ioc_regs+HP_ZX1_PDIR_BASE); | 252 | readl(hp->ioc_regs+HP_ZX1_PDIR_BASE); |
253 | writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG); | 253 | writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG); |
254 | readl(hp->ioc_regs+HP_ZX1_TCNFG); | 254 | readl(hp->ioc_regs+HP_ZX1_TCNFG); |
diff --git a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c index adbea896c0d2..94943298c03e 100644 --- a/drivers/char/agp/i460-agp.c +++ b/drivers/char/agp/i460-agp.c | |||
@@ -372,7 +372,7 @@ static int i460_alloc_large_page (struct lp_desc *lp) | |||
372 | } | 372 | } |
373 | memset(lp->alloced_map, 0, map_size); | 373 | memset(lp->alloced_map, 0, map_size); |
374 | 374 | ||
375 | lp->paddr = virt_to_phys(lpage); | 375 | lp->paddr = virt_to_gart(lpage); |
376 | lp->refcount = 0; | 376 | lp->refcount = 0; |
377 | atomic_add(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp); | 377 | atomic_add(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp); |
378 | return 0; | 378 | return 0; |
@@ -383,7 +383,7 @@ static void i460_free_large_page (struct lp_desc *lp) | |||
383 | kfree(lp->alloced_map); | 383 | kfree(lp->alloced_map); |
384 | lp->alloced_map = NULL; | 384 | lp->alloced_map = NULL; |
385 | 385 | ||
386 | free_pages((unsigned long) phys_to_virt(lp->paddr), I460_IO_PAGE_SHIFT - PAGE_SHIFT); | 386 | free_pages((unsigned long) gart_to_virt(lp->paddr), I460_IO_PAGE_SHIFT - PAGE_SHIFT); |
387 | atomic_sub(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp); | 387 | atomic_sub(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp); |
388 | } | 388 | } |
389 | 389 | ||
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 8c7d727432bb..51266d6b4d78 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -286,7 +286,7 @@ static struct agp_memory *alloc_agpphysmem_i8xx(size_t pg_count, int type) | |||
286 | if (new == NULL) | 286 | if (new == NULL) |
287 | return NULL; | 287 | return NULL; |
288 | 288 | ||
289 | new->memory[0] = virt_to_phys(addr); | 289 | new->memory[0] = virt_to_gart(addr); |
290 | if (pg_count == 4) { | 290 | if (pg_count == 4) { |
291 | /* kludge to get 4 physical pages for ARGB cursor */ | 291 | /* kludge to get 4 physical pages for ARGB cursor */ |
292 | new->memory[1] = new->memory[0] + PAGE_SIZE; | 292 | new->memory[1] = new->memory[0] + PAGE_SIZE; |
@@ -329,10 +329,10 @@ static void intel_i810_free_by_type(struct agp_memory *curr) | |||
329 | agp_free_key(curr->key); | 329 | agp_free_key(curr->key); |
330 | if(curr->type == AGP_PHYS_MEMORY) { | 330 | if(curr->type == AGP_PHYS_MEMORY) { |
331 | if (curr->page_count == 4) | 331 | if (curr->page_count == 4) |
332 | i8xx_destroy_pages(phys_to_virt(curr->memory[0])); | 332 | i8xx_destroy_pages(gart_to_virt(curr->memory[0])); |
333 | else | 333 | else |
334 | agp_bridge->driver->agp_destroy_page( | 334 | agp_bridge->driver->agp_destroy_page( |
335 | phys_to_virt(curr->memory[0])); | 335 | gart_to_virt(curr->memory[0])); |
336 | vfree(curr->memory); | 336 | vfree(curr->memory); |
337 | } | 337 | } |
338 | kfree(curr); | 338 | kfree(curr); |
@@ -418,7 +418,8 @@ static void intel_i830_init_gtt_entries(void) | |||
418 | case I915_GMCH_GMS_STOLEN_48M: | 418 | case I915_GMCH_GMS_STOLEN_48M: |
419 | /* Check it's really I915G */ | 419 | /* Check it's really I915G */ |
420 | if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || | 420 | if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || |
421 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) | 421 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB || |
422 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB) | ||
422 | gtt_entries = MB(48) - KB(size); | 423 | gtt_entries = MB(48) - KB(size); |
423 | else | 424 | else |
424 | gtt_entries = 0; | 425 | gtt_entries = 0; |
@@ -426,7 +427,8 @@ static void intel_i830_init_gtt_entries(void) | |||
426 | case I915_GMCH_GMS_STOLEN_64M: | 427 | case I915_GMCH_GMS_STOLEN_64M: |
427 | /* Check it's really I915G */ | 428 | /* Check it's really I915G */ |
428 | if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || | 429 | if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || |
429 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) | 430 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB || |
431 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB) | ||
430 | gtt_entries = MB(64) - KB(size); | 432 | gtt_entries = MB(64) - KB(size); |
431 | else | 433 | else |
432 | gtt_entries = 0; | 434 | gtt_entries = 0; |
@@ -1662,6 +1664,14 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, | |||
1662 | } | 1664 | } |
1663 | name = "915GM"; | 1665 | name = "915GM"; |
1664 | break; | 1666 | break; |
1667 | case PCI_DEVICE_ID_INTEL_82945G_HB: | ||
1668 | if (find_i830(PCI_DEVICE_ID_INTEL_82945G_IG)) { | ||
1669 | bridge->driver = &intel_915_driver; | ||
1670 | } else { | ||
1671 | bridge->driver = &intel_845_driver; | ||
1672 | } | ||
1673 | name = "945G"; | ||
1674 | break; | ||
1665 | case PCI_DEVICE_ID_INTEL_7505_0: | 1675 | case PCI_DEVICE_ID_INTEL_7505_0: |
1666 | bridge->driver = &intel_7505_driver; | 1676 | bridge->driver = &intel_7505_driver; |
1667 | name = "E7505"; | 1677 | name = "E7505"; |
@@ -1801,6 +1811,7 @@ static struct pci_device_id agp_intel_pci_table[] = { | |||
1801 | ID(PCI_DEVICE_ID_INTEL_7205_0), | 1811 | ID(PCI_DEVICE_ID_INTEL_7205_0), |
1802 | ID(PCI_DEVICE_ID_INTEL_82915G_HB), | 1812 | ID(PCI_DEVICE_ID_INTEL_82915G_HB), |
1803 | ID(PCI_DEVICE_ID_INTEL_82915GM_HB), | 1813 | ID(PCI_DEVICE_ID_INTEL_82915GM_HB), |
1814 | ID(PCI_DEVICE_ID_INTEL_82945G_HB), | ||
1804 | { } | 1815 | { } |
1805 | }; | 1816 | }; |
1806 | 1817 | ||
diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c index 4b3eda267976..d3aa159c9dec 100644 --- a/drivers/char/agp/sgi-agp.c +++ b/drivers/char/agp/sgi-agp.c | |||
@@ -133,11 +133,14 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start, | |||
133 | off_t j; | 133 | off_t j; |
134 | void *temp; | 134 | void *temp; |
135 | struct agp_bridge_data *bridge; | 135 | struct agp_bridge_data *bridge; |
136 | u64 *table; | ||
136 | 137 | ||
137 | bridge = mem->bridge; | 138 | bridge = mem->bridge; |
138 | if (!bridge) | 139 | if (!bridge) |
139 | return -EINVAL; | 140 | return -EINVAL; |
140 | 141 | ||
142 | table = (u64 *)bridge->gatt_table; | ||
143 | |||
141 | temp = bridge->current_size; | 144 | temp = bridge->current_size; |
142 | 145 | ||
143 | switch (bridge->driver->size_type) { | 146 | switch (bridge->driver->size_type) { |
@@ -175,7 +178,7 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start, | |||
175 | j = pg_start; | 178 | j = pg_start; |
176 | 179 | ||
177 | while (j < (pg_start + mem->page_count)) { | 180 | while (j < (pg_start + mem->page_count)) { |
178 | if (*(bridge->gatt_table + j)) | 181 | if (table[j]) |
179 | return -EBUSY; | 182 | return -EBUSY; |
180 | j++; | 183 | j++; |
181 | } | 184 | } |
@@ -186,7 +189,7 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start, | |||
186 | } | 189 | } |
187 | 190 | ||
188 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { | 191 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { |
189 | *(bridge->gatt_table + j) = | 192 | table[j] = |
190 | bridge->driver->mask_memory(bridge, mem->memory[i], | 193 | bridge->driver->mask_memory(bridge, mem->memory[i], |
191 | mem->type); | 194 | mem->type); |
192 | } | 195 | } |
@@ -200,6 +203,7 @@ static int sgi_tioca_remove_memory(struct agp_memory *mem, off_t pg_start, | |||
200 | { | 203 | { |
201 | size_t i; | 204 | size_t i; |
202 | struct agp_bridge_data *bridge; | 205 | struct agp_bridge_data *bridge; |
206 | u64 *table; | ||
203 | 207 | ||
204 | bridge = mem->bridge; | 208 | bridge = mem->bridge; |
205 | if (!bridge) | 209 | if (!bridge) |
@@ -209,8 +213,10 @@ static int sgi_tioca_remove_memory(struct agp_memory *mem, off_t pg_start, | |||
209 | return -EINVAL; | 213 | return -EINVAL; |
210 | } | 214 | } |
211 | 215 | ||
216 | table = (u64 *)bridge->gatt_table; | ||
217 | |||
212 | for (i = pg_start; i < (mem->page_count + pg_start); i++) { | 218 | for (i = pg_start; i < (mem->page_count + pg_start); i++) { |
213 | *(bridge->gatt_table + i) = 0; | 219 | table[i] = 0; |
214 | } | 220 | } |
215 | 221 | ||
216 | bridge->driver->tlb_flush(mem); | 222 | bridge->driver->tlb_flush(mem); |
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c index 10c23302dd84..a9fb12c20eb7 100644 --- a/drivers/char/agp/sworks-agp.c +++ b/drivers/char/agp/sworks-agp.c | |||
@@ -51,7 +51,7 @@ static int serverworks_create_page_map(struct serverworks_page_map *page_map) | |||
51 | } | 51 | } |
52 | SetPageReserved(virt_to_page(page_map->real)); | 52 | SetPageReserved(virt_to_page(page_map->real)); |
53 | global_cache_flush(); | 53 | global_cache_flush(); |
54 | page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), | 54 | page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real), |
55 | PAGE_SIZE); | 55 | PAGE_SIZE); |
56 | if (page_map->remapped == NULL) { | 56 | if (page_map->remapped == NULL) { |
57 | ClearPageReserved(virt_to_page(page_map->real)); | 57 | ClearPageReserved(virt_to_page(page_map->real)); |
@@ -162,7 +162,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge) | |||
162 | /* Create a fake scratch directory */ | 162 | /* Create a fake scratch directory */ |
163 | for(i = 0; i < 1024; i++) { | 163 | for(i = 0; i < 1024; i++) { |
164 | writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i); | 164 | writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i); |
165 | writel(virt_to_phys(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i); | 165 | writel(virt_to_gart(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i); |
166 | } | 166 | } |
167 | 167 | ||
168 | retval = serverworks_create_gatt_pages(value->num_entries / 1024); | 168 | retval = serverworks_create_gatt_pages(value->num_entries / 1024); |
@@ -174,7 +174,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge) | |||
174 | 174 | ||
175 | agp_bridge->gatt_table_real = (u32 *)page_dir.real; | 175 | agp_bridge->gatt_table_real = (u32 *)page_dir.real; |
176 | agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; | 176 | agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; |
177 | agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); | 177 | agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real); |
178 | 178 | ||
179 | /* Get the address for the gart region. | 179 | /* Get the address for the gart region. |
180 | * This is a bus address even on the alpha, b/c its | 180 | * This is a bus address even on the alpha, b/c its |
@@ -187,7 +187,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge) | |||
187 | /* Calculate the agp offset */ | 187 | /* Calculate the agp offset */ |
188 | 188 | ||
189 | for(i = 0; i < value->num_entries / 1024; i++) | 189 | for(i = 0; i < value->num_entries / 1024; i++) |
190 | writel(virt_to_phys(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i); | 190 | writel(virt_to_gart(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i); |
191 | 191 | ||
192 | return 0; | 192 | return 0; |
193 | } | 193 | } |
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index a673971f2a90..c8255312b8c1 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c | |||
@@ -407,7 +407,7 @@ static int uninorth_create_gatt_table(struct agp_bridge_data *bridge) | |||
407 | 407 | ||
408 | bridge->gatt_table_real = (u32 *) table; | 408 | bridge->gatt_table_real = (u32 *) table; |
409 | bridge->gatt_table = (u32 *)table; | 409 | bridge->gatt_table = (u32 *)table; |
410 | bridge->gatt_bus_addr = virt_to_phys(table); | 410 | bridge->gatt_bus_addr = virt_to_gart(table); |
411 | 411 | ||
412 | for (i = 0; i < num_entries; i++) | 412 | for (i = 0; i < num_entries; i++) |
413 | bridge->gatt_table[i] = 0; | 413 | bridge->gatt_table[i] = 0; |
diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h index 54a2914e3a32..11c6950158b3 100644 --- a/drivers/char/drm/drm_pciids.h +++ b/drivers/char/drm/drm_pciids.h | |||
@@ -220,5 +220,6 @@ | |||
220 | {0x8086, 0x2572, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ | 220 | {0x8086, 0x2572, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ |
221 | {0x8086, 0x2582, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ | 221 | {0x8086, 0x2582, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ |
222 | {0x8086, 0x2592, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ | 222 | {0x8086, 0x2592, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ |
223 | {0x8086, 0x2772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ | ||
223 | {0, 0, 0} | 224 | {0, 0, 0} |
224 | 225 | ||
diff --git a/drivers/char/drm/radeon_irq.c b/drivers/char/drm/radeon_irq.c index 5b18bee6492e..cd25f28e26a3 100644 --- a/drivers/char/drm/radeon_irq.c +++ b/drivers/char/drm/radeon_irq.c | |||
@@ -123,11 +123,6 @@ static int radeon_wait_irq(drm_device_t *dev, int swi_nr) | |||
123 | 123 | ||
124 | dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; | 124 | dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; |
125 | 125 | ||
126 | /* This is a hack to work around mysterious freezes on certain | ||
127 | * systems: | ||
128 | */ | ||
129 | radeon_acknowledge_irqs( dev_priv ); | ||
130 | |||
131 | DRM_WAIT_ON( ret, dev_priv->swi_queue, 3 * DRM_HZ, | 126 | DRM_WAIT_ON( ret, dev_priv->swi_queue, 3 * DRM_HZ, |
132 | RADEON_READ( RADEON_LAST_SWI_REG ) >= swi_nr ); | 127 | RADEON_READ( RADEON_LAST_SWI_REG ) >= swi_nr ); |
133 | 128 | ||
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c index 37d6649011ad..26271e3ca823 100644 --- a/drivers/char/dsp56k.c +++ b/drivers/char/dsp56k.c | |||
@@ -144,7 +144,7 @@ static struct dsp56k_device { | |||
144 | int tx_wsize, rx_wsize; | 144 | int tx_wsize, rx_wsize; |
145 | } dsp56k; | 145 | } dsp56k; |
146 | 146 | ||
147 | static struct class_simple *dsp56k_class; | 147 | static struct class *dsp56k_class; |
148 | 148 | ||
149 | static int dsp56k_reset(void) | 149 | static int dsp56k_reset(void) |
150 | { | 150 | { |
@@ -510,12 +510,12 @@ static int __init dsp56k_init_driver(void) | |||
510 | printk("DSP56k driver: Unable to register driver\n"); | 510 | printk("DSP56k driver: Unable to register driver\n"); |
511 | return -ENODEV; | 511 | return -ENODEV; |
512 | } | 512 | } |
513 | dsp56k_class = class_simple_create(THIS_MODULE, "dsp56k"); | 513 | dsp56k_class = class_create(THIS_MODULE, "dsp56k"); |
514 | if (IS_ERR(dsp56k_class)) { | 514 | if (IS_ERR(dsp56k_class)) { |
515 | err = PTR_ERR(dsp56k_class); | 515 | err = PTR_ERR(dsp56k_class); |
516 | goto out_chrdev; | 516 | goto out_chrdev; |
517 | } | 517 | } |
518 | class_simple_device_add(dsp56k_class, MKDEV(DSP56K_MAJOR, 0), NULL, "dsp56k"); | 518 | class_device_create(dsp56k_class, MKDEV(DSP56K_MAJOR, 0), NULL, "dsp56k"); |
519 | 519 | ||
520 | err = devfs_mk_cdev(MKDEV(DSP56K_MAJOR, 0), | 520 | err = devfs_mk_cdev(MKDEV(DSP56K_MAJOR, 0), |
521 | S_IFCHR | S_IRUSR | S_IWUSR, "dsp56k"); | 521 | S_IFCHR | S_IRUSR | S_IWUSR, "dsp56k"); |
@@ -526,8 +526,8 @@ static int __init dsp56k_init_driver(void) | |||
526 | goto out; | 526 | goto out; |
527 | 527 | ||
528 | out_class: | 528 | out_class: |
529 | class_simple_device_remove(MKDEV(DSP56K_MAJOR, 0)); | 529 | class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0)); |
530 | class_simple_destroy(dsp56k_class); | 530 | class_destroy(dsp56k_class); |
531 | out_chrdev: | 531 | out_chrdev: |
532 | unregister_chrdev(DSP56K_MAJOR, "dsp56k"); | 532 | unregister_chrdev(DSP56K_MAJOR, "dsp56k"); |
533 | out: | 533 | out: |
@@ -537,8 +537,8 @@ module_init(dsp56k_init_driver); | |||
537 | 537 | ||
538 | static void __exit dsp56k_cleanup_driver(void) | 538 | static void __exit dsp56k_cleanup_driver(void) |
539 | { | 539 | { |
540 | class_simple_device_remove(MKDEV(DSP56K_MAJOR, 0)); | 540 | class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0)); |
541 | class_simple_destroy(dsp56k_class); | 541 | class_destroy(dsp56k_class); |
542 | unregister_chrdev(DSP56K_MAJOR, "dsp56k"); | 542 | unregister_chrdev(DSP56K_MAJOR, "dsp56k"); |
543 | devfs_remove("dsp56k"); | 543 | devfs_remove("dsp56k"); |
544 | } | 544 | } |
diff --git a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c index dbac7e54e8e0..5745b74044ec 100644 --- a/drivers/char/ftape/zftape/zftape-init.c +++ b/drivers/char/ftape/zftape/zftape-init.c | |||
@@ -99,7 +99,7 @@ static struct file_operations zft_cdev = | |||
99 | .release = zft_close, | 99 | .release = zft_close, |
100 | }; | 100 | }; |
101 | 101 | ||
102 | static struct class_simple *zft_class; | 102 | static struct class *zft_class; |
103 | 103 | ||
104 | /* Open floppy tape device | 104 | /* Open floppy tape device |
105 | */ | 105 | */ |
@@ -329,29 +329,29 @@ KERN_INFO | |||
329 | "installing zftape VFS interface for ftape driver ..."); | 329 | "installing zftape VFS interface for ftape driver ..."); |
330 | TRACE_CATCH(register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),); | 330 | TRACE_CATCH(register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),); |
331 | 331 | ||
332 | zft_class = class_simple_create(THIS_MODULE, "zft"); | 332 | zft_class = class_create(THIS_MODULE, "zft"); |
333 | for (i = 0; i < 4; i++) { | 333 | for (i = 0; i < 4; i++) { |
334 | class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i), NULL, "qft%i", i); | 334 | class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i), NULL, "qft%i", i); |
335 | devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i), | 335 | devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i), |
336 | S_IFCHR | S_IRUSR | S_IWUSR, | 336 | S_IFCHR | S_IRUSR | S_IWUSR, |
337 | "qft%i", i); | 337 | "qft%i", i); |
338 | class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 4), NULL, "nqft%i", i); | 338 | class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 4), NULL, "nqft%i", i); |
339 | devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 4), | 339 | devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 4), |
340 | S_IFCHR | S_IRUSR | S_IWUSR, | 340 | S_IFCHR | S_IRUSR | S_IWUSR, |
341 | "nqft%i", i); | 341 | "nqft%i", i); |
342 | class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 16), NULL, "zqft%i", i); | 342 | class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 16), NULL, "zqft%i", i); |
343 | devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 16), | 343 | devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 16), |
344 | S_IFCHR | S_IRUSR | S_IWUSR, | 344 | S_IFCHR | S_IRUSR | S_IWUSR, |
345 | "zqft%i", i); | 345 | "zqft%i", i); |
346 | class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 20), NULL, "nzqft%i", i); | 346 | class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 20), NULL, "nzqft%i", i); |
347 | devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 20), | 347 | devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 20), |
348 | S_IFCHR | S_IRUSR | S_IWUSR, | 348 | S_IFCHR | S_IRUSR | S_IWUSR, |
349 | "nzqft%i", i); | 349 | "nzqft%i", i); |
350 | class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 32), NULL, "rawqft%i", i); | 350 | class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 32), NULL, "rawqft%i", i); |
351 | devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 32), | 351 | devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 32), |
352 | S_IFCHR | S_IRUSR | S_IWUSR, | 352 | S_IFCHR | S_IRUSR | S_IWUSR, |
353 | "rawqft%i", i); | 353 | "rawqft%i", i); |
354 | class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 36), NULL, "nrawrawqft%i", i); | 354 | class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 36), NULL, "nrawrawqft%i", i); |
355 | devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 36), | 355 | devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 36), |
356 | S_IFCHR | S_IRUSR | S_IWUSR, | 356 | S_IFCHR | S_IRUSR | S_IWUSR, |
357 | "nrawqft%i", i); | 357 | "nrawqft%i", i); |
@@ -381,19 +381,19 @@ static void zft_exit(void) | |||
381 | } | 381 | } |
382 | for (i = 0; i < 4; i++) { | 382 | for (i = 0; i < 4; i++) { |
383 | devfs_remove("qft%i", i); | 383 | devfs_remove("qft%i", i); |
384 | class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i)); | 384 | class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i)); |
385 | devfs_remove("nqft%i", i); | 385 | devfs_remove("nqft%i", i); |
386 | class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 4)); | 386 | class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 4)); |
387 | devfs_remove("zqft%i", i); | 387 | devfs_remove("zqft%i", i); |
388 | class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 16)); | 388 | class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 16)); |
389 | devfs_remove("nzqft%i", i); | 389 | devfs_remove("nzqft%i", i); |
390 | class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 20)); | 390 | class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 20)); |
391 | devfs_remove("rawqft%i", i); | 391 | devfs_remove("rawqft%i", i); |
392 | class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 32)); | 392 | class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 32)); |
393 | devfs_remove("nrawqft%i", i); | 393 | devfs_remove("nrawqft%i", i); |
394 | class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 36)); | 394 | class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 36)); |
395 | } | 395 | } |
396 | class_simple_destroy(zft_class); | 396 | class_destroy(zft_class); |
397 | zft_uninit_mem(); /* release remaining memory, if any */ | 397 | zft_uninit_mem(); /* release remaining memory, if any */ |
398 | printk(KERN_INFO "zftape successfully unloaded.\n"); | 398 | printk(KERN_INFO "zftape successfully unloaded.\n"); |
399 | TRACE_EXIT; | 399 | TRACE_EXIT; |
diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c index abfbdcfd4e72..3236d2404905 100644 --- a/drivers/char/hvcs.c +++ b/drivers/char/hvcs.c | |||
@@ -1466,7 +1466,7 @@ static inline struct hvcs_struct *from_vio_dev(struct vio_dev *viod) | |||
1466 | } | 1466 | } |
1467 | /* The sysfs interface for the driver and devices */ | 1467 | /* The sysfs interface for the driver and devices */ |
1468 | 1468 | ||
1469 | static ssize_t hvcs_partner_vtys_show(struct device *dev, char *buf) | 1469 | static ssize_t hvcs_partner_vtys_show(struct device *dev, struct device_attribute *attr, char *buf) |
1470 | { | 1470 | { |
1471 | struct vio_dev *viod = to_vio_dev(dev); | 1471 | struct vio_dev *viod = to_vio_dev(dev); |
1472 | struct hvcs_struct *hvcsd = from_vio_dev(viod); | 1472 | struct hvcs_struct *hvcsd = from_vio_dev(viod); |
@@ -1480,7 +1480,7 @@ static ssize_t hvcs_partner_vtys_show(struct device *dev, char *buf) | |||
1480 | } | 1480 | } |
1481 | static DEVICE_ATTR(partner_vtys, S_IRUGO, hvcs_partner_vtys_show, NULL); | 1481 | static DEVICE_ATTR(partner_vtys, S_IRUGO, hvcs_partner_vtys_show, NULL); |
1482 | 1482 | ||
1483 | static ssize_t hvcs_partner_clcs_show(struct device *dev, char *buf) | 1483 | static ssize_t hvcs_partner_clcs_show(struct device *dev, struct device_attribute *attr, char *buf) |
1484 | { | 1484 | { |
1485 | struct vio_dev *viod = to_vio_dev(dev); | 1485 | struct vio_dev *viod = to_vio_dev(dev); |
1486 | struct hvcs_struct *hvcsd = from_vio_dev(viod); | 1486 | struct hvcs_struct *hvcsd = from_vio_dev(viod); |
@@ -1494,7 +1494,7 @@ static ssize_t hvcs_partner_clcs_show(struct device *dev, char *buf) | |||
1494 | } | 1494 | } |
1495 | static DEVICE_ATTR(partner_clcs, S_IRUGO, hvcs_partner_clcs_show, NULL); | 1495 | static DEVICE_ATTR(partner_clcs, S_IRUGO, hvcs_partner_clcs_show, NULL); |
1496 | 1496 | ||
1497 | static ssize_t hvcs_current_vty_store(struct device *dev, const char * buf, | 1497 | static ssize_t hvcs_current_vty_store(struct device *dev, struct device_attribute *attr, const char * buf, |
1498 | size_t count) | 1498 | size_t count) |
1499 | { | 1499 | { |
1500 | /* | 1500 | /* |
@@ -1505,7 +1505,7 @@ static ssize_t hvcs_current_vty_store(struct device *dev, const char * buf, | |||
1505 | return -EPERM; | 1505 | return -EPERM; |
1506 | } | 1506 | } |
1507 | 1507 | ||
1508 | static ssize_t hvcs_current_vty_show(struct device *dev, char *buf) | 1508 | static ssize_t hvcs_current_vty_show(struct device *dev, struct device_attribute *attr, char *buf) |
1509 | { | 1509 | { |
1510 | struct vio_dev *viod = to_vio_dev(dev); | 1510 | struct vio_dev *viod = to_vio_dev(dev); |
1511 | struct hvcs_struct *hvcsd = from_vio_dev(viod); | 1511 | struct hvcs_struct *hvcsd = from_vio_dev(viod); |
@@ -1521,7 +1521,7 @@ static ssize_t hvcs_current_vty_show(struct device *dev, char *buf) | |||
1521 | static DEVICE_ATTR(current_vty, | 1521 | static DEVICE_ATTR(current_vty, |
1522 | S_IRUGO | S_IWUSR, hvcs_current_vty_show, hvcs_current_vty_store); | 1522 | S_IRUGO | S_IWUSR, hvcs_current_vty_show, hvcs_current_vty_store); |
1523 | 1523 | ||
1524 | static ssize_t hvcs_vterm_state_store(struct device *dev, const char *buf, | 1524 | static ssize_t hvcs_vterm_state_store(struct device *dev, struct device_attribute *attr, const char *buf, |
1525 | size_t count) | 1525 | size_t count) |
1526 | { | 1526 | { |
1527 | struct vio_dev *viod = to_vio_dev(dev); | 1527 | struct vio_dev *viod = to_vio_dev(dev); |
@@ -1559,7 +1559,7 @@ static ssize_t hvcs_vterm_state_store(struct device *dev, const char *buf, | |||
1559 | return count; | 1559 | return count; |
1560 | } | 1560 | } |
1561 | 1561 | ||
1562 | static ssize_t hvcs_vterm_state_show(struct device *dev, char *buf) | 1562 | static ssize_t hvcs_vterm_state_show(struct device *dev, struct device_attribute *attr, char *buf) |
1563 | { | 1563 | { |
1564 | struct vio_dev *viod = to_vio_dev(dev); | 1564 | struct vio_dev *viod = to_vio_dev(dev); |
1565 | struct hvcs_struct *hvcsd = from_vio_dev(viod); | 1565 | struct hvcs_struct *hvcsd = from_vio_dev(viod); |
@@ -1574,7 +1574,7 @@ static ssize_t hvcs_vterm_state_show(struct device *dev, char *buf) | |||
1574 | static DEVICE_ATTR(vterm_state, S_IRUGO | S_IWUSR, | 1574 | static DEVICE_ATTR(vterm_state, S_IRUGO | S_IWUSR, |
1575 | hvcs_vterm_state_show, hvcs_vterm_state_store); | 1575 | hvcs_vterm_state_show, hvcs_vterm_state_store); |
1576 | 1576 | ||
1577 | static ssize_t hvcs_index_show(struct device *dev, char *buf) | 1577 | static ssize_t hvcs_index_show(struct device *dev, struct device_attribute *attr, char *buf) |
1578 | { | 1578 | { |
1579 | struct vio_dev *viod = to_vio_dev(dev); | 1579 | struct vio_dev *viod = to_vio_dev(dev); |
1580 | struct hvcs_struct *hvcsd = from_vio_dev(viod); | 1580 | struct hvcs_struct *hvcsd = from_vio_dev(viod); |
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c index fca9a978fb73..3b8314b4249a 100644 --- a/drivers/char/ip2main.c +++ b/drivers/char/ip2main.c | |||
@@ -302,7 +302,7 @@ static char rirqs[IP2_MAX_BOARDS]; | |||
302 | static int Valid_Irqs[] = { 3, 4, 5, 7, 10, 11, 12, 15, 0}; | 302 | static int Valid_Irqs[] = { 3, 4, 5, 7, 10, 11, 12, 15, 0}; |
303 | 303 | ||
304 | /* for sysfs class support */ | 304 | /* for sysfs class support */ |
305 | static struct class_simple *ip2_class; | 305 | static struct class *ip2_class; |
306 | 306 | ||
307 | // Some functions to keep track of what irq's we have | 307 | // Some functions to keep track of what irq's we have |
308 | 308 | ||
@@ -414,9 +414,9 @@ cleanup_module(void) | |||
414 | iiResetDelay( i2BoardPtrTable[i] ); | 414 | iiResetDelay( i2BoardPtrTable[i] ); |
415 | /* free io addresses and Tibet */ | 415 | /* free io addresses and Tibet */ |
416 | release_region( ip2config.addr[i], 8 ); | 416 | release_region( ip2config.addr[i], 8 ); |
417 | class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 4 * i)); | 417 | class_device_destroy(ip2_class, MKDEV(IP2_IPL_MAJOR, 4 * i)); |
418 | devfs_remove("ip2/ipl%d", i); | 418 | devfs_remove("ip2/ipl%d", i); |
419 | class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 4 * i + 1)); | 419 | class_device_destroy(ip2_class, MKDEV(IP2_IPL_MAJOR, 4 * i + 1)); |
420 | devfs_remove("ip2/stat%d", i); | 420 | devfs_remove("ip2/stat%d", i); |
421 | } | 421 | } |
422 | /* Disable and remove interrupt handler. */ | 422 | /* Disable and remove interrupt handler. */ |
@@ -425,7 +425,7 @@ cleanup_module(void) | |||
425 | clear_requested_irq( ip2config.irq[i]); | 425 | clear_requested_irq( ip2config.irq[i]); |
426 | } | 426 | } |
427 | } | 427 | } |
428 | class_simple_destroy(ip2_class); | 428 | class_destroy(ip2_class); |
429 | devfs_remove("ip2"); | 429 | devfs_remove("ip2"); |
430 | if ( ( err = tty_unregister_driver ( ip2_tty_driver ) ) ) { | 430 | if ( ( err = tty_unregister_driver ( ip2_tty_driver ) ) ) { |
431 | printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err); | 431 | printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err); |
@@ -700,7 +700,7 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) | |||
700 | printk(KERN_ERR "IP2: failed to register IPL device (%d)\n", err ); | 700 | printk(KERN_ERR "IP2: failed to register IPL device (%d)\n", err ); |
701 | } else { | 701 | } else { |
702 | /* create the sysfs class */ | 702 | /* create the sysfs class */ |
703 | ip2_class = class_simple_create(THIS_MODULE, "ip2"); | 703 | ip2_class = class_create(THIS_MODULE, "ip2"); |
704 | if (IS_ERR(ip2_class)) { | 704 | if (IS_ERR(ip2_class)) { |
705 | err = PTR_ERR(ip2_class); | 705 | err = PTR_ERR(ip2_class); |
706 | goto out_chrdev; | 706 | goto out_chrdev; |
@@ -722,25 +722,25 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) | |||
722 | } | 722 | } |
723 | 723 | ||
724 | if ( NULL != ( pB = i2BoardPtrTable[i] ) ) { | 724 | if ( NULL != ( pB = i2BoardPtrTable[i] ) ) { |
725 | class_simple_device_add(ip2_class, MKDEV(IP2_IPL_MAJOR, | 725 | class_device_create(ip2_class, MKDEV(IP2_IPL_MAJOR, |
726 | 4 * i), NULL, "ipl%d", i); | 726 | 4 * i), NULL, "ipl%d", i); |
727 | err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i), | 727 | err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i), |
728 | S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, | 728 | S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, |
729 | "ip2/ipl%d", i); | 729 | "ip2/ipl%d", i); |
730 | if (err) { | 730 | if (err) { |
731 | class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, | 731 | class_device_destroy(ip2_class, |
732 | 4 * i)); | 732 | MKDEV(IP2_IPL_MAJOR, 4 * i)); |
733 | goto out_class; | 733 | goto out_class; |
734 | } | 734 | } |
735 | 735 | ||
736 | class_simple_device_add(ip2_class, MKDEV(IP2_IPL_MAJOR, | 736 | class_device_create(ip2_class, MKDEV(IP2_IPL_MAJOR, |
737 | 4 * i + 1), NULL, "stat%d", i); | 737 | 4 * i + 1), NULL, "stat%d", i); |
738 | err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i + 1), | 738 | err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i + 1), |
739 | S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, | 739 | S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, |
740 | "ip2/stat%d", i); | 740 | "ip2/stat%d", i); |
741 | if (err) { | 741 | if (err) { |
742 | class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, | 742 | class_device_destroy(ip2_class, |
743 | 4 * i + 1)); | 743 | MKDEV(IP2_IPL_MAJOR, 4 * i + 1)); |
744 | goto out_class; | 744 | goto out_class; |
745 | } | 745 | } |
746 | 746 | ||
@@ -798,7 +798,7 @@ retry: | |||
798 | goto out; | 798 | goto out; |
799 | 799 | ||
800 | out_class: | 800 | out_class: |
801 | class_simple_destroy(ip2_class); | 801 | class_destroy(ip2_class); |
802 | out_chrdev: | 802 | out_chrdev: |
803 | unregister_chrdev(IP2_IPL_MAJOR, "ip2"); | 803 | unregister_chrdev(IP2_IPL_MAJOR, "ip2"); |
804 | out: | 804 | out: |
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c index 6dc765dc5413..88d1ad656e99 100644 --- a/drivers/char/ipmi/ipmi_devintf.c +++ b/drivers/char/ipmi/ipmi_devintf.c | |||
@@ -520,7 +520,7 @@ MODULE_PARM_DESC(ipmi_major, "Sets the major number of the IPMI device. By" | |||
520 | " interface. Other values will set the major device number" | 520 | " interface. Other values will set the major device number" |
521 | " to that value."); | 521 | " to that value."); |
522 | 522 | ||
523 | static struct class_simple *ipmi_class; | 523 | static struct class *ipmi_class; |
524 | 524 | ||
525 | static void ipmi_new_smi(int if_num) | 525 | static void ipmi_new_smi(int if_num) |
526 | { | 526 | { |
@@ -529,12 +529,12 @@ static void ipmi_new_smi(int if_num) | |||
529 | devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR, | 529 | devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR, |
530 | "ipmidev/%d", if_num); | 530 | "ipmidev/%d", if_num); |
531 | 531 | ||
532 | class_simple_device_add(ipmi_class, dev, NULL, "ipmi%d", if_num); | 532 | class_device_create(ipmi_class, dev, NULL, "ipmi%d", if_num); |
533 | } | 533 | } |
534 | 534 | ||
535 | static void ipmi_smi_gone(int if_num) | 535 | static void ipmi_smi_gone(int if_num) |
536 | { | 536 | { |
537 | class_simple_device_remove(MKDEV(ipmi_major, if_num)); | 537 | class_device_destroy(ipmi_class, MKDEV(ipmi_major, if_num)); |
538 | devfs_remove("ipmidev/%d", if_num); | 538 | devfs_remove("ipmidev/%d", if_num); |
539 | } | 539 | } |
540 | 540 | ||
@@ -555,7 +555,7 @@ static __init int init_ipmi_devintf(void) | |||
555 | printk(KERN_INFO "ipmi device interface version " | 555 | printk(KERN_INFO "ipmi device interface version " |
556 | IPMI_DEVINTF_VERSION "\n"); | 556 | IPMI_DEVINTF_VERSION "\n"); |
557 | 557 | ||
558 | ipmi_class = class_simple_create(THIS_MODULE, "ipmi"); | 558 | ipmi_class = class_create(THIS_MODULE, "ipmi"); |
559 | if (IS_ERR(ipmi_class)) { | 559 | if (IS_ERR(ipmi_class)) { |
560 | printk(KERN_ERR "ipmi: can't register device class\n"); | 560 | printk(KERN_ERR "ipmi: can't register device class\n"); |
561 | return PTR_ERR(ipmi_class); | 561 | return PTR_ERR(ipmi_class); |
@@ -563,7 +563,7 @@ static __init int init_ipmi_devintf(void) | |||
563 | 563 | ||
564 | rv = register_chrdev(ipmi_major, DEVICE_NAME, &ipmi_fops); | 564 | rv = register_chrdev(ipmi_major, DEVICE_NAME, &ipmi_fops); |
565 | if (rv < 0) { | 565 | if (rv < 0) { |
566 | class_simple_destroy(ipmi_class); | 566 | class_destroy(ipmi_class); |
567 | printk(KERN_ERR "ipmi: can't get major %d\n", ipmi_major); | 567 | printk(KERN_ERR "ipmi: can't get major %d\n", ipmi_major); |
568 | return rv; | 568 | return rv; |
569 | } | 569 | } |
@@ -577,7 +577,7 @@ static __init int init_ipmi_devintf(void) | |||
577 | rv = ipmi_smi_watcher_register(&smi_watcher); | 577 | rv = ipmi_smi_watcher_register(&smi_watcher); |
578 | if (rv) { | 578 | if (rv) { |
579 | unregister_chrdev(ipmi_major, DEVICE_NAME); | 579 | unregister_chrdev(ipmi_major, DEVICE_NAME); |
580 | class_simple_destroy(ipmi_class); | 580 | class_destroy(ipmi_class); |
581 | printk(KERN_WARNING "ipmi: can't register smi watcher\n"); | 581 | printk(KERN_WARNING "ipmi: can't register smi watcher\n"); |
582 | return rv; | 582 | return rv; |
583 | } | 583 | } |
@@ -588,7 +588,7 @@ module_init(init_ipmi_devintf); | |||
588 | 588 | ||
589 | static __exit void cleanup_ipmi(void) | 589 | static __exit void cleanup_ipmi(void) |
590 | { | 590 | { |
591 | class_simple_destroy(ipmi_class); | 591 | class_destroy(ipmi_class); |
592 | ipmi_smi_watcher_unregister(&smi_watcher); | 592 | ipmi_smi_watcher_unregister(&smi_watcher); |
593 | devfs_remove(DEVICE_NAME); | 593 | devfs_remove(DEVICE_NAME); |
594 | unregister_chrdev(ipmi_major, DEVICE_NAME); | 594 | unregister_chrdev(ipmi_major, DEVICE_NAME); |
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index 21aed0e8779d..c02a21dbad5d 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c | |||
@@ -792,7 +792,7 @@ static int stli_timeron; | |||
792 | 792 | ||
793 | /*****************************************************************************/ | 793 | /*****************************************************************************/ |
794 | 794 | ||
795 | static struct class_simple *istallion_class; | 795 | static struct class *istallion_class; |
796 | 796 | ||
797 | #ifdef MODULE | 797 | #ifdef MODULE |
798 | 798 | ||
@@ -854,10 +854,10 @@ static void __exit istallion_module_exit(void) | |||
854 | put_tty_driver(stli_serial); | 854 | put_tty_driver(stli_serial); |
855 | for (i = 0; i < 4; i++) { | 855 | for (i = 0; i < 4; i++) { |
856 | devfs_remove("staliomem/%d", i); | 856 | devfs_remove("staliomem/%d", i); |
857 | class_simple_device_remove(MKDEV(STL_SIOMEMMAJOR, i)); | 857 | class_device_destroy(istallion_class, MKDEV(STL_SIOMEMMAJOR, i)); |
858 | } | 858 | } |
859 | devfs_remove("staliomem"); | 859 | devfs_remove("staliomem"); |
860 | class_simple_destroy(istallion_class); | 860 | class_destroy(istallion_class); |
861 | if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem"))) | 861 | if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem"))) |
862 | printk("STALLION: failed to un-register serial memory device, " | 862 | printk("STALLION: failed to un-register serial memory device, " |
863 | "errno=%d\n", -i); | 863 | "errno=%d\n", -i); |
@@ -5242,12 +5242,12 @@ int __init stli_init(void) | |||
5242 | "device\n"); | 5242 | "device\n"); |
5243 | 5243 | ||
5244 | devfs_mk_dir("staliomem"); | 5244 | devfs_mk_dir("staliomem"); |
5245 | istallion_class = class_simple_create(THIS_MODULE, "staliomem"); | 5245 | istallion_class = class_create(THIS_MODULE, "staliomem"); |
5246 | for (i = 0; i < 4; i++) { | 5246 | for (i = 0; i < 4; i++) { |
5247 | devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i), | 5247 | devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i), |
5248 | S_IFCHR | S_IRUSR | S_IWUSR, | 5248 | S_IFCHR | S_IRUSR | S_IWUSR, |
5249 | "staliomem/%d", i); | 5249 | "staliomem/%d", i); |
5250 | class_simple_device_add(istallion_class, MKDEV(STL_SIOMEMMAJOR, i), | 5250 | class_device_create(istallion_class, MKDEV(STL_SIOMEMMAJOR, i), |
5251 | NULL, "staliomem%d", i); | 5251 | NULL, "staliomem%d", i); |
5252 | } | 5252 | } |
5253 | 5253 | ||
diff --git a/drivers/char/lp.c b/drivers/char/lp.c index 4dee945031d4..59eebe5a035f 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c | |||
@@ -146,7 +146,7 @@ | |||
146 | static struct lp_struct lp_table[LP_NO]; | 146 | static struct lp_struct lp_table[LP_NO]; |
147 | 147 | ||
148 | static unsigned int lp_count = 0; | 148 | static unsigned int lp_count = 0; |
149 | static struct class_simple *lp_class; | 149 | static struct class *lp_class; |
150 | 150 | ||
151 | #ifdef CONFIG_LP_CONSOLE | 151 | #ifdef CONFIG_LP_CONSOLE |
152 | static struct parport *console_registered; // initially NULL | 152 | static struct parport *console_registered; // initially NULL |
@@ -804,7 +804,7 @@ static int lp_register(int nr, struct parport *port) | |||
804 | if (reset) | 804 | if (reset) |
805 | lp_reset(nr); | 805 | lp_reset(nr); |
806 | 806 | ||
807 | class_simple_device_add(lp_class, MKDEV(LP_MAJOR, nr), NULL, | 807 | class_device_create(lp_class, MKDEV(LP_MAJOR, nr), NULL, |
808 | "lp%d", nr); | 808 | "lp%d", nr); |
809 | devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO, | 809 | devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO, |
810 | "printers/%d", nr); | 810 | "printers/%d", nr); |
@@ -907,7 +907,7 @@ static int __init lp_init (void) | |||
907 | } | 907 | } |
908 | 908 | ||
909 | devfs_mk_dir("printers"); | 909 | devfs_mk_dir("printers"); |
910 | lp_class = class_simple_create(THIS_MODULE, "printer"); | 910 | lp_class = class_create(THIS_MODULE, "printer"); |
911 | if (IS_ERR(lp_class)) { | 911 | if (IS_ERR(lp_class)) { |
912 | err = PTR_ERR(lp_class); | 912 | err = PTR_ERR(lp_class); |
913 | goto out_devfs; | 913 | goto out_devfs; |
@@ -930,7 +930,7 @@ static int __init lp_init (void) | |||
930 | return 0; | 930 | return 0; |
931 | 931 | ||
932 | out_class: | 932 | out_class: |
933 | class_simple_destroy(lp_class); | 933 | class_destroy(lp_class); |
934 | out_devfs: | 934 | out_devfs: |
935 | devfs_remove("printers"); | 935 | devfs_remove("printers"); |
936 | unregister_chrdev(LP_MAJOR, "lp"); | 936 | unregister_chrdev(LP_MAJOR, "lp"); |
@@ -981,10 +981,10 @@ static void lp_cleanup_module (void) | |||
981 | continue; | 981 | continue; |
982 | parport_unregister_device(lp_table[offset].dev); | 982 | parport_unregister_device(lp_table[offset].dev); |
983 | devfs_remove("printers/%d", offset); | 983 | devfs_remove("printers/%d", offset); |
984 | class_simple_device_remove(MKDEV(LP_MAJOR, offset)); | 984 | class_device_destroy(lp_class, MKDEV(LP_MAJOR, offset)); |
985 | } | 985 | } |
986 | devfs_remove("printers"); | 986 | devfs_remove("printers"); |
987 | class_simple_destroy(lp_class); | 987 | class_destroy(lp_class); |
988 | } | 988 | } |
989 | 989 | ||
990 | __setup("lp=", lp_setup); | 990 | __setup("lp=", lp_setup); |
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c index ac9cfa9701ea..115dbb35334b 100644 --- a/drivers/char/mbcs.c +++ b/drivers/char/mbcs.c | |||
@@ -699,7 +699,7 @@ static inline int mbcs_hw_init(struct mbcs_soft *soft) | |||
699 | return 0; | 699 | return 0; |
700 | } | 700 | } |
701 | 701 | ||
702 | static ssize_t show_algo(struct device *dev, char *buf) | 702 | static ssize_t show_algo(struct device *dev, struct device_attribute *attr, char *buf) |
703 | { | 703 | { |
704 | struct cx_dev *cx_dev = to_cx_dev(dev); | 704 | struct cx_dev *cx_dev = to_cx_dev(dev); |
705 | struct mbcs_soft *soft = cx_dev->soft; | 705 | struct mbcs_soft *soft = cx_dev->soft; |
@@ -715,7 +715,7 @@ static ssize_t show_algo(struct device *dev, char *buf) | |||
715 | (debug0 >> 32), (debug0 & 0xffffffff)); | 715 | (debug0 >> 32), (debug0 & 0xffffffff)); |
716 | } | 716 | } |
717 | 717 | ||
718 | static ssize_t store_algo(struct device *dev, const char *buf, size_t count) | 718 | static ssize_t store_algo(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
719 | { | 719 | { |
720 | int n; | 720 | int n; |
721 | struct cx_dev *cx_dev = to_cx_dev(dev); | 721 | struct cx_dev *cx_dev = to_cx_dev(dev); |
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 947cb3cef816..257b8ee605e5 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -856,7 +856,7 @@ static const struct { | |||
856 | {11,"kmsg", S_IRUGO | S_IWUSR, &kmsg_fops}, | 856 | {11,"kmsg", S_IRUGO | S_IWUSR, &kmsg_fops}, |
857 | }; | 857 | }; |
858 | 858 | ||
859 | static struct class_simple *mem_class; | 859 | static struct class *mem_class; |
860 | 860 | ||
861 | static int __init chr_dev_init(void) | 861 | static int __init chr_dev_init(void) |
862 | { | 862 | { |
@@ -865,10 +865,9 @@ static int __init chr_dev_init(void) | |||
865 | if (register_chrdev(MEM_MAJOR,"mem",&memory_fops)) | 865 | if (register_chrdev(MEM_MAJOR,"mem",&memory_fops)) |
866 | printk("unable to get major %d for memory devs\n", MEM_MAJOR); | 866 | printk("unable to get major %d for memory devs\n", MEM_MAJOR); |
867 | 867 | ||
868 | mem_class = class_simple_create(THIS_MODULE, "mem"); | 868 | mem_class = class_create(THIS_MODULE, "mem"); |
869 | for (i = 0; i < ARRAY_SIZE(devlist); i++) { | 869 | for (i = 0; i < ARRAY_SIZE(devlist); i++) { |
870 | class_simple_device_add(mem_class, | 870 | class_device_create(mem_class, MKDEV(MEM_MAJOR, devlist[i].minor), |
871 | MKDEV(MEM_MAJOR, devlist[i].minor), | ||
872 | NULL, devlist[i].name); | 871 | NULL, devlist[i].name); |
873 | devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor), | 872 | devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor), |
874 | S_IFCHR | devlist[i].mode, devlist[i].name); | 873 | S_IFCHR | devlist[i].mode, devlist[i].name); |
diff --git a/drivers/char/misc.c b/drivers/char/misc.c index 0937544762da..3115d318b997 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c | |||
@@ -177,10 +177,10 @@ fail: | |||
177 | 177 | ||
178 | /* | 178 | /* |
179 | * TODO for 2.7: | 179 | * TODO for 2.7: |
180 | * - add a struct class_device to struct miscdevice and make all usages of | 180 | * - add a struct kref to struct miscdevice and make all usages of |
181 | * them dynamic. | 181 | * them dynamic. |
182 | */ | 182 | */ |
183 | static struct class_simple *misc_class; | 183 | static struct class *misc_class; |
184 | 184 | ||
185 | static struct file_operations misc_fops = { | 185 | static struct file_operations misc_fops = { |
186 | .owner = THIS_MODULE, | 186 | .owner = THIS_MODULE, |
@@ -238,8 +238,8 @@ int misc_register(struct miscdevice * misc) | |||
238 | } | 238 | } |
239 | dev = MKDEV(MISC_MAJOR, misc->minor); | 239 | dev = MKDEV(MISC_MAJOR, misc->minor); |
240 | 240 | ||
241 | misc->class = class_simple_device_add(misc_class, dev, | 241 | misc->class = class_device_create(misc_class, dev, misc->dev, |
242 | misc->dev, misc->name); | 242 | "%s", misc->name); |
243 | if (IS_ERR(misc->class)) { | 243 | if (IS_ERR(misc->class)) { |
244 | err = PTR_ERR(misc->class); | 244 | err = PTR_ERR(misc->class); |
245 | goto out; | 245 | goto out; |
@@ -248,7 +248,7 @@ int misc_register(struct miscdevice * misc) | |||
248 | err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, | 248 | err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, |
249 | misc->devfs_name); | 249 | misc->devfs_name); |
250 | if (err) { | 250 | if (err) { |
251 | class_simple_device_remove(dev); | 251 | class_device_destroy(misc_class, dev); |
252 | goto out; | 252 | goto out; |
253 | } | 253 | } |
254 | 254 | ||
@@ -281,7 +281,7 @@ int misc_deregister(struct miscdevice * misc) | |||
281 | 281 | ||
282 | down(&misc_sem); | 282 | down(&misc_sem); |
283 | list_del(&misc->list); | 283 | list_del(&misc->list); |
284 | class_simple_device_remove(MKDEV(MISC_MAJOR, misc->minor)); | 284 | class_device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor)); |
285 | devfs_remove(misc->devfs_name); | 285 | devfs_remove(misc->devfs_name); |
286 | if (i < DYNAMIC_MINORS && i>0) { | 286 | if (i < DYNAMIC_MINORS && i>0) { |
287 | misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); | 287 | misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); |
@@ -302,7 +302,7 @@ static int __init misc_init(void) | |||
302 | if (ent) | 302 | if (ent) |
303 | ent->proc_fops = &misc_proc_fops; | 303 | ent->proc_fops = &misc_proc_fops; |
304 | #endif | 304 | #endif |
305 | misc_class = class_simple_create(THIS_MODULE, "misc"); | 305 | misc_class = class_create(THIS_MODULE, "misc"); |
306 | if (IS_ERR(misc_class)) | 306 | if (IS_ERR(misc_class)) |
307 | return PTR_ERR(misc_class); | 307 | return PTR_ERR(misc_class); |
308 | #ifdef CONFIG_MVME16x | 308 | #ifdef CONFIG_MVME16x |
@@ -323,7 +323,7 @@ static int __init misc_init(void) | |||
323 | if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) { | 323 | if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) { |
324 | printk("unable to get major %d for misc devices\n", | 324 | printk("unable to get major %d for misc devices\n", |
325 | MISC_MAJOR); | 325 | MISC_MAJOR); |
326 | class_simple_destroy(misc_class); | 326 | class_destroy(misc_class); |
327 | return -EIO; | 327 | return -EIO; |
328 | } | 328 | } |
329 | return 0; | 329 | return 0; |
diff --git a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c index d37625d47746..d568991ac6b3 100644 --- a/drivers/char/mwave/mwavedd.c +++ b/drivers/char/mwave/mwavedd.c | |||
@@ -472,7 +472,7 @@ struct device mwave_device; | |||
472 | 472 | ||
473 | /* Prevent code redundancy, create a macro for mwave_show_* functions. */ | 473 | /* Prevent code redundancy, create a macro for mwave_show_* functions. */ |
474 | #define mwave_show_function(attr_name, format_string, field) \ | 474 | #define mwave_show_function(attr_name, format_string, field) \ |
475 | static ssize_t mwave_show_##attr_name(struct device *dev, char *buf) \ | 475 | static ssize_t mwave_show_##attr_name(struct device *dev, struct device_attribute *attr, char *buf) \ |
476 | { \ | 476 | { \ |
477 | DSP_3780I_CONFIG_SETTINGS *pSettings = \ | 477 | DSP_3780I_CONFIG_SETTINGS *pSettings = \ |
478 | &mwave_s_mdd.rBDData.rDspSettings; \ | 478 | &mwave_s_mdd.rBDData.rDspSettings; \ |
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 7a245068e3e5..f022f0944434 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c | |||
@@ -1995,9 +1995,6 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status) | |||
1995 | unsigned char ch, gdl; | 1995 | unsigned char ch, gdl; |
1996 | int ignored = 0; | 1996 | int ignored = 0; |
1997 | int cnt = 0; | 1997 | int cnt = 0; |
1998 | unsigned char *cp; | ||
1999 | char *fp; | ||
2000 | int count; | ||
2001 | int recv_room; | 1998 | int recv_room; |
2002 | int max = 256; | 1999 | int max = 256; |
2003 | unsigned long flags; | 2000 | unsigned long flags; |
@@ -2011,10 +2008,6 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status) | |||
2011 | //return; | 2008 | //return; |
2012 | } | 2009 | } |
2013 | 2010 | ||
2014 | cp = tty->flip.char_buf; | ||
2015 | fp = tty->flip.flag_buf; | ||
2016 | count = 0; | ||
2017 | |||
2018 | // following add by Victor Yu. 09-02-2002 | 2011 | // following add by Victor Yu. 09-02-2002 |
2019 | if (info->IsMoxaMustChipFlag != MOXA_OTHER_UART) { | 2012 | if (info->IsMoxaMustChipFlag != MOXA_OTHER_UART) { |
2020 | 2013 | ||
@@ -2041,12 +2034,10 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status) | |||
2041 | } | 2034 | } |
2042 | while (gdl--) { | 2035 | while (gdl--) { |
2043 | ch = inb(info->base + UART_RX); | 2036 | ch = inb(info->base + UART_RX); |
2044 | count++; | 2037 | tty_insert_flip_char(tty, ch, 0); |
2045 | *cp++ = ch; | ||
2046 | *fp++ = 0; | ||
2047 | cnt++; | 2038 | cnt++; |
2048 | /* | 2039 | /* |
2049 | if((count>=HI_WATER) && (info->stop_rx==0)){ | 2040 | if((cnt>=HI_WATER) && (info->stop_rx==0)){ |
2050 | mxser_stoprx(tty); | 2041 | mxser_stoprx(tty); |
2051 | info->stop_rx=1; | 2042 | info->stop_rx=1; |
2052 | break; | 2043 | break; |
@@ -2061,7 +2052,7 @@ intr_old: | |||
2061 | if (max-- < 0) | 2052 | if (max-- < 0) |
2062 | break; | 2053 | break; |
2063 | /* | 2054 | /* |
2064 | if((count>=HI_WATER) && (info->stop_rx==0)){ | 2055 | if((cnt>=HI_WATER) && (info->stop_rx==0)){ |
2065 | mxser_stoprx(tty); | 2056 | mxser_stoprx(tty); |
2066 | info->stop_rx=1; | 2057 | info->stop_rx=1; |
2067 | break; | 2058 | break; |
@@ -2078,36 +2069,33 @@ intr_old: | |||
2078 | if (++ignored > 100) | 2069 | if (++ignored > 100) |
2079 | break; | 2070 | break; |
2080 | } else { | 2071 | } else { |
2081 | count++; | 2072 | char flag = 0; |
2082 | if (*status & UART_LSR_SPECIAL) { | 2073 | if (*status & UART_LSR_SPECIAL) { |
2083 | if (*status & UART_LSR_BI) { | 2074 | if (*status & UART_LSR_BI) { |
2084 | *fp++ = TTY_BREAK; | 2075 | flag = TTY_BREAK; |
2085 | /* added by casper 1/11/2000 */ | 2076 | /* added by casper 1/11/2000 */ |
2086 | info->icount.brk++; | 2077 | info->icount.brk++; |
2087 | |||
2088 | /* */ | 2078 | /* */ |
2089 | if (info->flags & ASYNC_SAK) | 2079 | if (info->flags & ASYNC_SAK) |
2090 | do_SAK(tty); | 2080 | do_SAK(tty); |
2091 | } else if (*status & UART_LSR_PE) { | 2081 | } else if (*status & UART_LSR_PE) { |
2092 | *fp++ = TTY_PARITY; | 2082 | flag = TTY_PARITY; |
2093 | /* added by casper 1/11/2000 */ | 2083 | /* added by casper 1/11/2000 */ |
2094 | info->icount.parity++; | 2084 | info->icount.parity++; |
2095 | /* */ | 2085 | /* */ |
2096 | } else if (*status & UART_LSR_FE) { | 2086 | } else if (*status & UART_LSR_FE) { |
2097 | *fp++ = TTY_FRAME; | 2087 | flag = TTY_FRAME; |
2098 | /* added by casper 1/11/2000 */ | 2088 | /* added by casper 1/11/2000 */ |
2099 | info->icount.frame++; | 2089 | info->icount.frame++; |
2100 | /* */ | 2090 | /* */ |
2101 | } else if (*status & UART_LSR_OE) { | 2091 | } else if (*status & UART_LSR_OE) { |
2102 | *fp++ = TTY_OVERRUN; | 2092 | flag = TTY_OVERRUN; |
2103 | /* added by casper 1/11/2000 */ | 2093 | /* added by casper 1/11/2000 */ |
2104 | info->icount.overrun++; | 2094 | info->icount.overrun++; |
2105 | /* */ | 2095 | /* */ |
2106 | } else | 2096 | } |
2107 | *fp++ = 0; | 2097 | } |
2108 | } else | 2098 | tty_insert_flip_char(tty, ch, flag); |
2109 | *fp++ = 0; | ||
2110 | *cp++ = ch; | ||
2111 | cnt++; | 2099 | cnt++; |
2112 | if (cnt >= recv_room) { | 2100 | if (cnt >= recv_room) { |
2113 | if (!info->ldisc_stop_rx) { | 2101 | if (!info->ldisc_stop_rx) { |
@@ -2132,13 +2120,13 @@ intr_old: | |||
2132 | // above add by Victor Yu. 09-02-2002 | 2120 | // above add by Victor Yu. 09-02-2002 |
2133 | } while (*status & UART_LSR_DR); | 2121 | } while (*status & UART_LSR_DR); |
2134 | 2122 | ||
2135 | end_intr: // add by Victor Yu. 09-02-2002 | 2123 | end_intr: // add by Victor Yu. 09-02-2002 |
2136 | 2124 | ||
2137 | mxvar_log.rxcnt[info->port] += cnt; | 2125 | mxvar_log.rxcnt[info->port] += cnt; |
2138 | info->mon_data.rxcnt += cnt; | 2126 | info->mon_data.rxcnt += cnt; |
2139 | info->mon_data.up_rxcnt += cnt; | 2127 | info->mon_data.up_rxcnt += cnt; |
2140 | spin_unlock_irqrestore(&info->slock, flags); | 2128 | spin_unlock_irqrestore(&info->slock, flags); |
2141 | 2129 | ||
2142 | tty_flip_buffer_push(tty); | 2130 | tty_flip_buffer_push(tty); |
2143 | } | 2131 | } |
2144 | 2132 | ||
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 5eda075c62bd..0e22880432bc 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c | |||
@@ -737,7 +737,7 @@ static unsigned int pp_poll (struct file * file, poll_table * wait) | |||
737 | return mask; | 737 | return mask; |
738 | } | 738 | } |
739 | 739 | ||
740 | static struct class_simple *ppdev_class; | 740 | static struct class *ppdev_class; |
741 | 741 | ||
742 | static struct file_operations pp_fops = { | 742 | static struct file_operations pp_fops = { |
743 | .owner = THIS_MODULE, | 743 | .owner = THIS_MODULE, |
@@ -752,13 +752,13 @@ static struct file_operations pp_fops = { | |||
752 | 752 | ||
753 | static void pp_attach(struct parport *port) | 753 | static void pp_attach(struct parport *port) |
754 | { | 754 | { |
755 | class_simple_device_add(ppdev_class, MKDEV(PP_MAJOR, port->number), | 755 | class_device_create(ppdev_class, MKDEV(PP_MAJOR, port->number), |
756 | NULL, "parport%d", port->number); | 756 | NULL, "parport%d", port->number); |
757 | } | 757 | } |
758 | 758 | ||
759 | static void pp_detach(struct parport *port) | 759 | static void pp_detach(struct parport *port) |
760 | { | 760 | { |
761 | class_simple_device_remove(MKDEV(PP_MAJOR, port->number)); | 761 | class_device_destroy(ppdev_class, MKDEV(PP_MAJOR, port->number)); |
762 | } | 762 | } |
763 | 763 | ||
764 | static struct parport_driver pp_driver = { | 764 | static struct parport_driver pp_driver = { |
@@ -776,7 +776,7 @@ static int __init ppdev_init (void) | |||
776 | PP_MAJOR); | 776 | PP_MAJOR); |
777 | return -EIO; | 777 | return -EIO; |
778 | } | 778 | } |
779 | ppdev_class = class_simple_create(THIS_MODULE, CHRDEV); | 779 | ppdev_class = class_create(THIS_MODULE, CHRDEV); |
780 | if (IS_ERR(ppdev_class)) { | 780 | if (IS_ERR(ppdev_class)) { |
781 | err = PTR_ERR(ppdev_class); | 781 | err = PTR_ERR(ppdev_class); |
782 | goto out_chrdev; | 782 | goto out_chrdev; |
@@ -798,7 +798,7 @@ out_class: | |||
798 | for (i = 0; i < PARPORT_MAX; i++) | 798 | for (i = 0; i < PARPORT_MAX; i++) |
799 | devfs_remove("parports/%d", i); | 799 | devfs_remove("parports/%d", i); |
800 | devfs_remove("parports"); | 800 | devfs_remove("parports"); |
801 | class_simple_destroy(ppdev_class); | 801 | class_destroy(ppdev_class); |
802 | out_chrdev: | 802 | out_chrdev: |
803 | unregister_chrdev(PP_MAJOR, CHRDEV); | 803 | unregister_chrdev(PP_MAJOR, CHRDEV); |
804 | out: | 804 | out: |
@@ -813,7 +813,7 @@ static void __exit ppdev_cleanup (void) | |||
813 | devfs_remove("parports/%d", i); | 813 | devfs_remove("parports/%d", i); |
814 | parport_unregister_driver(&pp_driver); | 814 | parport_unregister_driver(&pp_driver); |
815 | devfs_remove("parports"); | 815 | devfs_remove("parports"); |
816 | class_simple_destroy(ppdev_class); | 816 | class_destroy(ppdev_class); |
817 | unregister_chrdev (PP_MAJOR, CHRDEV); | 817 | unregister_chrdev (PP_MAJOR, CHRDEV); |
818 | } | 818 | } |
819 | 819 | ||
diff --git a/drivers/char/raw.c b/drivers/char/raw.c index ca5f42bcaad9..f13e5de02207 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c | |||
@@ -27,7 +27,7 @@ struct raw_device_data { | |||
27 | int inuse; | 27 | int inuse; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | static struct class_simple *raw_class; | 30 | static struct class *raw_class; |
31 | static struct raw_device_data raw_devices[MAX_RAW_MINORS]; | 31 | static struct raw_device_data raw_devices[MAX_RAW_MINORS]; |
32 | static DECLARE_MUTEX(raw_mutex); | 32 | static DECLARE_MUTEX(raw_mutex); |
33 | static struct file_operations raw_ctl_fops; /* forward declaration */ | 33 | static struct file_operations raw_ctl_fops; /* forward declaration */ |
@@ -127,8 +127,8 @@ raw_ioctl(struct inode *inode, struct file *filp, | |||
127 | 127 | ||
128 | static void bind_device(struct raw_config_request *rq) | 128 | static void bind_device(struct raw_config_request *rq) |
129 | { | 129 | { |
130 | class_simple_device_remove(MKDEV(RAW_MAJOR, rq->raw_minor)); | 130 | class_device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor)); |
131 | class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor), | 131 | class_device_create(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor), |
132 | NULL, "raw%d", rq->raw_minor); | 132 | NULL, "raw%d", rq->raw_minor); |
133 | } | 133 | } |
134 | 134 | ||
@@ -200,8 +200,8 @@ static int raw_ctl_ioctl(struct inode *inode, struct file *filp, | |||
200 | if (rq.block_major == 0 && rq.block_minor == 0) { | 200 | if (rq.block_major == 0 && rq.block_minor == 0) { |
201 | /* unbind */ | 201 | /* unbind */ |
202 | rawdev->binding = NULL; | 202 | rawdev->binding = NULL; |
203 | class_simple_device_remove(MKDEV(RAW_MAJOR, | 203 | class_device_destroy(raw_class, |
204 | rq.raw_minor)); | 204 | MKDEV(RAW_MAJOR, rq.raw_minor)); |
205 | } else { | 205 | } else { |
206 | rawdev->binding = bdget(dev); | 206 | rawdev->binding = bdget(dev); |
207 | if (rawdev->binding == NULL) | 207 | if (rawdev->binding == NULL) |
@@ -300,14 +300,14 @@ static int __init raw_init(void) | |||
300 | goto error; | 300 | goto error; |
301 | } | 301 | } |
302 | 302 | ||
303 | raw_class = class_simple_create(THIS_MODULE, "raw"); | 303 | raw_class = class_create(THIS_MODULE, "raw"); |
304 | if (IS_ERR(raw_class)) { | 304 | if (IS_ERR(raw_class)) { |
305 | printk(KERN_ERR "Error creating raw class.\n"); | 305 | printk(KERN_ERR "Error creating raw class.\n"); |
306 | cdev_del(&raw_cdev); | 306 | cdev_del(&raw_cdev); |
307 | unregister_chrdev_region(dev, MAX_RAW_MINORS); | 307 | unregister_chrdev_region(dev, MAX_RAW_MINORS); |
308 | goto error; | 308 | goto error; |
309 | } | 309 | } |
310 | class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); | 310 | class_device_create(raw_class, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); |
311 | 311 | ||
312 | devfs_mk_cdev(MKDEV(RAW_MAJOR, 0), | 312 | devfs_mk_cdev(MKDEV(RAW_MAJOR, 0), |
313 | S_IFCHR | S_IRUGO | S_IWUGO, | 313 | S_IFCHR | S_IRUGO | S_IWUGO, |
@@ -331,8 +331,8 @@ static void __exit raw_exit(void) | |||
331 | devfs_remove("raw/raw%d", i); | 331 | devfs_remove("raw/raw%d", i); |
332 | devfs_remove("raw/rawctl"); | 332 | devfs_remove("raw/rawctl"); |
333 | devfs_remove("raw"); | 333 | devfs_remove("raw"); |
334 | class_simple_device_remove(MKDEV(RAW_MAJOR, 0)); | 334 | class_device_destroy(raw_class, MKDEV(RAW_MAJOR, 0)); |
335 | class_simple_destroy(raw_class); | 335 | class_destroy(raw_class); |
336 | cdev_del(&raw_cdev); | 336 | cdev_del(&raw_cdev); |
337 | unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS); | 337 | unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS); |
338 | } | 338 | } |
diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c index e3c0b52d943f..261a41bf6d02 100644 --- a/drivers/char/snsc.c +++ b/drivers/char/snsc.c | |||
@@ -357,6 +357,8 @@ static struct file_operations scdrv_fops = { | |||
357 | .release = scdrv_release, | 357 | .release = scdrv_release, |
358 | }; | 358 | }; |
359 | 359 | ||
360 | static struct class *snsc_class; | ||
361 | |||
360 | /* | 362 | /* |
361 | * scdrv_init | 363 | * scdrv_init |
362 | * | 364 | * |
@@ -372,7 +374,6 @@ scdrv_init(void) | |||
372 | char *devnamep; | 374 | char *devnamep; |
373 | struct sysctl_data_s *scd; | 375 | struct sysctl_data_s *scd; |
374 | void *salbuf; | 376 | void *salbuf; |
375 | struct class_simple *snsc_class; | ||
376 | dev_t first_dev, dev; | 377 | dev_t first_dev, dev; |
377 | nasid_t event_nasid = ia64_sn_get_console_nasid(); | 378 | nasid_t event_nasid = ia64_sn_get_console_nasid(); |
378 | 379 | ||
@@ -382,7 +383,7 @@ scdrv_init(void) | |||
382 | __FUNCTION__); | 383 | __FUNCTION__); |
383 | return -ENODEV; | 384 | return -ENODEV; |
384 | } | 385 | } |
385 | snsc_class = class_simple_create(THIS_MODULE, SYSCTL_BASENAME); | 386 | snsc_class = class_create(THIS_MODULE, SYSCTL_BASENAME); |
386 | 387 | ||
387 | for (cnode = 0; cnode < numionodes; cnode++) { | 388 | for (cnode = 0; cnode < numionodes; cnode++) { |
388 | geoid = cnodeid_get_geoid(cnode); | 389 | geoid = cnodeid_get_geoid(cnode); |
@@ -436,7 +437,7 @@ scdrv_init(void) | |||
436 | continue; | 437 | continue; |
437 | } | 438 | } |
438 | 439 | ||
439 | class_simple_device_add(snsc_class, dev, NULL, | 440 | class_device_create(snsc_class, dev, NULL, |
440 | "%s", devname); | 441 | "%s", devname); |
441 | 442 | ||
442 | ia64_sn_irtr_intr_enable(scd->scd_nasid, | 443 | ia64_sn_irtr_intr_enable(scd->scd_nasid, |
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c index b8899f560b5e..951545a6ef2d 100644 --- a/drivers/char/stallion.c +++ b/drivers/char/stallion.c | |||
@@ -719,7 +719,7 @@ static struct file_operations stl_fsiomem = { | |||
719 | 719 | ||
720 | /*****************************************************************************/ | 720 | /*****************************************************************************/ |
721 | 721 | ||
722 | static struct class_simple *stallion_class; | 722 | static struct class *stallion_class; |
723 | 723 | ||
724 | /* | 724 | /* |
725 | * Loadable module initialization stuff. | 725 | * Loadable module initialization stuff. |
@@ -777,13 +777,13 @@ static void __exit stallion_module_exit(void) | |||
777 | } | 777 | } |
778 | for (i = 0; i < 4; i++) { | 778 | for (i = 0; i < 4; i++) { |
779 | devfs_remove("staliomem/%d", i); | 779 | devfs_remove("staliomem/%d", i); |
780 | class_simple_device_remove(MKDEV(STL_SIOMEMMAJOR, i)); | 780 | class_device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i)); |
781 | } | 781 | } |
782 | devfs_remove("staliomem"); | 782 | devfs_remove("staliomem"); |
783 | if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem"))) | 783 | if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem"))) |
784 | printk("STALLION: failed to un-register serial memory device, " | 784 | printk("STALLION: failed to un-register serial memory device, " |
785 | "errno=%d\n", -i); | 785 | "errno=%d\n", -i); |
786 | class_simple_destroy(stallion_class); | 786 | class_destroy(stallion_class); |
787 | 787 | ||
788 | if (stl_tmpwritebuf != (char *) NULL) | 788 | if (stl_tmpwritebuf != (char *) NULL) |
789 | kfree(stl_tmpwritebuf); | 789 | kfree(stl_tmpwritebuf); |
@@ -3090,12 +3090,12 @@ static int __init stl_init(void) | |||
3090 | printk("STALLION: failed to register serial board device\n"); | 3090 | printk("STALLION: failed to register serial board device\n"); |
3091 | devfs_mk_dir("staliomem"); | 3091 | devfs_mk_dir("staliomem"); |
3092 | 3092 | ||
3093 | stallion_class = class_simple_create(THIS_MODULE, "staliomem"); | 3093 | stallion_class = class_create(THIS_MODULE, "staliomem"); |
3094 | for (i = 0; i < 4; i++) { | 3094 | for (i = 0; i < 4; i++) { |
3095 | devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i), | 3095 | devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i), |
3096 | S_IFCHR|S_IRUSR|S_IWUSR, | 3096 | S_IFCHR|S_IRUSR|S_IWUSR, |
3097 | "staliomem/%d", i); | 3097 | "staliomem/%d", i); |
3098 | class_simple_device_add(stallion_class, MKDEV(STL_SIOMEMMAJOR, i), NULL, "staliomem%d", i); | 3098 | class_device_create(stallion_class, MKDEV(STL_SIOMEMMAJOR, i), NULL, "staliomem%d", i); |
3099 | } | 3099 | } |
3100 | 3100 | ||
3101 | stl_serial->owner = THIS_MODULE; | 3101 | stl_serial->owner = THIS_MODULE; |
diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c index 0c5ba9dc9063..659335d80ee7 100644 --- a/drivers/char/tipar.c +++ b/drivers/char/tipar.c | |||
@@ -90,7 +90,7 @@ static int timeout = TIMAXTIME; /* timeout in tenth of seconds */ | |||
90 | static unsigned int tp_count; /* tipar count */ | 90 | static unsigned int tp_count; /* tipar count */ |
91 | static unsigned long opened; /* opened devices */ | 91 | static unsigned long opened; /* opened devices */ |
92 | 92 | ||
93 | static struct class_simple *tipar_class; | 93 | static struct class *tipar_class; |
94 | 94 | ||
95 | /* --- macros for parport access -------------------------------------- */ | 95 | /* --- macros for parport access -------------------------------------- */ |
96 | 96 | ||
@@ -436,7 +436,7 @@ tipar_register(int nr, struct parport *port) | |||
436 | goto out; | 436 | goto out; |
437 | } | 437 | } |
438 | 438 | ||
439 | class_simple_device_add(tipar_class, MKDEV(TIPAR_MAJOR, | 439 | class_device_create(tipar_class, MKDEV(TIPAR_MAJOR, |
440 | TIPAR_MINOR + nr), NULL, "par%d", nr); | 440 | TIPAR_MINOR + nr), NULL, "par%d", nr); |
441 | /* Use devfs, tree: /dev/ticables/par/[0..2] */ | 441 | /* Use devfs, tree: /dev/ticables/par/[0..2] */ |
442 | err = devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr), | 442 | err = devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr), |
@@ -458,8 +458,8 @@ tipar_register(int nr, struct parport *port) | |||
458 | goto out; | 458 | goto out; |
459 | 459 | ||
460 | out_class: | 460 | out_class: |
461 | class_simple_device_remove(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr)); | 461 | class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr)); |
462 | class_simple_destroy(tipar_class); | 462 | class_destroy(tipar_class); |
463 | out: | 463 | out: |
464 | return err; | 464 | return err; |
465 | } | 465 | } |
@@ -505,7 +505,7 @@ tipar_init_module(void) | |||
505 | /* Use devfs with tree: /dev/ticables/par/[0..2] */ | 505 | /* Use devfs with tree: /dev/ticables/par/[0..2] */ |
506 | devfs_mk_dir("ticables/par"); | 506 | devfs_mk_dir("ticables/par"); |
507 | 507 | ||
508 | tipar_class = class_simple_create(THIS_MODULE, "ticables"); | 508 | tipar_class = class_create(THIS_MODULE, "ticables"); |
509 | if (IS_ERR(tipar_class)) { | 509 | if (IS_ERR(tipar_class)) { |
510 | err = PTR_ERR(tipar_class); | 510 | err = PTR_ERR(tipar_class); |
511 | goto out_chrdev; | 511 | goto out_chrdev; |
@@ -539,10 +539,10 @@ tipar_cleanup_module(void) | |||
539 | if (table[i].dev == NULL) | 539 | if (table[i].dev == NULL) |
540 | continue; | 540 | continue; |
541 | parport_unregister_device(table[i].dev); | 541 | parport_unregister_device(table[i].dev); |
542 | class_simple_device_remove(MKDEV(TIPAR_MAJOR, i)); | 542 | class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, i)); |
543 | devfs_remove("ticables/par/%d", i); | 543 | devfs_remove("ticables/par/%d", i); |
544 | } | 544 | } |
545 | class_simple_destroy(tipar_class); | 545 | class_destroy(tipar_class); |
546 | devfs_remove("ticables/par"); | 546 | devfs_remove("ticables/par"); |
547 | 547 | ||
548 | pr_info("tipar: module unloaded\n"); | 548 | pr_info("tipar: module unloaded\n"); |
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 87235330fdbe..8ce508b29865 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -212,7 +212,7 @@ static u8 pcrread[] = { | |||
212 | 0, 0, 0, 0 /* PCR index */ | 212 | 0, 0, 0, 0 /* PCR index */ |
213 | }; | 213 | }; |
214 | 214 | ||
215 | static ssize_t show_pcrs(struct device *dev, char *buf) | 215 | static ssize_t show_pcrs(struct device *dev, struct device_attribute *attr, char *buf) |
216 | { | 216 | { |
217 | u8 data[READ_PCR_RESULT_SIZE]; | 217 | u8 data[READ_PCR_RESULT_SIZE]; |
218 | ssize_t len; | 218 | ssize_t len; |
@@ -255,7 +255,7 @@ static u8 readpubek[] = { | |||
255 | 0, 0, 0, 124, /* TPM_ORD_ReadPubek */ | 255 | 0, 0, 0, 124, /* TPM_ORD_ReadPubek */ |
256 | }; | 256 | }; |
257 | 257 | ||
258 | static ssize_t show_pubek(struct device *dev, char *buf) | 258 | static ssize_t show_pubek(struct device *dev, struct device_attribute *attr, char *buf) |
259 | { | 259 | { |
260 | u8 data[READ_PUBEK_RESULT_SIZE]; | 260 | u8 data[READ_PUBEK_RESULT_SIZE]; |
261 | ssize_t len; | 261 | ssize_t len; |
@@ -330,7 +330,7 @@ static u8 cap_manufacturer[] = { | |||
330 | 0, 0, 1, 3 | 330 | 0, 0, 1, 3 |
331 | }; | 331 | }; |
332 | 332 | ||
333 | static ssize_t show_caps(struct device *dev, char *buf) | 333 | static ssize_t show_caps(struct device *dev, struct device_attribute *attr, char *buf) |
334 | { | 334 | { |
335 | u8 data[READ_PUBEK_RESULT_SIZE]; | 335 | u8 data[READ_PUBEK_RESULT_SIZE]; |
336 | ssize_t len; | 336 | ssize_t len; |
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 26e5e19ed854..31831030f73f 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -2654,7 +2654,7 @@ static void tty_default_put_char(struct tty_struct *tty, unsigned char ch) | |||
2654 | tty->driver->write(tty, &ch, 1); | 2654 | tty->driver->write(tty, &ch, 1); |
2655 | } | 2655 | } |
2656 | 2656 | ||
2657 | static struct class_simple *tty_class; | 2657 | static struct class *tty_class; |
2658 | 2658 | ||
2659 | /** | 2659 | /** |
2660 | * tty_register_device - register a tty device | 2660 | * tty_register_device - register a tty device |
@@ -2687,7 +2687,7 @@ void tty_register_device(struct tty_driver *driver, unsigned index, | |||
2687 | pty_line_name(driver, index, name); | 2687 | pty_line_name(driver, index, name); |
2688 | else | 2688 | else |
2689 | tty_line_name(driver, index, name); | 2689 | tty_line_name(driver, index, name); |
2690 | class_simple_device_add(tty_class, dev, device, name); | 2690 | class_device_create(tty_class, dev, device, name); |
2691 | } | 2691 | } |
2692 | 2692 | ||
2693 | /** | 2693 | /** |
@@ -2701,7 +2701,7 @@ void tty_register_device(struct tty_driver *driver, unsigned index, | |||
2701 | void tty_unregister_device(struct tty_driver *driver, unsigned index) | 2701 | void tty_unregister_device(struct tty_driver *driver, unsigned index) |
2702 | { | 2702 | { |
2703 | devfs_remove("%s%d", driver->devfs_name, index + driver->name_base); | 2703 | devfs_remove("%s%d", driver->devfs_name, index + driver->name_base); |
2704 | class_simple_device_remove(MKDEV(driver->major, driver->minor_start) + index); | 2704 | class_device_destroy(tty_class, MKDEV(driver->major, driver->minor_start) + index); |
2705 | } | 2705 | } |
2706 | 2706 | ||
2707 | EXPORT_SYMBOL(tty_register_device); | 2707 | EXPORT_SYMBOL(tty_register_device); |
@@ -2918,7 +2918,7 @@ extern int vty_init(void); | |||
2918 | 2918 | ||
2919 | static int __init tty_class_init(void) | 2919 | static int __init tty_class_init(void) |
2920 | { | 2920 | { |
2921 | tty_class = class_simple_create(THIS_MODULE, "tty"); | 2921 | tty_class = class_create(THIS_MODULE, "tty"); |
2922 | if (IS_ERR(tty_class)) | 2922 | if (IS_ERR(tty_class)) |
2923 | return PTR_ERR(tty_class); | 2923 | return PTR_ERR(tty_class); |
2924 | return 0; | 2924 | return 0; |
@@ -2947,14 +2947,14 @@ static int __init tty_init(void) | |||
2947 | register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0) | 2947 | register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0) |
2948 | panic("Couldn't register /dev/tty driver\n"); | 2948 | panic("Couldn't register /dev/tty driver\n"); |
2949 | devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 0), S_IFCHR|S_IRUGO|S_IWUGO, "tty"); | 2949 | devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 0), S_IFCHR|S_IRUGO|S_IWUGO, "tty"); |
2950 | class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty"); | 2950 | class_device_create(tty_class, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty"); |
2951 | 2951 | ||
2952 | cdev_init(&console_cdev, &console_fops); | 2952 | cdev_init(&console_cdev, &console_fops); |
2953 | if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) || | 2953 | if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) || |
2954 | register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0) | 2954 | register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0) |
2955 | panic("Couldn't register /dev/console driver\n"); | 2955 | panic("Couldn't register /dev/console driver\n"); |
2956 | devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 1), S_IFCHR|S_IRUSR|S_IWUSR, "console"); | 2956 | devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 1), S_IFCHR|S_IRUSR|S_IWUSR, "console"); |
2957 | class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 1), NULL, "console"); | 2957 | class_device_create(tty_class, MKDEV(TTYAUX_MAJOR, 1), NULL, "console"); |
2958 | 2958 | ||
2959 | #ifdef CONFIG_UNIX98_PTYS | 2959 | #ifdef CONFIG_UNIX98_PTYS |
2960 | cdev_init(&ptmx_cdev, &ptmx_fops); | 2960 | cdev_init(&ptmx_cdev, &ptmx_fops); |
@@ -2962,7 +2962,7 @@ static int __init tty_init(void) | |||
2962 | register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) | 2962 | register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) |
2963 | panic("Couldn't register /dev/ptmx driver\n"); | 2963 | panic("Couldn't register /dev/ptmx driver\n"); |
2964 | devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 2), S_IFCHR|S_IRUGO|S_IWUGO, "ptmx"); | 2964 | devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 2), S_IFCHR|S_IRUGO|S_IWUGO, "ptmx"); |
2965 | class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx"); | 2965 | class_device_create(tty_class, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx"); |
2966 | #endif | 2966 | #endif |
2967 | 2967 | ||
2968 | #ifdef CONFIG_VT | 2968 | #ifdef CONFIG_VT |
@@ -2971,7 +2971,7 @@ static int __init tty_init(void) | |||
2971 | register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0) | 2971 | register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0) |
2972 | panic("Couldn't register /dev/tty0 driver\n"); | 2972 | panic("Couldn't register /dev/tty0 driver\n"); |
2973 | devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vc/0"); | 2973 | devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vc/0"); |
2974 | class_simple_device_add(tty_class, MKDEV(TTY_MAJOR, 0), NULL, "tty0"); | 2974 | class_device_create(tty_class, MKDEV(TTY_MAJOR, 0), NULL, "tty0"); |
2975 | 2975 | ||
2976 | vty_init(); | 2976 | vty_init(); |
2977 | #endif | 2977 | #endif |
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c index 7abe405b8657..79c2928a8817 100644 --- a/drivers/char/vc_screen.c +++ b/drivers/char/vc_screen.c | |||
@@ -474,7 +474,7 @@ static struct file_operations vcs_fops = { | |||
474 | .open = vcs_open, | 474 | .open = vcs_open, |
475 | }; | 475 | }; |
476 | 476 | ||
477 | static struct class_simple *vc_class; | 477 | static struct class *vc_class; |
478 | 478 | ||
479 | void vcs_make_devfs(struct tty_struct *tty) | 479 | void vcs_make_devfs(struct tty_struct *tty) |
480 | { | 480 | { |
@@ -484,26 +484,26 @@ void vcs_make_devfs(struct tty_struct *tty) | |||
484 | devfs_mk_cdev(MKDEV(VCS_MAJOR, tty->index + 129), | 484 | devfs_mk_cdev(MKDEV(VCS_MAJOR, tty->index + 129), |
485 | S_IFCHR|S_IRUSR|S_IWUSR, | 485 | S_IFCHR|S_IRUSR|S_IWUSR, |
486 | "vcc/a%u", tty->index + 1); | 486 | "vcc/a%u", tty->index + 1); |
487 | class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, tty->index + 1), NULL, "vcs%u", tty->index + 1); | 487 | class_device_create(vc_class, MKDEV(VCS_MAJOR, tty->index + 1), NULL, "vcs%u", tty->index + 1); |
488 | class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, tty->index + 129), NULL, "vcsa%u", tty->index + 1); | 488 | class_device_create(vc_class, MKDEV(VCS_MAJOR, tty->index + 129), NULL, "vcsa%u", tty->index + 1); |
489 | } | 489 | } |
490 | void vcs_remove_devfs(struct tty_struct *tty) | 490 | void vcs_remove_devfs(struct tty_struct *tty) |
491 | { | 491 | { |
492 | devfs_remove("vcc/%u", tty->index + 1); | 492 | devfs_remove("vcc/%u", tty->index + 1); |
493 | devfs_remove("vcc/a%u", tty->index + 1); | 493 | devfs_remove("vcc/a%u", tty->index + 1); |
494 | class_simple_device_remove(MKDEV(VCS_MAJOR, tty->index + 1)); | 494 | class_device_destroy(vc_class, MKDEV(VCS_MAJOR, tty->index + 1)); |
495 | class_simple_device_remove(MKDEV(VCS_MAJOR, tty->index + 129)); | 495 | class_device_destroy(vc_class, MKDEV(VCS_MAJOR, tty->index + 129)); |
496 | } | 496 | } |
497 | 497 | ||
498 | int __init vcs_init(void) | 498 | int __init vcs_init(void) |
499 | { | 499 | { |
500 | if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops)) | 500 | if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops)) |
501 | panic("unable to get major %d for vcs device", VCS_MAJOR); | 501 | panic("unable to get major %d for vcs device", VCS_MAJOR); |
502 | vc_class = class_simple_create(THIS_MODULE, "vc"); | 502 | vc_class = class_create(THIS_MODULE, "vc"); |
503 | 503 | ||
504 | devfs_mk_cdev(MKDEV(VCS_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/0"); | 504 | devfs_mk_cdev(MKDEV(VCS_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/0"); |
505 | devfs_mk_cdev(MKDEV(VCS_MAJOR, 128), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/a0"); | 505 | devfs_mk_cdev(MKDEV(VCS_MAJOR, 128), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/a0"); |
506 | class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, 0), NULL, "vcs"); | 506 | class_device_create(vc_class, MKDEV(VCS_MAJOR, 0), NULL, "vcs"); |
507 | class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, 128), NULL, "vcsa"); | 507 | class_device_create(vc_class, MKDEV(VCS_MAJOR, 128), NULL, "vcsa"); |
508 | return 0; | 508 | return 0; |
509 | } | 509 | } |
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c index aea3cbf5219d..4764b4f9555d 100644 --- a/drivers/char/viotape.c +++ b/drivers/char/viotape.c | |||
@@ -237,7 +237,7 @@ static dma_addr_t viotape_unitinfo_token; | |||
237 | 237 | ||
238 | static struct mtget viomtget[VIOTAPE_MAX_TAPE]; | 238 | static struct mtget viomtget[VIOTAPE_MAX_TAPE]; |
239 | 239 | ||
240 | static struct class_simple *tape_class; | 240 | static struct class *tape_class; |
241 | 241 | ||
242 | static struct device *tape_device[VIOTAPE_MAX_TAPE]; | 242 | static struct device *tape_device[VIOTAPE_MAX_TAPE]; |
243 | 243 | ||
@@ -956,9 +956,9 @@ static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id) | |||
956 | state[i].cur_part = 0; | 956 | state[i].cur_part = 0; |
957 | for (j = 0; j < MAX_PARTITIONS; ++j) | 957 | for (j = 0; j < MAX_PARTITIONS; ++j) |
958 | state[i].part_stat_rwi[j] = VIOT_IDLE; | 958 | state[i].part_stat_rwi[j] = VIOT_IDLE; |
959 | class_simple_device_add(tape_class, MKDEV(VIOTAPE_MAJOR, i), NULL, | 959 | class_device_create(tape_class, MKDEV(VIOTAPE_MAJOR, i), NULL, |
960 | "iseries!vt%d", i); | 960 | "iseries!vt%d", i); |
961 | class_simple_device_add(tape_class, MKDEV(VIOTAPE_MAJOR, i | 0x80), | 961 | class_device_create(tape_class, MKDEV(VIOTAPE_MAJOR, i | 0x80), |
962 | NULL, "iseries!nvt%d", i); | 962 | NULL, "iseries!nvt%d", i); |
963 | devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i), S_IFCHR | S_IRUSR | S_IWUSR, | 963 | devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i), S_IFCHR | S_IRUSR | S_IWUSR, |
964 | "iseries/vt%d", i); | 964 | "iseries/vt%d", i); |
@@ -980,8 +980,8 @@ static int viotape_remove(struct vio_dev *vdev) | |||
980 | devfs_remove("iseries/nvt%d", i); | 980 | devfs_remove("iseries/nvt%d", i); |
981 | devfs_remove("iseries/vt%d", i); | 981 | devfs_remove("iseries/vt%d", i); |
982 | devfs_unregister_tape(state[i].dev_handle); | 982 | devfs_unregister_tape(state[i].dev_handle); |
983 | class_simple_device_remove(MKDEV(VIOTAPE_MAJOR, i | 0x80)); | 983 | class_device_destroy(tape_class, MKDEV(VIOTAPE_MAJOR, i | 0x80)); |
984 | class_simple_device_remove(MKDEV(VIOTAPE_MAJOR, i)); | 984 | class_device_destroy(tape_class, MKDEV(VIOTAPE_MAJOR, i)); |
985 | return 0; | 985 | return 0; |
986 | } | 986 | } |
987 | 987 | ||
@@ -1045,7 +1045,7 @@ int __init viotap_init(void) | |||
1045 | goto clear_handler; | 1045 | goto clear_handler; |
1046 | } | 1046 | } |
1047 | 1047 | ||
1048 | tape_class = class_simple_create(THIS_MODULE, "tape"); | 1048 | tape_class = class_create(THIS_MODULE, "tape"); |
1049 | if (IS_ERR(tape_class)) { | 1049 | if (IS_ERR(tape_class)) { |
1050 | printk(VIOTAPE_KERN_WARN "Unable to allocat class\n"); | 1050 | printk(VIOTAPE_KERN_WARN "Unable to allocat class\n"); |
1051 | ret = PTR_ERR(tape_class); | 1051 | ret = PTR_ERR(tape_class); |
@@ -1070,7 +1070,7 @@ int __init viotap_init(void) | |||
1070 | return 0; | 1070 | return 0; |
1071 | 1071 | ||
1072 | unreg_class: | 1072 | unreg_class: |
1073 | class_simple_destroy(tape_class); | 1073 | class_destroy(tape_class); |
1074 | unreg_chrdev: | 1074 | unreg_chrdev: |
1075 | unregister_chrdev(VIOTAPE_MAJOR, "viotape"); | 1075 | unregister_chrdev(VIOTAPE_MAJOR, "viotape"); |
1076 | clear_handler: | 1076 | clear_handler: |
@@ -1110,7 +1110,7 @@ static void __exit viotap_exit(void) | |||
1110 | 1110 | ||
1111 | remove_proc_entry("iSeries/viotape", NULL); | 1111 | remove_proc_entry("iSeries/viotape", NULL); |
1112 | vio_unregister_driver(&viotape_driver); | 1112 | vio_unregister_driver(&viotape_driver); |
1113 | class_simple_destroy(tape_class); | 1113 | class_destroy(tape_class); |
1114 | ret = unregister_chrdev(VIOTAPE_MAJOR, "viotape"); | 1114 | ret = unregister_chrdev(VIOTAPE_MAJOR, "viotape"); |
1115 | if (ret < 0) | 1115 | if (ret < 0) |
1116 | printk(VIOTAPE_KERN_WARN "Error unregistering device: %d\n", | 1116 | printk(VIOTAPE_KERN_WARN "Error unregistering device: %d\n", |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index e5ef1dfc5482..d7aa7a29f67e 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -2867,6 +2867,10 @@ void unblank_screen(void) | |||
2867 | */ | 2867 | */ |
2868 | static void blank_screen_t(unsigned long dummy) | 2868 | static void blank_screen_t(unsigned long dummy) |
2869 | { | 2869 | { |
2870 | if (unlikely(!keventd_up())) { | ||
2871 | mod_timer(&console_timer, jiffies + blankinterval); | ||
2872 | return; | ||
2873 | } | ||
2870 | blank_timer_expired = 1; | 2874 | blank_timer_expired = 1; |
2871 | schedule_work(&console_work); | 2875 | schedule_work(&console_work); |
2872 | } | 2876 | } |
diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c index ab659d37b4d2..4e98c215e5b1 100644 --- a/drivers/char/watchdog/ixp2000_wdt.c +++ b/drivers/char/watchdog/ixp2000_wdt.c | |||
@@ -192,7 +192,12 @@ static struct miscdevice ixp2000_wdt_miscdev = | |||
192 | 192 | ||
193 | static int __init ixp2000_wdt_init(void) | 193 | static int __init ixp2000_wdt_init(void) |
194 | { | 194 | { |
195 | wdt_tick_rate = (*IXP2000_T1_CLD * HZ)/ 256;; | 195 | if ((*IXP2000_PRODUCT_ID & 0x001ffef0) == 0x00000000) { |
196 | printk(KERN_INFO "Unable to use IXP2000 watchdog due to IXP2800 erratum #25.\n"); | ||
197 | return -EIO; | ||
198 | } | ||
199 | |||
200 | wdt_tick_rate = (*IXP2000_T1_CLD * HZ) / 256; | ||
196 | 201 | ||
197 | return misc_register(&ixp2000_wdt_miscdev); | 202 | return misc_register(&ixp2000_wdt_miscdev); |
198 | } | 203 | } |