From: yakui.zhao@intel.com
To: openipmi-developer@lists.sourceforge.net, linux-acpi@vger.kernel.org
Cc: minyard@acm.org, lenb@kernel.org, Zhao Yakui <yakui.zhao@intel.com>
Subject: [RFC PATCH 2/4] IPMI: Remove the redundant definition of ipmi_addr_src
Date: Fri, 22 Oct 2010 17:10:39 +0800 [thread overview]
Message-ID: <1287738641-11490-3-git-send-email-yakui.zhao@intel.com> (raw)
In-Reply-To: <1287738641-11490-2-git-send-email-yakui.zhao@intel.com>
From: Zhao Yakui <yakui.zhao@intel.com>
The ipmi_addr_src is defined twice. One is in ipmi_smi_info and the other
is in generic smi_info. Remove the redunant definition in smi_info.
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
---
drivers/char/ipmi/ipmi_si_intf.c | 37 +++++++++++++++++--------------------
1 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 73b1c82..44f6b9e 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -193,7 +193,6 @@ struct smi_info {
int (*irq_setup)(struct smi_info *info);
void (*irq_cleanup)(struct smi_info *info);
unsigned int io_size;
- enum ipmi_addr_src addr_source; /* ACPI, PCI, SMBIOS, hardcode, etc. */
void (*addr_source_cleanup)(struct smi_info *info);
void *addr_source_data;
@@ -1191,11 +1190,9 @@ static int get_smi_info(void *send_info,
struct smi_info *new_smi = send_info;
struct ipmi_smi_info *smi_data = &new_smi->smi_data;
- if (new_smi->addr_source != type)
+ if (smi_data->addr_src != type)
return -EINVAL;
- smi_data->addr_src = type;
-
*data = smi_data;
return 0;
}
@@ -1800,7 +1797,7 @@ static int hotmod_handler(const char *val, struct kernel_param *kp)
goto out;
}
- info->addr_source = SI_HOTMOD;
+ info->smi_data.addr_src = SI_HOTMOD;
info->si_type = si_type;
info->io.addr_data = addr;
info->io.addr_type = addr_space;
@@ -1863,7 +1860,7 @@ static __devinit void hardcode_find_bmc(void)
if (!info)
return;
- info->addr_source = SI_HARDCODED;
+ info->smi_data.addr_src = SI_HARDCODED;
printk(KERN_INFO PFX "probing via hardcoded address\n");
if (!si_type[i] || strcmp(si_type[i], "kcs") == 0) {
@@ -2049,7 +2046,7 @@ static __devinit int try_init_spmi(struct SPMITable *spmi)
return -ENOMEM;
}
- info->addr_source = SI_SPMI;
+ info->smi_data.addr_src = SI_SPMI;
printk(KERN_INFO PFX "probing via SPMI\n");
/* Figure out the interface type. */
@@ -2157,7 +2154,7 @@ static int __devinit ipmi_pnp_probe(struct pnp_dev *dev,
if (!info)
return -ENOMEM;
- info->addr_source = SI_ACPI;
+ info->smi_data.addr_src = SI_ACPI;
info->smi_data.smi_info.acpi_info.acpi_handle =
acpi_dev->handle;
printk(KERN_INFO PFX "probing via ACPI\n");
@@ -2342,7 +2339,7 @@ static __devinit void try_init_dmi(struct dmi_ipmi_data *ipmi_data)
return;
}
- info->addr_source = SI_SMBIOS;
+ info->smi_data.addr_src = SI_SMBIOS;
printk(KERN_INFO PFX "probing via SMBIOS\n");
switch (ipmi_data->type) {
@@ -2447,7 +2444,7 @@ static int __devinit ipmi_pci_probe(struct pci_dev *pdev,
if (!info)
return -ENOMEM;
- info->addr_source = SI_PCI;
+ info->smi_data.addr_src = SI_PCI;
dev_info(&pdev->dev, "probing via PCI");
switch (class_type) {
@@ -2593,7 +2590,7 @@ static int __devinit ipmi_of_probe(struct platform_device *dev,
}
info->si_type = (enum si_type) match->data;
- info->addr_source = SI_DEVICETREE;
+ info->smi_data.addr_src = SI_DEVICETREE;
info->irq_setup = std_irq_setup;
if (resource.flags & IORESOURCE_IO) {
@@ -3035,7 +3032,7 @@ static __devinit void default_find_bmc(void)
if (!info)
return;
- info->addr_source = SI_DEFAULT;
+ info->smi_data.addr_src = SI_DEFAULT;
info->si_type = ipmi_defaults[i].type;
info->io_setup = port_setup;
@@ -3082,7 +3079,7 @@ static int add_smi(struct smi_info *new_smi)
int rv = 0;
printk(KERN_INFO PFX "Adding %s-specified %s state machine",
- ipmi_addr_src_to_str[new_smi->addr_source],
+ ipmi_addr_src_to_str[new_smi->smi_data.addr_src],
si_to_str[new_smi->si_type]);
mutex_lock(&smi_infos_lock);
if (!is_new_interface(new_smi)) {
@@ -3114,7 +3111,7 @@ static int try_smi_init(struct smi_info *new_smi)
printk(KERN_INFO PFX "Trying %s-specified %s state"
" machine at %s address 0x%lx, slave address 0x%x,"
" irq %d\n",
- ipmi_addr_src_to_str[new_smi->addr_source],
+ ipmi_addr_src_to_str[new_smi->smi_data.addr_src],
si_to_str[new_smi->si_type],
addr_space_to_str[new_smi->io.addr_type],
new_smi->io.addr_data,
@@ -3162,7 +3159,7 @@ static int try_smi_init(struct smi_info *new_smi)
/* Do low-level detection first. */
if (new_smi->handlers->detect(new_smi->si_sm)) {
- if (new_smi->addr_source)
+ if (new_smi->smi_data.addr_src)
printk(KERN_INFO PFX "Interface detection failed\n");
rv = -ENODEV;
goto out_err;
@@ -3174,7 +3171,7 @@ static int try_smi_init(struct smi_info *new_smi)
*/
rv = try_get_dev_id(new_smi);
if (rv) {
- if (new_smi->addr_source)
+ if (new_smi->smi_data.addr_src)
printk(KERN_INFO PFX "There appears to be no BMC"
" at this location\n");
goto out_err;
@@ -3408,9 +3405,9 @@ static __devinit int init_ipmi_si(void)
/* Try to register a device if it has an IRQ and we either
haven't successfully registered a device yet or this
device has the same type as one we successfully registered */
- if (e->irq && (!type || e->addr_source == type)) {
+ if (e->irq && (!type || e->smi_data.addr_src == type)) {
if (!try_smi_init(e)) {
- type = e->addr_source;
+ type = e->smi_data.addr_src;
}
}
}
@@ -3424,9 +3421,9 @@ static __devinit int init_ipmi_si(void)
/* Fall back to the preferred device */
list_for_each_entry(e, &smi_infos, link) {
- if (!e->irq && (!type || e->addr_source == type)) {
+ if (!e->irq && (!type || e->smi_data.addr_src == type)) {
if (!try_smi_init(e)) {
- type = e->addr_source;
+ type = e->smi_data.addr_src;
}
}
}
--
1.5.4.5
next prev parent reply other threads:[~2010-10-22 9:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-22 9:10 [RFC PATCH 0/4_v11] IPMI/ACPI: Install the ACPI IPMI opregion yakui.zhao
2010-10-22 9:10 ` [RFC PATCH 1/4] IPMI: Add one interface to get more info of low-level IPMI device yakui.zhao
2010-10-22 9:10 ` yakui.zhao [this message]
2010-10-22 9:10 ` [RFC PATCH 3/4] IPMI: Add the document description of ipmi_get_smi_info yakui.zhao
2010-10-22 9:10 ` [RFC PATCH 04/4] IPMI/ACPI: Add the IPMI opregion driver to enable ACPI to access BMC controller yakui.zhao
2010-10-25 1:19 ` [RFC PATCH 1/4] IPMI: Add one interface to get more info of low-level IPMI device ykzhao
2010-10-25 3:25 ` Corey Minyard
2010-10-25 7:00 ` ykzhao
-- strict thread matches above, loose matches on Subject: below --
2010-11-30 0:26 [RFC PATCH 0/4_v13] IPMI/ACPI: Install the ACPI IPMI opregion yakui.zhao
2010-11-30 0:26 ` [RFC PATCH 1/4] IPMI: Add one interface to get more info of low-level IPMI device yakui.zhao
2010-11-30 0:26 ` [RFC PATCH 2/4] IPMI: Remove the redundant definition of ipmi_addr_src yakui.zhao
2010-10-26 9:14 [RFC PATCH 0/4_v11] IPMI/ACPI: Install the ACPI IPMI opregion yakui.zhao
2010-10-26 9:14 ` [RFC PATCH 1/4] IPMI: Add one interface to get more info of low-level IPMI device yakui.zhao
2010-10-26 9:14 ` [RFC PATCH 2/4] IPMI: Remove the redundant definition of ipmi_addr_src yakui.zhao
2010-10-12 7:47 [RFC PATCH 0/4_v10] IPMI/ACPI: Install the ACPI IPMI opregion yakui.zhao
2010-10-12 7:47 ` [RFC PATCH 1/4] IPMI: Add one interface to get more info of low-level IPMI device yakui.zhao
2010-10-12 7:47 ` [RFC PATCH 2/4] IPMI: Remove the redundant definition of ipmi_addr_src yakui.zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1287738641-11490-3-git-send-email-yakui.zhao@intel.com \
--to=yakui.zhao@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=minyard@acm.org \
--cc=openipmi-developer@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).