diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-12 20:07:07 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-27 12:24:00 -0400 |
| commit | b60ba8343b78b182c03cf239d4342785376c1ad1 (patch) | |
| tree | 4285a89db0427674a51b76107321bfa95a63ddbd | |
| parent | e31dd6e4520439ceae4753f32dd2da2c345e929a (diff) | |
[PATCH] 64bit resource: change pnp core to use resource_size_t
Based on a patch series originally from Vivek Goyal <vgoyal@in.ibm.com>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| -rw-r--r-- | drivers/pnp/interface.c | 8 | ||||
| -rw-r--r-- | drivers/pnp/manager.c | 15 | ||||
| -rw-r--r-- | drivers/pnp/resource.c | 8 | ||||
| -rw-r--r-- | include/linux/pnp.h | 7 |
4 files changed, 23 insertions, 15 deletions
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c index a2d8ce7fef9c..3163e3d73da1 100644 --- a/drivers/pnp/interface.c +++ b/drivers/pnp/interface.c | |||
| @@ -264,7 +264,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at | |||
| 264 | if (pnp_port_flags(dev, i) & IORESOURCE_DISABLED) | 264 | if (pnp_port_flags(dev, i) & IORESOURCE_DISABLED) |
| 265 | pnp_printf(buffer," disabled\n"); | 265 | pnp_printf(buffer," disabled\n"); |
| 266 | else | 266 | else |
| 267 | pnp_printf(buffer," 0x%lx-0x%lx\n", | 267 | pnp_printf(buffer," 0x%llx-0x%llx\n", |
| 268 | pnp_port_start(dev, i), | 268 | pnp_port_start(dev, i), |
| 269 | pnp_port_end(dev, i)); | 269 | pnp_port_end(dev, i)); |
| 270 | } | 270 | } |
| @@ -275,7 +275,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at | |||
| 275 | if (pnp_mem_flags(dev, i) & IORESOURCE_DISABLED) | 275 | if (pnp_mem_flags(dev, i) & IORESOURCE_DISABLED) |
| 276 | pnp_printf(buffer," disabled\n"); | 276 | pnp_printf(buffer," disabled\n"); |
| 277 | else | 277 | else |
| 278 | pnp_printf(buffer," 0x%lx-0x%lx\n", | 278 | pnp_printf(buffer," 0x%llx-0x%llx\n", |
| 279 | pnp_mem_start(dev, i), | 279 | pnp_mem_start(dev, i), |
| 280 | pnp_mem_end(dev, i)); | 280 | pnp_mem_end(dev, i)); |
| 281 | } | 281 | } |
| @@ -286,7 +286,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at | |||
| 286 | if (pnp_irq_flags(dev, i) & IORESOURCE_DISABLED) | 286 | if (pnp_irq_flags(dev, i) & IORESOURCE_DISABLED) |
| 287 | pnp_printf(buffer," disabled\n"); | 287 | pnp_printf(buffer," disabled\n"); |
| 288 | else | 288 | else |
| 289 | pnp_printf(buffer," %ld\n", | 289 | pnp_printf(buffer," %lld\n", |
| 290 | pnp_irq(dev, i)); | 290 | pnp_irq(dev, i)); |
| 291 | } | 291 | } |
| 292 | } | 292 | } |
| @@ -296,7 +296,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at | |||
| 296 | if (pnp_dma_flags(dev, i) & IORESOURCE_DISABLED) | 296 | if (pnp_dma_flags(dev, i) & IORESOURCE_DISABLED) |
| 297 | pnp_printf(buffer," disabled\n"); | 297 | pnp_printf(buffer," disabled\n"); |
| 298 | else | 298 | else |
| 299 | pnp_printf(buffer," %ld\n", | 299 | pnp_printf(buffer," %lld\n", |
| 300 | pnp_dma(dev, i)); | 300 | pnp_dma(dev, i)); |
| 301 | } | 301 | } |
| 302 | } | 302 | } |
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c index 6fff109bdab6..1d7a5b87f4cb 100644 --- a/drivers/pnp/manager.c +++ b/drivers/pnp/manager.c | |||
| @@ -20,7 +20,8 @@ DECLARE_MUTEX(pnp_res_mutex); | |||
| 20 | 20 | ||
| 21 | static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) | 21 | static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) |
| 22 | { | 22 | { |
| 23 | unsigned long *start, *end, *flags; | 23 | resource_size_t *start, *end; |
| 24 | unsigned long *flags; | ||
| 24 | 25 | ||
| 25 | if (!dev || !rule) | 26 | if (!dev || !rule) |
| 26 | return -EINVAL; | 27 | return -EINVAL; |
| @@ -63,7 +64,8 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) | |||
| 63 | 64 | ||
| 64 | static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx) | 65 | static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx) |
| 65 | { | 66 | { |
| 66 | unsigned long *start, *end, *flags; | 67 | resource_size_t *start, *end; |
| 68 | unsigned long *flags; | ||
| 67 | 69 | ||
| 68 | if (!dev || !rule) | 70 | if (!dev || !rule) |
| 69 | return -EINVAL; | 71 | return -EINVAL; |
| @@ -116,7 +118,8 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx) | |||
| 116 | 118 | ||
| 117 | static int pnp_assign_irq(struct pnp_dev * dev, struct pnp_irq *rule, int idx) | 119 | static int pnp_assign_irq(struct pnp_dev * dev, struct pnp_irq *rule, int idx) |
| 118 | { | 120 | { |
| 119 | unsigned long *start, *end, *flags; | 121 | resource_size_t *start, *end; |
| 122 | unsigned long *flags; | ||
| 120 | int i; | 123 | int i; |
| 121 | 124 | ||
| 122 | /* IRQ priority: this table is good for i386 */ | 125 | /* IRQ priority: this table is good for i386 */ |
| @@ -168,7 +171,8 @@ static int pnp_assign_irq(struct pnp_dev * dev, struct pnp_irq *rule, int idx) | |||
| 168 | 171 | ||
| 169 | static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx) | 172 | static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx) |
| 170 | { | 173 | { |
| 171 | unsigned long *start, *end, *flags; | 174 | resource_size_t *start, *end; |
| 175 | unsigned long *flags; | ||
| 172 | int i; | 176 | int i; |
| 173 | 177 | ||
| 174 | /* DMA priority: this table is good for i386 */ | 178 | /* DMA priority: this table is good for i386 */ |
| @@ -582,7 +586,8 @@ int pnp_disable_dev(struct pnp_dev *dev) | |||
| 582 | * @size: size of region | 586 | * @size: size of region |
| 583 | * | 587 | * |
| 584 | */ | 588 | */ |
| 585 | void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) | 589 | void pnp_resource_change(struct resource *resource, resource_size_t start, |
| 590 | resource_size_t size) | ||
| 586 | { | 591 | { |
| 587 | if (resource == NULL) | 592 | if (resource == NULL) |
| 588 | return; | 593 | return; |
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 6ded527169f4..7bb892f58cc0 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c | |||
| @@ -241,7 +241,7 @@ int pnp_check_port(struct pnp_dev * dev, int idx) | |||
| 241 | { | 241 | { |
| 242 | int tmp; | 242 | int tmp; |
| 243 | struct pnp_dev *tdev; | 243 | struct pnp_dev *tdev; |
| 244 | unsigned long *port, *end, *tport, *tend; | 244 | resource_size_t *port, *end, *tport, *tend; |
| 245 | port = &dev->res.port_resource[idx].start; | 245 | port = &dev->res.port_resource[idx].start; |
| 246 | end = &dev->res.port_resource[idx].end; | 246 | end = &dev->res.port_resource[idx].end; |
| 247 | 247 | ||
| @@ -297,7 +297,7 @@ int pnp_check_mem(struct pnp_dev * dev, int idx) | |||
| 297 | { | 297 | { |
| 298 | int tmp; | 298 | int tmp; |
| 299 | struct pnp_dev *tdev; | 299 | struct pnp_dev *tdev; |
| 300 | unsigned long *addr, *end, *taddr, *tend; | 300 | resource_size_t *addr, *end, *taddr, *tend; |
| 301 | addr = &dev->res.mem_resource[idx].start; | 301 | addr = &dev->res.mem_resource[idx].start; |
| 302 | end = &dev->res.mem_resource[idx].end; | 302 | end = &dev->res.mem_resource[idx].end; |
| 303 | 303 | ||
| @@ -358,7 +358,7 @@ int pnp_check_irq(struct pnp_dev * dev, int idx) | |||
| 358 | { | 358 | { |
| 359 | int tmp; | 359 | int tmp; |
| 360 | struct pnp_dev *tdev; | 360 | struct pnp_dev *tdev; |
| 361 | unsigned long * irq = &dev->res.irq_resource[idx].start; | 361 | resource_size_t * irq = &dev->res.irq_resource[idx].start; |
| 362 | 362 | ||
| 363 | /* if the resource doesn't exist, don't complain about it */ | 363 | /* if the resource doesn't exist, don't complain about it */ |
| 364 | if (cannot_compare(dev->res.irq_resource[idx].flags)) | 364 | if (cannot_compare(dev->res.irq_resource[idx].flags)) |
| @@ -423,7 +423,7 @@ int pnp_check_dma(struct pnp_dev * dev, int idx) | |||
| 423 | #ifndef CONFIG_IA64 | 423 | #ifndef CONFIG_IA64 |
| 424 | int tmp; | 424 | int tmp; |
| 425 | struct pnp_dev *tdev; | 425 | struct pnp_dev *tdev; |
| 426 | unsigned long * dma = &dev->res.dma_resource[idx].start; | 426 | resource_size_t * dma = &dev->res.dma_resource[idx].start; |
| 427 | 427 | ||
| 428 | /* if the resource doesn't exist, don't complain about it */ | 428 | /* if the resource doesn't exist, don't complain about it */ |
| 429 | if (cannot_compare(dev->res.dma_resource[idx].flags)) | 429 | if (cannot_compare(dev->res.dma_resource[idx].flags)) |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 93b0959eb40f..ab8a8dd8d64c 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
| @@ -389,7 +389,8 @@ int pnp_start_dev(struct pnp_dev *dev); | |||
| 389 | int pnp_stop_dev(struct pnp_dev *dev); | 389 | int pnp_stop_dev(struct pnp_dev *dev); |
| 390 | int pnp_activate_dev(struct pnp_dev *dev); | 390 | int pnp_activate_dev(struct pnp_dev *dev); |
| 391 | int pnp_disable_dev(struct pnp_dev *dev); | 391 | int pnp_disable_dev(struct pnp_dev *dev); |
| 392 | void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size); | 392 | void pnp_resource_change(struct resource *resource, resource_size_t start, |
| 393 | resource_size_t size); | ||
| 393 | 394 | ||
| 394 | /* protocol helpers */ | 395 | /* protocol helpers */ |
| 395 | int pnp_is_active(struct pnp_dev * dev); | 396 | int pnp_is_active(struct pnp_dev * dev); |
| @@ -434,7 +435,9 @@ static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; } | |||
| 434 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } | 435 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } |
| 435 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } | 436 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } |
| 436 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } | 437 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } |
| 437 | static inline void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) { } | 438 | static inline void pnp_resource_change(struct resource *resource, |
| 439 | resource_size_t start, | ||
| 440 | resource_size_t size) { } | ||
| 438 | 441 | ||
| 439 | /* protocol helpers */ | 442 | /* protocol helpers */ |
| 440 | static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } | 443 | static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } |
