Bug 8485 - cmm_cm4000_release wants a "struct pcmcia_device *" arg, but cm4000_release gives it a "struct cm4000_dev *"
Summary: cmm_cm4000_release wants a "struct pcmcia_device *" arg, but cm4000_release g...
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: PCMCIA (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: linux-pcmcia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-16 13:52 UTC by Bill McConnaughey
Modified: 2008-09-23 09:41 UTC (History)
0 users

See Also:
Kernel Version: 2.6.18
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Bill McConnaughey 2007-05-16 13:52:52 UTC
Most recent kernel where this bug did *NOT* occur:
Distribution:
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 */
        pcmcia_disable_device(link);
}

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?

Note You need to log in before you can comment on or make changes to this bug.