[PATCHSET] "pcmcia_device" patchset (formerly pcmcia-b14) re-diffed and updated

Dominik Brodowski linux at dominikbrodowski.de
Sun May 16 19:22:00 EDT 2004

I've just re-diffed my proposal for a patchset formerly named
"14-pcmcia", now named "130-pcmcia_device". It is built on top of
2.6.6-bk-current, "b100-socket-sysfs", "b110-obsolete" and
"b120-nomaster", which are avaliable at
Changes to previous implementation sent to list
- re-diffed
- adapted so that "b100-socket-syfs" can be first to be merged
- updated two comments

The aim of this patchset is to assert only PCMCIA device drivers are registered
as clients, PCMCIA devices (one PCMCIA device for each function on a PCMCIA
card) are registered with the driver model core, and to remove the special
"bind information" in ds.c.

An example of the (beginning) integration with the driver model core.

sonnenschein root # tree /sys/bus/pcmcia/
|-- devices
|   `-- pcmcia0.0 -> ../../../devices/pci0000:00/0000:00:0c.0/pcmcia0.0
`-- drivers
    `-- pcnet_cs
        `-- pcmcia0.0 -> ../../../../devices/pci0000:00/0000:00:0c.0/pcmcia0.0
5 directories, 0 files

The patches are available in compressed form
as single diff at:

and as single patches as follows:


Add a new registration function to register the PCMCIA 16-bit subsystem
(ds a.k.a. pcmcia) with the PCMICA core (cs a.k.a. pcmcia_core).

As send_event is only called with skt->sem held, we can use that to safeguard
skt->callback(), too. Note that the class_device_register() call by pccardd()
is done _before_ skt->sem() is held, and the pcmcia_socket_register() doesn't
hold skt->sem() as well, so there is no chance for a deadlock.

 drivers/pcmcia/cs.c          |   56 +++++++++++++++++++++++++++++++++++++++++--
 drivers/pcmcia/cs_internal.h |    8 ++++++
 drivers/pcmcia/ds.c          |   51 +++++++++++----------------------------
 include/pcmcia/ss.h          |    2 +
 4 files changed, 79 insertions(+), 38 deletions(-)


Call the PCMCIA 16-bit device drivers from ds.c instead of cs.c. Also,
remove the delayed handling of CS_REMOVAL events, but keep the ordering
the same as it used to be due to the delay.

 drivers/pcmcia/cs.c |   41 ++++++-------------------
 drivers/pcmcia/ds.c |   84 ++++++++++++++++++++++++++++++----------------------
 2 files changed, 60 insertions(+), 65 deletions(-)


Unify the pcmcia_bind_mtd and bind_mtd functions.

 drivers/pcmcia/ds.c |   73 ++++++++++++----------------------------------------
 include/pcmcia/cs.h |    7 ----
 2 files changed, 18 insertions(+), 62 deletions(-)


Unify bind_device and pcmcia_bind_device. Also, change bind_device so
that it conforms to CodingStyle.

 drivers/pcmcia/ds.c |  159 +++++++++++++++++++++-------------------------------
 include/pcmcia/cs.h |    9 --
 2 files changed, 68 insertions(+), 100 deletions(-)


As discussed previously, my integration of ds.c with the driver model
can and will only be available under the GPL, as it's too much 
derived of other buses' implementation of integration with the driver model.

 drivers/pcmcia/ds.c |   48 +++++++++++++++---------------------------------
 include/pcmcia/ds.h |   26 ++++++--------------------
 2 files changed, 21 insertions(+), 53 deletions(-)


Add pcmcia_device(s).

 drivers/pcmcia/ds.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/pcmcia/ds.h |   17 +++++++++++++
 2 files changed, 83 insertions(+)


Remove struct socket_bind_t by moving "dev_link_t *instance" to struct
pcmcia_device, and transforming all users of socket_bind_t to use struct
pcmcia_device instead. Also, CodingStyle updates for
get_device_info and unbind_request.

 drivers/pcmcia/ds.c |  302 +++++++++++++++++++++++++++-------------------------
 include/pcmcia/ds.h |    4
 2 files changed, 163 insertions(+), 143 deletions(-)


Remove the internal driver use_count in ds.c, as the reference counting
is done in the module core anyways, and that reference count is available
for cardmgr's usage by a call to module_refcount. And if
!CONFIG_MODULE_UNLOAD, rmmod is useless anyways, so avoid that call by
cardmgr at all.
 drivers/pcmcia/ds.c |   13 ++++++++-----
 include/pcmcia/ds.h |    1 -
 2 files changed, 8 insertions(+), 6 deletions(-)

More information about the linux-pcmcia mailing list