The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] mfd: lpc_ich: one uninitialized cell is no error
@ 2012-11-19 20:04 Paul Bolle
  2012-11-21 16:35 ` Samuel Ortiz
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Bolle @ 2012-11-19 20:04 UTC (permalink / raw)
  To: Peter Tyser, Samuel Ortiz; +Cc: linux-kernel

At every boot of an (outdated) laptop lpc_ich prints an error:
    lpc_ich 0000:00:1f.0: I/O space for GPIO uninitialized

But if one looks at lpc_ich's probe function one notices that the code
only cares if both lpc_ich_init_wdt() and lpc_ich_init_gpio() fail to
add any cells. So stop treating the failure to add a single cell as an
error. Those messages can be printed at notice level. And then only warn
if no cells were added.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
0) This patch was written on top of v3.7-rc4 and tested on v3.6.7.

1) Please note that this patch prints a warning when no MFD cells are
added at all. I didn't make that an error because I'm not sure there's
anything one can do if this happens. Is there?

 drivers/mfd/lpc_ich.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
index a22544f..a102f7a 100644
--- a/drivers/mfd/lpc_ich.c
+++ b/drivers/mfd/lpc_ich.c
@@ -734,7 +734,7 @@ static int __devinit lpc_ich_init_gpio(struct pci_dev *dev,
 	pci_read_config_dword(dev, ACPIBASE, &base_addr_cfg);
 	base_addr = base_addr_cfg & 0x0000ff80;
 	if (!base_addr) {
-		dev_err(&dev->dev, "I/O space for ACPI uninitialized\n");
+		dev_notice(&dev->dev, "I/O space for ACPI uninitialized\n");
 		lpc_ich_cells[LPC_GPIO].num_resources--;
 		goto gpe0_done;
 	}
@@ -760,7 +760,7 @@ gpe0_done:
 	pci_read_config_dword(dev, GPIOBASE, &base_addr_cfg);
 	base_addr = base_addr_cfg & 0x0000ff80;
 	if (!base_addr) {
-		dev_err(&dev->dev, "I/O space for GPIO uninitialized\n");
+		dev_notice(&dev->dev, "I/O space for GPIO uninitialized\n");
 		ret = -ENODEV;
 		goto gpio_done;
 	}
@@ -810,7 +810,7 @@ static int __devinit lpc_ich_init_wdt(struct pci_dev *dev,
 	pci_read_config_dword(dev, ACPIBASE, &base_addr_cfg);
 	base_addr = base_addr_cfg & 0x0000ff80;
 	if (!base_addr) {
-		dev_err(&dev->dev, "I/O space for ACPI uninitialized\n");
+		dev_notice(&dev->dev, "I/O space for ACPI uninitialized\n");
 		ret = -ENODEV;
 		goto wdt_done;
 	}
@@ -834,8 +834,8 @@ static int __devinit lpc_ich_init_wdt(struct pci_dev *dev,
 		pci_read_config_dword(dev, RCBABASE, &base_addr_cfg);
 		base_addr = base_addr_cfg & 0xffffc000;
 		if (!(base_addr_cfg & 1)) {
-			pr_err("RCBA is disabled by hardware/BIOS, "
-					"device disabled\n");
+			dev_notice(&dev->dev, "RCBA is disabled by "
+					"hardware/BIOS, device disabled\n");
 			ret = -ENODEV;
 			goto wdt_done;
 		}
@@ -871,6 +871,7 @@ static int __devinit lpc_ich_probe(struct pci_dev *dev,
 	 * successfully.
 	 */
 	if (!cell_added) {
+		dev_warn(&dev->dev, "No MFD cells added\n");
 		lpc_ich_restore_config_space(dev);
 		return -ENODEV;
 	}
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mfd: lpc_ich: one uninitialized cell is no error
  2012-11-19 20:04 [PATCH] mfd: lpc_ich: one uninitialized cell is no error Paul Bolle
@ 2012-11-21 16:35 ` Samuel Ortiz
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2012-11-21 16:35 UTC (permalink / raw)
  To: Paul Bolle; +Cc: Peter Tyser, linux-kernel

Hi Paul,

On Mon, Nov 19, 2012 at 09:04:11PM +0100, Paul Bolle wrote:
> At every boot of an (outdated) laptop lpc_ich prints an error:
>     lpc_ich 0000:00:1f.0: I/O space for GPIO uninitialized
> 
> But if one looks at lpc_ich's probe function one notices that the code
> only cares if both lpc_ich_init_wdt() and lpc_ich_init_gpio() fail to
> add any cells. So stop treating the failure to add a single cell as an
> error. Those messages can be printed at notice level. And then only warn
> if no cells were added.
> 
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
> ---
> 0) This patch was written on top of v3.7-rc4 and tested on v3.6.7.
> 
> 1) Please note that this patch prints a warning when no MFD cells are
> added at all. I didn't make that an error because I'm not sure there's
> anything one can do if this happens. Is there?
> 
>  drivers/mfd/lpc_ich.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
Applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-21 16:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-19 20:04 [PATCH] mfd: lpc_ich: one uninitialized cell is no error Paul Bolle
2012-11-21 16:35 ` Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox