提交 2bb9a6b3 编写于 作者: T Thomas Renninger 提交者: Linus Torvalds

pnp: declare PNP option parsing functions as __init

There are three kind of parse functions provided by PNP acpi/bios:
 - get current resources
 - set resources
 - get possible resources
The first two may be needed later at runtime.
The possible resource settings should never change dynamically.
And even if this would make any sense (I doubt it), the current implementation
only parses possible resource settings at early init time:
  -> declare all the option parsing __init

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: NThomas Renninger <trenn@suse.de>
Acked-By: NRene Herman <rene.herman@gmail.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 cc8259a6
...@@ -391,8 +391,8 @@ acpi_status pnpacpi_parse_allocated_resource(acpi_handle handle, ...@@ -391,8 +391,8 @@ acpi_status pnpacpi_parse_allocated_resource(acpi_handle handle,
pnpacpi_allocated_resource, res); pnpacpi_allocated_resource, res);
} }
static void pnpacpi_parse_dma_option(struct pnp_option *option, static __init void pnpacpi_parse_dma_option(struct pnp_option *option,
struct acpi_resource_dma *p) struct acpi_resource_dma *p)
{ {
int i; int i;
struct pnp_dma *dma; struct pnp_dma *dma;
...@@ -411,8 +411,8 @@ static void pnpacpi_parse_dma_option(struct pnp_option *option, ...@@ -411,8 +411,8 @@ static void pnpacpi_parse_dma_option(struct pnp_option *option,
pnp_register_dma_resource(option, dma); pnp_register_dma_resource(option, dma);
} }
static void pnpacpi_parse_irq_option(struct pnp_option *option, static __init void pnpacpi_parse_irq_option(struct pnp_option *option,
struct acpi_resource_irq *p) struct acpi_resource_irq *p)
{ {
int i; int i;
struct pnp_irq *irq; struct pnp_irq *irq;
...@@ -431,8 +431,8 @@ static void pnpacpi_parse_irq_option(struct pnp_option *option, ...@@ -431,8 +431,8 @@ static void pnpacpi_parse_irq_option(struct pnp_option *option,
pnp_register_irq_resource(option, irq); pnp_register_irq_resource(option, irq);
} }
static void pnpacpi_parse_ext_irq_option(struct pnp_option *option, static __init void pnpacpi_parse_ext_irq_option(struct pnp_option *option,
struct acpi_resource_extended_irq *p) struct acpi_resource_extended_irq *p)
{ {
int i; int i;
struct pnp_irq *irq; struct pnp_irq *irq;
...@@ -451,8 +451,8 @@ static void pnpacpi_parse_ext_irq_option(struct pnp_option *option, ...@@ -451,8 +451,8 @@ static void pnpacpi_parse_ext_irq_option(struct pnp_option *option,
pnp_register_irq_resource(option, irq); pnp_register_irq_resource(option, irq);
} }
static void pnpacpi_parse_port_option(struct pnp_option *option, static __init void pnpacpi_parse_port_option(struct pnp_option *option,
struct acpi_resource_io *io) struct acpi_resource_io *io)
{ {
struct pnp_port *port; struct pnp_port *port;
...@@ -470,8 +470,8 @@ static void pnpacpi_parse_port_option(struct pnp_option *option, ...@@ -470,8 +470,8 @@ static void pnpacpi_parse_port_option(struct pnp_option *option,
pnp_register_port_resource(option, port); pnp_register_port_resource(option, port);
} }
static void pnpacpi_parse_fixed_port_option(struct pnp_option *option, static __init void pnpacpi_parse_fixed_port_option(struct pnp_option *option,
struct acpi_resource_fixed_io *io) struct acpi_resource_fixed_io *io)
{ {
struct pnp_port *port; struct pnp_port *port;
...@@ -487,8 +487,8 @@ static void pnpacpi_parse_fixed_port_option(struct pnp_option *option, ...@@ -487,8 +487,8 @@ static void pnpacpi_parse_fixed_port_option(struct pnp_option *option,
pnp_register_port_resource(option, port); pnp_register_port_resource(option, port);
} }
static void pnpacpi_parse_mem24_option(struct pnp_option *option, static __init void pnpacpi_parse_mem24_option(struct pnp_option *option,
struct acpi_resource_memory24 *p) struct acpi_resource_memory24 *p)
{ {
struct pnp_mem *mem; struct pnp_mem *mem;
...@@ -508,8 +508,8 @@ static void pnpacpi_parse_mem24_option(struct pnp_option *option, ...@@ -508,8 +508,8 @@ static void pnpacpi_parse_mem24_option(struct pnp_option *option,
pnp_register_mem_resource(option, mem); pnp_register_mem_resource(option, mem);
} }
static void pnpacpi_parse_mem32_option(struct pnp_option *option, static __init void pnpacpi_parse_mem32_option(struct pnp_option *option,
struct acpi_resource_memory32 *p) struct acpi_resource_memory32 *p)
{ {
struct pnp_mem *mem; struct pnp_mem *mem;
...@@ -529,8 +529,8 @@ static void pnpacpi_parse_mem32_option(struct pnp_option *option, ...@@ -529,8 +529,8 @@ static void pnpacpi_parse_mem32_option(struct pnp_option *option,
pnp_register_mem_resource(option, mem); pnp_register_mem_resource(option, mem);
} }
static void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option, static __init void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
struct acpi_resource_fixed_memory32 *p) struct acpi_resource_fixed_memory32 *p)
{ {
struct pnp_mem *mem; struct pnp_mem *mem;
...@@ -549,8 +549,8 @@ static void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option, ...@@ -549,8 +549,8 @@ static void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
pnp_register_mem_resource(option, mem); pnp_register_mem_resource(option, mem);
} }
static void pnpacpi_parse_address_option(struct pnp_option *option, static __init void pnpacpi_parse_address_option(struct pnp_option *option,
struct acpi_resource *r) struct acpi_resource *r)
{ {
struct acpi_resource_address64 addr, *p = &addr; struct acpi_resource_address64 addr, *p = &addr;
acpi_status status; acpi_status status;
...@@ -596,8 +596,8 @@ struct acpipnp_parse_option_s { ...@@ -596,8 +596,8 @@ struct acpipnp_parse_option_s {
struct pnp_dev *dev; struct pnp_dev *dev;
}; };
static acpi_status pnpacpi_option_resource(struct acpi_resource *res, static __init acpi_status pnpacpi_option_resource(struct acpi_resource *res,
void *data) void *data)
{ {
int priority = 0; int priority = 0;
struct acpipnp_parse_option_s *parse_data = data; struct acpipnp_parse_option_s *parse_data = data;
...@@ -696,8 +696,8 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res, ...@@ -696,8 +696,8 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
return AE_OK; return AE_OK;
} }
acpi_status pnpacpi_parse_resource_option_data(acpi_handle handle, acpi_status __init pnpacpi_parse_resource_option_data(acpi_handle handle,
struct pnp_dev * dev) struct pnp_dev *dev)
{ {
acpi_status status; acpi_status status;
struct acpipnp_parse_option_s parse_data; struct acpipnp_parse_option_s parse_data;
......
...@@ -315,7 +315,7 @@ struct pnp_protocol pnpbios_protocol = { ...@@ -315,7 +315,7 @@ struct pnp_protocol pnpbios_protocol = {
.disable = pnpbios_disable_resources, .disable = pnpbios_disable_resources,
}; };
static int insert_device(struct pnp_bios_node *node) static int __init insert_device(struct pnp_bios_node *node)
{ {
struct list_head *pos; struct list_head *pos;
struct pnp_dev *dev; struct pnp_dev *dev;
......
...@@ -262,8 +262,8 @@ static unsigned char *pnpbios_parse_allocated_resource_data(unsigned char *p, ...@@ -262,8 +262,8 @@ static unsigned char *pnpbios_parse_allocated_resource_data(unsigned char *p,
* Resource Configuration Options * Resource Configuration Options
*/ */
static void pnpbios_parse_mem_option(unsigned char *p, int size, static __init void pnpbios_parse_mem_option(unsigned char *p, int size,
struct pnp_option *option) struct pnp_option *option)
{ {
struct pnp_mem *mem; struct pnp_mem *mem;
...@@ -278,8 +278,8 @@ static void pnpbios_parse_mem_option(unsigned char *p, int size, ...@@ -278,8 +278,8 @@ static void pnpbios_parse_mem_option(unsigned char *p, int size,
pnp_register_mem_resource(option, mem); pnp_register_mem_resource(option, mem);
} }
static void pnpbios_parse_mem32_option(unsigned char *p, int size, static __init void pnpbios_parse_mem32_option(unsigned char *p, int size,
struct pnp_option *option) struct pnp_option *option)
{ {
struct pnp_mem *mem; struct pnp_mem *mem;
...@@ -294,8 +294,8 @@ static void pnpbios_parse_mem32_option(unsigned char *p, int size, ...@@ -294,8 +294,8 @@ static void pnpbios_parse_mem32_option(unsigned char *p, int size,
pnp_register_mem_resource(option, mem); pnp_register_mem_resource(option, mem);
} }
static void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, static __init void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size,
struct pnp_option *option) struct pnp_option *option)
{ {
struct pnp_mem *mem; struct pnp_mem *mem;
...@@ -309,7 +309,7 @@ static void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, ...@@ -309,7 +309,7 @@ static void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size,
pnp_register_mem_resource(option, mem); pnp_register_mem_resource(option, mem);
} }
static void pnpbios_parse_irq_option(unsigned char *p, int size, static __init void pnpbios_parse_irq_option(unsigned char *p, int size,
struct pnp_option *option) struct pnp_option *option)
{ {
struct pnp_irq *irq; struct pnp_irq *irq;
...@@ -327,7 +327,7 @@ static void pnpbios_parse_irq_option(unsigned char *p, int size, ...@@ -327,7 +327,7 @@ static void pnpbios_parse_irq_option(unsigned char *p, int size,
pnp_register_irq_resource(option, irq); pnp_register_irq_resource(option, irq);
} }
static void pnpbios_parse_dma_option(unsigned char *p, int size, static __init void pnpbios_parse_dma_option(unsigned char *p, int size,
struct pnp_option *option) struct pnp_option *option)
{ {
struct pnp_dma *dma; struct pnp_dma *dma;
...@@ -340,8 +340,8 @@ static void pnpbios_parse_dma_option(unsigned char *p, int size, ...@@ -340,8 +340,8 @@ static void pnpbios_parse_dma_option(unsigned char *p, int size,
pnp_register_dma_resource(option, dma); pnp_register_dma_resource(option, dma);
} }
static void pnpbios_parse_port_option(unsigned char *p, int size, static __init void pnpbios_parse_port_option(unsigned char *p, int size,
struct pnp_option *option) struct pnp_option *option)
{ {
struct pnp_port *port; struct pnp_port *port;
...@@ -356,8 +356,8 @@ static void pnpbios_parse_port_option(unsigned char *p, int size, ...@@ -356,8 +356,8 @@ static void pnpbios_parse_port_option(unsigned char *p, int size,
pnp_register_port_resource(option, port); pnp_register_port_resource(option, port);
} }
static void pnpbios_parse_fixed_port_option(unsigned char *p, int size, static __init void pnpbios_parse_fixed_port_option(unsigned char *p, int size,
struct pnp_option *option) struct pnp_option *option)
{ {
struct pnp_port *port; struct pnp_port *port;
...@@ -371,9 +371,9 @@ static void pnpbios_parse_fixed_port_option(unsigned char *p, int size, ...@@ -371,9 +371,9 @@ static void pnpbios_parse_fixed_port_option(unsigned char *p, int size,
pnp_register_port_resource(option, port); pnp_register_port_resource(option, port);
} }
static unsigned char *pnpbios_parse_resource_option_data(unsigned char *p, static __init unsigned char *
unsigned char *end, pnpbios_parse_resource_option_data(unsigned char *p, unsigned char *end,
struct pnp_dev *dev) struct pnp_dev *dev)
{ {
unsigned int len, tag; unsigned int len, tag;
int priority = 0; int priority = 0;
...@@ -781,7 +781,8 @@ static unsigned char *pnpbios_encode_allocated_resource_data(unsigned char *p, ...@@ -781,7 +781,8 @@ static unsigned char *pnpbios_encode_allocated_resource_data(unsigned char *p,
* Core Parsing Functions * Core Parsing Functions
*/ */
int pnpbios_parse_data_stream(struct pnp_dev *dev, struct pnp_bios_node *node) int __init pnpbios_parse_data_stream(struct pnp_dev *dev,
struct pnp_bios_node *node)
{ {
unsigned char *p = (char *)node->data; unsigned char *p = (char *)node->data;
unsigned char *end = (char *)(node->data + node->size); unsigned char *end = (char *)(node->data + node->size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册