Bug 8485

Summary: cmm_cm4000_release wants a "struct pcmcia_device *" arg, but cm4000_release gives it a "struct cm4000_dev *"
Product: Drivers Reporter: Bill McConnaughey (mcconnau)
Component: PCMCIAAssignee: linux-pcmcia
Severity: normal    
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.18 Tree: Mainline
Regression: ---

Description Bill McConnaughey 2007-05-16 13:52:52 UTC
Most recent kernel where this bug did *NOT* occur:
Hardware Environment:
Software Environment:
Problem Description:
These exerpts from linux-2.6.18/drivers/char/pcmcia/cm4000_cs.c show an
inconsistency:  "cmm_cm4000_release" takes a "struct pcmcia_device *"
argument, but "cm4000_release" is giving it a "struct cm4000_dev *"
argument.  I don't have the means to test this (I'm studying the code
as an example).

struct cm4000_dev {
        struct pcmcia_device *p_dev;

static void cmm_cm4000_release(struct pcmcia_device * link)
        struct cm4000_dev *dev = link->priv;
                wait_event(dev->devq, (link->open == 0));

static void cm4000_release(struct pcmcia_device *link)
        cmm_cm4000_release(link->priv); /* delay release until device closed */

static int cm4000_probe(struct pcmcia_device *link)
        struct cm4000_dev *dev;
        dev->p_dev = link;
        link->priv = dev;

Other stuff:
-- cmm_open has variable "rc" which is set to 0 but not used
-- where cm4000_config calls pcmcia_request_configuration, in case of error it
sets fail_fn and goes to cs_release.  I think that should be cs_failed.

Steps to reproduce:
Comment 1 Dominik Brodowski 2007-10-28 07:08:06 UTC
patch to fix this seems to be in mainline now. Close?