Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ded6a1a3 authored by Dominik Brodowski's avatar Dominik Brodowski
Browse files

pcmcia: dev_node removal (drivers with updated printk call)



As a second step, remove any usage of dev_node_t from drivers which
only wrote to this typedef/struct, except one printk() which can
easily be replaced by a dev_info()/dev_warn() call.

CC: Harald Welte <laforge@gnumonks.org>
CC: linux-ide@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: netdev@vger.kernel.org
CC: linux-usb@vger.kernel.org
Acked-by: default avatarKarsten Keil <isdn@linux-pingi.de>
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 317b6d63
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -106,7 +106,6 @@ static int major; /* major number we get from the kernel */

struct cm4000_dev {
	struct pcmcia_device *p_dev;
	dev_node_t node;		/* OS node (major,minor) */

	unsigned char atr[MAX_ATR];
	unsigned char rbuf[512];
@@ -884,8 +883,7 @@ static void monitor_card(unsigned long p)
		/* slow down warning, but prompt immediately after insertion */
		if (dev->cwarn == 0 || dev->cwarn == 10) {
			set_bit(IS_BAD_CARD, &dev->flags);
			printk(KERN_WARNING MODULE_NAME ": device %s: ",
			       dev->node.dev_name);
			dev_warn(&dev->p_dev->dev, MODULE_NAME ": ");
			if (test_bit(IS_BAD_CSUM, &dev->flags)) {
				DEBUGP(4, dev, "ATR checksum (0x%.2x, should "
				       "be zero) failed\n", dev->atr_csum);
@@ -1781,11 +1779,6 @@ static int cm4000_config(struct pcmcia_device * link, int devno)
		goto cs_release;

	dev = link->priv;
	sprintf(dev->node.dev_name, DEVICE_NAME "%d", devno);
	dev->node.major = major;
	dev->node.minor = devno;
	dev->node.next = NULL;
	link->dev_node = &dev->node;

	return 0;

+2 −8
Original line number Diff line number Diff line
@@ -220,7 +220,6 @@ typedef struct _mgslpc_info {

	/* PCMCIA support */
	struct pcmcia_device	*p_dev;
	dev_node_t	      node;
	int		      stop;

	/* SPPP/Cisco HDLC device parts */
@@ -614,13 +613,8 @@ static int mgslpc_config(struct pcmcia_device *link)
    info->io_base = link->io.BasePort1;
    info->irq_level = link->irq;

    /* add to linked list of devices */
    sprintf(info->node.dev_name, "mgslpc0");
    info->node.major = info->node.minor = 0;
    link->dev_node = &info->node;

    printk(KERN_INFO "%s: index 0x%02x:",
	   info->node.dev_name, link->conf.ConfigIndex);
    dev_info(&link->dev, "index 0x%02x:",
	    link->conf.ConfigIndex);
    if (link->conf.Attributes & CONF_ENABLE_IRQ)
	    printk(", irq %d", link->irq);
    if (link->io.NumPorts1)
+4 −8
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ typedef struct ide_info_t {
	struct pcmcia_device	*p_dev;
	struct ide_host		*host;
	int			ndev;
    dev_node_t	node;
} ide_info_t;

static void ide_release(struct pcmcia_device *);
@@ -308,13 +307,10 @@ static int ide_config(struct pcmcia_device *link)
	goto failed;

    info->ndev = 1;
    sprintf(info->node.dev_name, "hd%c", 'a' + host->ports[0]->index * 2);
    info->node.major = host->ports[0]->major;
    info->node.minor = 0;
    info->host = host;
    link->dev_node = &info->node;
    printk(KERN_INFO "ide-cs: %s: Vpp = %d.%d\n",
	   info->node.dev_name, link->conf.Vpp / 10, link->conf.Vpp % 10);
    dev_info(&link->dev, "ide-cs: hd%c: Vpp = %d.%d\n",
	    'a' + host->ports[0]->index * 2,
	    link->conf.Vpp / 10, link->conf.Vpp % 10);

    kfree(stk);
    return 0;
+5 −55
Original line number Diff line number Diff line
@@ -61,31 +61,6 @@ static void avmcs_release(struct pcmcia_device *link);

static void avmcs_detach(struct pcmcia_device *p_dev);

/*
   A linked list of "instances" of the skeleton device.  Each actual
   PCMCIA card corresponds to one device instance, and is described
   by one struct pcmcia_device structure (defined in ds.h).

   You may not want to use a linked list for this -- for example, the
   memory card driver uses an array of struct pcmcia_device pointers, where minor
   device numbers are used to derive the corresponding array index.
*/

/*
   A driver needs to provide a dev_node_t structure for each device
   on a card.  In some cases, there is only one device per card (for
   example, ethernet cards, modems).  In other cases, there may be
   many actual or logical devices (SCSI adapters, memory cards with
   multiple partitions).  The dev_node_t structures need to be kept
   in a linked list starting at the 'dev' field of a struct pcmcia_device
   structure.  We allocate them in the card's private data structure,
   because they generally can't be allocated dynamically.
*/
   
typedef struct local_info_t {
    dev_node_t	node;
} local_info_t;

/*======================================================================

    avmcs_attach() creates an "instance" of the driver, allocating
@@ -100,7 +75,6 @@ typedef struct local_info_t {

static int avmcs_probe(struct pcmcia_device *p_dev)
{
    local_info_t *local;

    /* The io structure describes IO port mapping */
    p_dev->io.NumPorts1 = 16;
@@ -113,16 +87,7 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
    p_dev->conf.ConfigIndex = 1;
    p_dev->conf.Present = PRESENT_OPTION;

    /* Allocate space for private device-specific data */
    local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
    if (!local)
        goto err;
    p_dev->priv = local;

    return avmcs_config(p_dev);

 err:
    return -ENOMEM;
} /* avmcs_attach */

/*======================================================================
@@ -137,7 +102,6 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
static void avmcs_detach(struct pcmcia_device *link)
{
	avmcs_release(link);
	kfree(link->priv);
} /* avmcs_detach */

/*======================================================================
@@ -168,14 +132,11 @@ static int avmcs_configcheck(struct pcmcia_device *p_dev,

static int avmcs_config(struct pcmcia_device *link)
{
    local_info_t *dev;
    int i = -1;
    char devname[128];
    int cardtype;
    int (*addcard)(unsigned int port, unsigned irq);

    dev = link->priv;

    devname[0] = 0;
    if (link->prod_id[1])
	    strlcpy(devname, link->prod_id[1], sizeof(devname));
@@ -204,15 +165,11 @@ static int avmcs_config(struct pcmcia_device *link)

    } while (0);

    /* At this point, the dev_node_t structure(s) should be
       initialized and arranged in a linked list at link->dev. */

    if (devname[0]) {
	char *s = strrchr(devname, ' ');
	if (!s)
	   s = devname;
	else s++;
	strcpy(dev->node.dev_name, s);
        if (strcmp("M1", s) == 0) {
           cardtype = AVM_CARDTYPE_M1;
        } else if (strcmp("M2", s) == 0) {
@@ -220,14 +177,8 @@ static int avmcs_config(struct pcmcia_device *link)
	} else {
           cardtype = AVM_CARDTYPE_B1;
	}
    } else {
        strcpy(dev->node.dev_name, "b1");
    } else
        cardtype = AVM_CARDTYPE_B1;
    }

    dev->node.major = 64;
    dev->node.minor = 0;
    link->dev_node = &dev->node;

    /* If any step failed, release any partially configured state */
    if (i != 0) {
@@ -243,12 +194,11 @@ static int avmcs_config(struct pcmcia_device *link)
        case AVM_CARDTYPE_B1: addcard = b1pcmcia_addcard_b1; break;
    }
    if ((i = (*addcard)(link->io.BasePort1, link->irq)) < 0) {
        printk(KERN_ERR "avm_cs: failed to add AVM-%s-Controller at i/o %#x, irq %d\n",
		dev->node.dev_name, link->io.BasePort1, link->irq);
	    dev_err(&link->dev, "avm_cs: failed to add AVM-Controller at i/o %#x, irq %d\n",
		    link->io.BasePort1, link->irq);
	    avmcs_release(link);
	    return -ENODEV;
    }
    dev->node.minor = i;
    return 0;

} /* avmcs_config */
+2 −25
Original line number Diff line number Diff line
@@ -87,24 +87,8 @@ static void elsa_cs_release(struct pcmcia_device *link);

static void elsa_cs_detach(struct pcmcia_device *p_dev) __devexit;

/*
   A driver needs to provide a dev_node_t structure for each device
   on a card.  In some cases, there is only one device per card (for
   example, ethernet cards, modems).  In other cases, there may be
   many actual or logical devices (SCSI adapters, memory cards with
   multiple partitions).  The dev_node_t structures need to be kept
   in a linked list starting at the 'dev' field of a struct pcmcia_device
   structure.  We allocate them in the card's private data structure,
   because they generally shouldn't be allocated dynamically.
   In this case, we also provide a flag to indicate if a device is
   "stopped" due to a power management event, or card ejection.  The
   device IO routines can use a flag like this to throttle IO to a
   card that is not ready to accept it.
*/

typedef struct local_info_t {
	struct pcmcia_device	*p_dev;
    dev_node_t          node;
    int                 busy;
    int			cardnr;
} local_info_t;
@@ -226,16 +210,9 @@ static int __devinit elsa_cs_config(struct pcmcia_device *link)
    if (i != 0)
	goto failed;

    /* At this point, the dev_node_t structure(s) should be
       initialized and arranged in a linked list at link->dev. *//*  */
    sprintf(dev->node.dev_name, "elsa");
    dev->node.major = dev->node.minor = 0x0;

    link->dev_node = &dev->node;

    /* Finally, report what we've done */
    printk(KERN_INFO "%s: index 0x%02x: ",
           dev->node.dev_name, link->conf.ConfigIndex);
    dev_info(&link->dev, "index 0x%02x: ",
	    link->conf.ConfigIndex);
    if (link->conf.Attributes & CONF_ENABLE_IRQ)
	printk(", irq %d", link->irq);
    if (link->io.NumPorts1)
Loading