Re: [PATCH] pcmcia: does not load the pd6729 driver, if io_base is 0
On Sat, Oct 24, 2009 at 08:07:39AM +0900, Komuro wrote: The CL-PD6729 chip in some docking station is not initialized properly under Linux. in that case, does not load the pd6729 driver. Signed-off-by: Komuro komurojun-...@nifty.com Applied, and (almost) on its way to Linus. Thanks! Best, Dominik ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
Re: [PATCH] pcmcia: does not load the pd6729 driver, if io_base is 0
On Sat, Oct 24, 2009 at 08:07:39AM +0900, Komuro wrote: The CL-PD6729 chip in some docking station is not initialized properly under Linux. in that case, does not load the pd6729 driver. Signed-off-by: Komuro komurojun-...@nifty.com --- --- linux-2.6.31/drivers/pcmcia/pd6729.c.orig 2009-09-12 11:14:37.0 +0900 +++ linux-2.6.31/drivers/pcmcia/pd6729.c 2009-09-12 11:40:01.0 +0900 @@ -641,6 +641,12 @@ if ((ret = pci_enable_device(dev))) goto err_out_free_mem; + if ((unsigned long long)pci_resource_start(dev, 0) == 0) { Maybe + if (!pci_resource_start(dev, 0)) { to save the cast and use the more common way to check for a NULL-pointer. + printk(KERN_INFO pd6729: failed to load the driver. + since the io_base is 0.\n); I'd strongly suggest dev_err or dev_warn here. + goto err_out_free_mem; + } + printk(KERN_INFO pd6729: Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx on irq %d\n, (unsigned long long)pci_resource_start(dev, 0), dev-irq); ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia Regards, Wolfram -- Pengutronix e.K. | Wolfram Sang| Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5064 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | signature.asc Description: Digital signature ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
Re: [PATCH] pcmcia: does not load the pd6729 driver, if io_base is 0
Hey, On Sat, Oct 24, 2009 at 12:25:44PM +0200, Wolfram Sang wrote: Maybe +if (!pci_resource_start(dev, 0)) { to save the cast and use the more common way to check for a NULL-pointer. yes, that's better (see below). Thanks. + printk(KERN_INFO pd6729: failed to load the driver. +since the io_base is 0.\n); I'd strongly suggest dev_err or dev_warn here. They should be replaced all over the driver, not just here -- therefore, I'd suggest delaying this until post-2.6.32. Best, Dominik From: Komuro komurojun-...@nifty.com Date: Sat, 24 Oct 2009 08:07:39 +0900 Subject: [PATCH] pcmcia: do not load the pd6729 driver if io_base is NULL The CL-PD6729 chip in some docking station is not initialized properly under Linux. In that case, do not load the pd6729 driver. [Dominik Brodowski li...@dominikbrodowski.net: spelling fixes, check for NULL not 0] Signed-off-by: Komuro komurojun-...@nifty.com Signed-off-by: Dominik Brodowski li...@dominikbrodowski.net diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c index 1c39d34..70a3346 100644 --- a/drivers/pcmcia/pd6729.c +++ b/drivers/pcmcia/pd6729.c @@ -641,6 +641,12 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev, if ((ret = pci_enable_device(dev))) goto err_out_free_mem; + if (!pci_resource_start(dev, 0)) { + printk(KERN_INFO pd6729: refusing to load the driver +as the io_base is 0.\n); + goto err_out_free_mem; + } + printk(KERN_INFO pd6729: Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx on irq %d\n, (unsigned long long)pci_resource_start(dev, 0), dev-irq); ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH] pcmcia: does not load the pd6729 driver, if io_base is 0
The CL-PD6729 chip in some docking station is not initialized properly under Linux. in that case, does not load the pd6729 driver. Signed-off-by: Komuro komurojun-...@nifty.com --- --- linux-2.6.31/drivers/pcmcia/pd6729.c.orig 2009-09-12 11:14:37.0 +0900 +++ linux-2.6.31/drivers/pcmcia/pd6729.c2009-09-12 11:40:01.0 +0900 @@ -641,6 +641,12 @@ if ((ret = pci_enable_device(dev))) goto err_out_free_mem; + if ((unsigned long long)pci_resource_start(dev, 0) == 0) { + printk(KERN_INFO pd6729: failed to load the driver. +since the io_base is 0.\n); + goto err_out_free_mem; + } + printk(KERN_INFO pd6729: Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx on irq %d\n, (unsigned long long)pci_resource_start(dev, 0), dev-irq); ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia