From e294bc91760e11d2f1ebbac1d0a979069edf7adb Mon Sep 17 00:00:00 2001 From: Peter Hurley Date: Wed, 21 Nov 2012 17:30:50 +0100 Subject: mfd: lpc_ich: Fix resource request for [mem 0x00000000] The older southbridges supported by the lpc_ich driver do not provide memory-mapped space of the root complex. The driver correctly avoids computing the iomem address in this case, yet submits a zeroed resource request anyway (via mfd_add_devices()). Remove the iomem resource from the resource array submitted to the mfd core for the older southbridges. Acked-by: Aaron Sierra Cc: Peter Tyser Signed-off-by: Peter Hurley Signed-off-by: Samuel Ortiz --- drivers/mfd/lpc_ich.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/mfd/lpc_ich.c') diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c index a22544fe5319..afb2f77a9ae8 100644 --- a/drivers/mfd/lpc_ich.c +++ b/drivers/mfd/lpc_ich.c @@ -830,7 +830,10 @@ static int __devinit lpc_ich_init_wdt(struct pci_dev *dev, * we have to read RCBA from PCI Config space 0xf0 and use * it as base. GCS = RCBA + ICH6_GCS(0x3410). */ - if (lpc_chipset_info[id->driver_data].iTCO_version == 2) { + if (lpc_chipset_info[id->driver_data].iTCO_version == 1) { + /* Don't register iomem for TCO ver 1 */ + lpc_ich_cells[LPC_WDT].num_resources--; + } else { pci_read_config_dword(dev, RCBABASE, &base_addr_cfg); base_addr = base_addr_cfg & 0xffffc000; if (!(base_addr_cfg & 1)) { -- cgit v1.2.3-58-ga151 From 0c418844dce21fa7000b51190f393c7d6a7ee12d Mon Sep 17 00:00:00 2001 From: Paul Bolle Date: Mon, 19 Nov 2012 21:04:11 +0100 Subject: mfd: lpc_ich: One uninitialized cell is no error 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 Signed-off-by: Samuel Ortiz --- drivers/mfd/lpc_ich.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/mfd/lpc_ich.c') diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c index afb2f77a9ae8..b6dd4993c66b 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; } @@ -837,8 +837,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; } @@ -874,6 +874,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; } -- cgit v1.2.3-58-ga151