[PATCH] pcmcia: does not load the pd6729 driver, if io_base is 0

Wolfram Sang w.sang at pengutronix.de
Sat Oct 24 06:25:44 EDT 2009


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-mbn at nifty.com>
> 
> ---
> 
> --- linux-2.6.31/drivers/pcmcia/pd6729.c.orig	2009-09-12 11:14:37.000000000 +0900
> +++ linux-2.6.31/drivers/pcmcia/pd6729.c	2009-09-12 11:40:01.000000000 +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-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20091024/888bb9f2/attachment.sig>


More information about the linux-pcmcia mailing list