mirror of https://gitee.com/openkylin/linux.git
[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>
This commit is contained in:
parent
e31dd6e452
commit
b60ba8343b
|
@ -264,7 +264,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
|
|||
if (pnp_port_flags(dev, i) & IORESOURCE_DISABLED)
|
||||
pnp_printf(buffer," disabled\n");
|
||||
else
|
||||
pnp_printf(buffer," 0x%lx-0x%lx\n",
|
||||
pnp_printf(buffer," 0x%llx-0x%llx\n",
|
||||
pnp_port_start(dev, i),
|
||||
pnp_port_end(dev, i));
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
|
|||
if (pnp_mem_flags(dev, i) & IORESOURCE_DISABLED)
|
||||
pnp_printf(buffer," disabled\n");
|
||||
else
|
||||
pnp_printf(buffer," 0x%lx-0x%lx\n",
|
||||
pnp_printf(buffer," 0x%llx-0x%llx\n",
|
||||
pnp_mem_start(dev, i),
|
||||
pnp_mem_end(dev, i));
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
|
|||
if (pnp_irq_flags(dev, i) & IORESOURCE_DISABLED)
|
||||
pnp_printf(buffer," disabled\n");
|
||||
else
|
||||
pnp_printf(buffer," %ld\n",
|
||||
pnp_printf(buffer," %lld\n",
|
||||
pnp_irq(dev, i));
|
||||
}
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
|
|||
if (pnp_dma_flags(dev, i) & IORESOURCE_DISABLED)
|
||||
pnp_printf(buffer," disabled\n");
|
||||
else
|
||||
pnp_printf(buffer," %ld\n",
|
||||
pnp_printf(buffer," %lld\n",
|
||||
pnp_dma(dev, i));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,8 @@ DECLARE_MUTEX(pnp_res_mutex);
|
|||
|
||||
static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
|
||||
{
|
||||
unsigned long *start, *end, *flags;
|
||||
resource_size_t *start, *end;
|
||||
unsigned long *flags;
|
||||
|
||||
if (!dev || !rule)
|
||||
return -EINVAL;
|
||||
|
@ -63,7 +64,8 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
|
|||
|
||||
static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
|
||||
{
|
||||
unsigned long *start, *end, *flags;
|
||||
resource_size_t *start, *end;
|
||||
unsigned long *flags;
|
||||
|
||||
if (!dev || !rule)
|
||||
return -EINVAL;
|
||||
|
@ -116,7 +118,8 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
|
|||
|
||||
static int pnp_assign_irq(struct pnp_dev * dev, struct pnp_irq *rule, int idx)
|
||||
{
|
||||
unsigned long *start, *end, *flags;
|
||||
resource_size_t *start, *end;
|
||||
unsigned long *flags;
|
||||
int i;
|
||||
|
||||
/* 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)
|
|||
|
||||
static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
|
||||
{
|
||||
unsigned long *start, *end, *flags;
|
||||
resource_size_t *start, *end;
|
||||
unsigned long *flags;
|
||||
int i;
|
||||
|
||||
/* DMA priority: this table is good for i386 */
|
||||
|
@ -582,7 +586,8 @@ int pnp_disable_dev(struct pnp_dev *dev)
|
|||
* @size: size of region
|
||||
*
|
||||
*/
|
||||
void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size)
|
||||
void pnp_resource_change(struct resource *resource, resource_size_t start,
|
||||
resource_size_t size)
|
||||
{
|
||||
if (resource == NULL)
|
||||
return;
|
||||
|
|
|
@ -241,7 +241,7 @@ int pnp_check_port(struct pnp_dev * dev, int idx)
|
|||
{
|
||||
int tmp;
|
||||
struct pnp_dev *tdev;
|
||||
unsigned long *port, *end, *tport, *tend;
|
||||
resource_size_t *port, *end, *tport, *tend;
|
||||
port = &dev->res.port_resource[idx].start;
|
||||
end = &dev->res.port_resource[idx].end;
|
||||
|
||||
|
@ -297,7 +297,7 @@ int pnp_check_mem(struct pnp_dev * dev, int idx)
|
|||
{
|
||||
int tmp;
|
||||
struct pnp_dev *tdev;
|
||||
unsigned long *addr, *end, *taddr, *tend;
|
||||
resource_size_t *addr, *end, *taddr, *tend;
|
||||
addr = &dev->res.mem_resource[idx].start;
|
||||
end = &dev->res.mem_resource[idx].end;
|
||||
|
||||
|
@ -358,7 +358,7 @@ int pnp_check_irq(struct pnp_dev * dev, int idx)
|
|||
{
|
||||
int tmp;
|
||||
struct pnp_dev *tdev;
|
||||
unsigned long * irq = &dev->res.irq_resource[idx].start;
|
||||
resource_size_t * irq = &dev->res.irq_resource[idx].start;
|
||||
|
||||
/* if the resource doesn't exist, don't complain about it */
|
||||
if (cannot_compare(dev->res.irq_resource[idx].flags))
|
||||
|
@ -423,7 +423,7 @@ int pnp_check_dma(struct pnp_dev * dev, int idx)
|
|||
#ifndef CONFIG_IA64
|
||||
int tmp;
|
||||
struct pnp_dev *tdev;
|
||||
unsigned long * dma = &dev->res.dma_resource[idx].start;
|
||||
resource_size_t * dma = &dev->res.dma_resource[idx].start;
|
||||
|
||||
/* if the resource doesn't exist, don't complain about it */
|
||||
if (cannot_compare(dev->res.dma_resource[idx].flags))
|
||||
|
|
|
@ -389,7 +389,8 @@ int pnp_start_dev(struct pnp_dev *dev);
|
|||
int pnp_stop_dev(struct pnp_dev *dev);
|
||||
int pnp_activate_dev(struct pnp_dev *dev);
|
||||
int pnp_disable_dev(struct pnp_dev *dev);
|
||||
void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size);
|
||||
void pnp_resource_change(struct resource *resource, resource_size_t start,
|
||||
resource_size_t size);
|
||||
|
||||
/* protocol helpers */
|
||||
int pnp_is_active(struct pnp_dev * dev);
|
||||
|
@ -434,7 +435,9 @@ static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
|
|||
static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
|
||||
static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
|
||||
static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
|
||||
static inline void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) { }
|
||||
static inline void pnp_resource_change(struct resource *resource,
|
||||
resource_size_t start,
|
||||
resource_size_t size) { }
|
||||
|
||||
/* protocol helpers */
|
||||
static inline int pnp_is_active(struct pnp_dev * dev) { return 0; }
|
||||
|
|
Loading…
Reference in New Issue