Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 May 2011 20:28:35 +0000 (13:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 May 2011 20:28:35 +0000 (13:28 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
  pcmcia: Make struct pcmcia_device_id const, sound drivers edition
  staging: pcmcia: Convert pcmcia_device_id declarations to const
  pcmcia: Convert pcmcia_device_id declarations to const
  pcmcia: Make declaration and uses of struct pcmcia_device_id const
  pcmcia/sa1100: put sa11x0_pcmcia_hw_init[] to .devinit.data

1  2 
drivers/isdn/hisax/elsa_cs.c
drivers/isdn/hisax/teles_cs.c
drivers/net/pcmcia/smc91c92_cs.c
drivers/net/wireless/libertas/if_cs.c

@@@ -129,10 -129,12 +129,10 @@@ static int elsa_cs_configcheck(struct p
  
  static int __devinit elsa_cs_config(struct pcmcia_device *link)
  {
 -    local_info_t *dev;
      int i;
      IsdnCard_t icard;
  
      dev_dbg(&link->dev, "elsa_config(0x%p)\n", link);
 -    dev = link->priv;
  
      link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
  
@@@ -200,7 -202,7 +200,7 @@@ static int elsa_resume(struct pcmcia_de
        return 0;
  }
  
- static struct pcmcia_device_id elsa_ids[] = {
+ static const struct pcmcia_device_id elsa_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("ELSA AG (Aachen, Germany)", "MicroLink ISDN/MC ", 0x983de2c4, 0x333ba257),
        PCMCIA_DEVICE_PROD_ID12("ELSA GmbH, Aachen", "MicroLink ISDN/MC ", 0x639e5718, 0x333ba257),
        PCMCIA_DEVICE_NULL
@@@ -111,10 -111,12 +111,10 @@@ static int teles_cs_configcheck(struct 
  
  static int __devinit teles_cs_config(struct pcmcia_device *link)
  {
 -    local_info_t *dev;
      int i;
      IsdnCard_t icard;
  
      dev_dbg(&link->dev, "teles_config(0x%p)\n", link);
 -    dev = link->priv;
  
      i = pcmcia_loop_config(link, teles_cs_configcheck, NULL);
      if (i != 0)
@@@ -183,7 -185,7 +183,7 @@@ static int teles_resume(struct pcmcia_d
  }
  
  
- static struct pcmcia_device_id teles_ids[] = {
+ static const struct pcmcia_device_id teles_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("TELES", "S0/PC", 0x67b50eae, 0xe9e70119),
        PCMCIA_DEVICE_NULL,
  };
@@@ -1860,7 -1860,7 +1860,7 @@@ static int smc_netdev_get_ecmd(struct n
      tmp = inw(ioaddr + CONFIG);
      ecmd->port = (tmp & CFG_AUI_SELECT) ? PORT_AUI : PORT_TP;
      ecmd->transceiver = XCVR_INTERNAL;
 -    ecmd->speed = SPEED_10;
 +    ethtool_cmd_speed_set(ecmd, SPEED_10);
      ecmd->phy_address = ioaddr + MGMT;
  
      SMC_SELECT_BANK(0);
@@@ -1875,8 -1875,8 +1875,8 @@@ static int smc_netdev_set_ecmd(struct n
      u16 tmp;
      unsigned int ioaddr = dev->base_addr;
  
 -    if (ecmd->speed != SPEED_10)
 -      return -EINVAL;
 +    if (ethtool_cmd_speed(ecmd) != SPEED_10)
 +      return -EINVAL;
      if (ecmd->duplex != DUPLEX_HALF && ecmd->duplex != DUPLEX_FULL)
        return -EINVAL;
      if (ecmd->port != PORT_TP && ecmd->port != PORT_AUI)
@@@ -2014,7 -2014,7 +2014,7 @@@ static int smc_ioctl (struct net_devic
        return rc;
  }
  
- static struct pcmcia_device_id smc91c92_ids[] = {
+ static const struct pcmcia_device_id smc91c92_ids[] = {
        PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0109, 0x0501),
        PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0140, 0x000a),
        PCMCIA_PFC_DEVICE_PROD_ID123(0, "MEGAHERTZ", "CC/XJEM3288", "DATA/FAX/CELL ETHERNET MODEM", 0xf510db04, 0x04cd2988, 0x46a52d63),
@@@ -21,8 -21,6 +21,8 @@@
  
  */
  
 +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 +
  #include <linux/module.h>
  #include <linux/slab.h>
  #include <linux/delay.h>
@@@ -314,8 -312,7 +314,8 @@@ static int if_cs_poll_while_fw_download
  #define CF8385_MANFID         0x02df
  #define CF8385_CARDID         0x8103
  
 -/* FIXME: just use the 'driver_info' field of 'struct pcmcia_device_id' when
 +/*
 + * FIXME: just use the 'driver_info' field of 'struct pcmcia_device_id' when
   * that gets fixed.  Currently there's no way to access it from the probe hook.
   */
  static inline u32 get_model(u16 manf_id, u16 card_id)
@@@ -364,7 -361,7 +364,7 @@@ static int if_cs_send_cmd(struct lbs_pr
                if (status & IF_CS_BIT_COMMAND)
                        break;
                if (++loops > 100) {
 -                      lbs_pr_err("card not ready for commands\n");
 +                      netdev_err(priv->dev, "card not ready for commands\n");
                        goto done;
                }
                mdelay(1);
@@@ -434,16 -431,14 +434,16 @@@ static int if_cs_receive_cmdres(struct 
        /* is hardware ready? */
        status = if_cs_read16(priv->card, IF_CS_CARD_STATUS);
        if ((status & IF_CS_BIT_RESP) == 0) {
 -              lbs_pr_err("no cmd response in card\n");
 +              netdev_err(priv->dev, "no cmd response in card\n");
                *len = 0;
                goto out;
        }
  
        *len = if_cs_read16(priv->card, IF_CS_RESP_LEN);
        if ((*len == 0) || (*len > LBS_CMD_BUFFER_SIZE)) {
 -              lbs_pr_err("card cmd buffer has invalid # of bytes (%d)\n", *len);
 +              netdev_err(priv->dev,
 +                         "card cmd buffer has invalid # of bytes (%d)\n",
 +                         *len);
                goto out;
        }
  
@@@ -477,9 -472,7 +477,9 @@@ static struct sk_buff *if_cs_receive_da
  
        len = if_cs_read16(priv->card, IF_CS_READ_LEN);
        if (len == 0 || len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
 -              lbs_pr_err("card data buffer has invalid # of bytes (%d)\n", len);
 +              netdev_err(priv->dev,
 +                         "card data buffer has invalid # of bytes (%d)\n",
 +                         len);
                priv->dev->stats.rx_dropped++;
                goto dat_err;
        }
@@@ -628,10 -621,8 +628,10 @@@ static int if_cs_prog_helper(struct if_
                if (remain < count)
                        count = remain;
  
 -              /* "write the number of bytes to be sent to the I/O Command
 -               * write length register" */
 +              /*
 +               * "write the number of bytes to be sent to the I/O Command
 +               * write length register"
 +               */
                if_cs_write16(card, IF_CS_CMD_LEN, count);
  
                /* "write this to I/O Command port register as 16 bit writes */
                                &fw->data[sent],
                                count >> 1);
  
 -              /* "Assert the download over interrupt command in the Host
 -               * status register" */
 +              /*
 +               * "Assert the download over interrupt command in the Host
 +               * status register"
 +               */
                if_cs_write8(card, IF_CS_HOST_STATUS, IF_CS_BIT_COMMAND);
  
 -              /* "Assert the download over interrupt command in the Card
 -               * interrupt case register" */
 +              /*
 +               * "Assert the download over interrupt command in the Card
 +               * interrupt case register"
 +               */
                if_cs_write16(card, IF_CS_HOST_INT_CAUSE, IF_CS_BIT_COMMAND);
  
 -              /* "The host polls the Card Status register ... for 50 ms before
 -                 declaring a failure */
 +              /*
 +               * "The host polls the Card Status register ... for 50 ms before
 +               * declaring a failure"
 +               */
                ret = if_cs_poll_while_fw_download(card, IF_CS_CARD_STATUS,
                        IF_CS_BIT_COMMAND);
                if (ret < 0) {
 -                      lbs_pr_err("can't download helper at 0x%x, ret %d\n",
 -                              sent, ret);
 +                      pr_err("can't download helper at 0x%x, ret %d\n",
 +                             sent, ret);
                        goto done;
                }
  
@@@ -690,7 -675,7 +690,7 @@@ static int if_cs_prog_real(struct if_cs
        ret = if_cs_poll_while_fw_download(card, IF_CS_SQ_READ_LOW,
                IF_CS_SQ_HELPER_OK);
        if (ret < 0) {
 -              lbs_pr_err("helper firmware doesn't answer\n");
 +              pr_err("helper firmware doesn't answer\n");
                goto done;
        }
  
                len = if_cs_read16(card, IF_CS_SQ_READ_LOW);
                if (len & 1) {
                        retry++;
 -                      lbs_pr_info("odd, need to retry this firmware block\n");
 +                      pr_info("odd, need to retry this firmware block\n");
                } else {
                        retry = 0;
                }
  
                if (retry > 20) {
 -                      lbs_pr_err("could not download firmware\n");
 +                      pr_err("could not download firmware\n");
                        ret = -ENODEV;
                        goto done;
                }
                ret = if_cs_poll_while_fw_download(card, IF_CS_CARD_STATUS,
                        IF_CS_BIT_COMMAND);
                if (ret < 0) {
 -                      lbs_pr_err("can't download firmware at 0x%x\n", sent);
 +                      pr_err("can't download firmware at 0x%x\n", sent);
                        goto done;
                }
        }
  
        ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a);
        if (ret < 0)
 -              lbs_pr_err("firmware download failed\n");
 +              pr_err("firmware download failed\n");
  
  done:
        lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
@@@ -765,8 -750,7 +765,8 @@@ static int if_cs_host_to_card(struct lb
                ret = if_cs_send_cmd(priv, buf, nb);
                break;
        default:
 -              lbs_pr_err("%s: unsupported type %d\n", __func__, type);
 +              netdev_err(priv->dev, "%s: unsupported type %d\n",
 +                         __func__, type);
        }
  
        lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
@@@ -795,7 -779,7 +795,7 @@@ static int if_cs_ioprobe(struct pcmcia_
        p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
  
        if (p_dev->resource[1]->end) {
 -              lbs_pr_err("wrong CIS (check number of IO windows)\n");
 +              pr_err("wrong CIS (check number of IO windows)\n");
                return -ENODEV;
        }
  
@@@ -816,7 -800,7 +816,7 @@@ static int if_cs_probe(struct pcmcia_de
  
        card = kzalloc(sizeof(struct if_cs_card), GFP_KERNEL);
        if (!card) {
 -              lbs_pr_err("error in kzalloc\n");
 +              pr_err("error in kzalloc\n");
                goto out;
        }
        card->p_dev = p_dev;
        p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
  
        if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) {
 -              lbs_pr_err("error in pcmcia_loop_config\n");
 +              pr_err("error in pcmcia_loop_config\n");
                goto out1;
        }
  
        card->iobase = ioport_map(p_dev->resource[0]->start,
                                resource_size(p_dev->resource[0]));
        if (!card->iobase) {
 -              lbs_pr_err("error in ioport_map\n");
 +              pr_err("error in ioport_map\n");
                ret = -EIO;
                goto out1;
        }
  
        ret = pcmcia_enable_device(p_dev);
        if (ret) {
 -              lbs_pr_err("error in pcmcia_enable_device\n");
 +              pr_err("error in pcmcia_enable_device\n");
                goto out2;
        }
  
  
        /*
         * Most of the libertas cards can do unaligned register access, but some
 -       * weird ones can not. That's especially true for the CF8305 card.
 +       * weird ones cannot. That's especially true for the CF8305 card.
         */
        card->align_regs = 0;
  
        card->model = get_model(p_dev->manf_id, p_dev->card_id);
        if (card->model == MODEL_UNKNOWN) {
 -              lbs_pr_err("unsupported manf_id 0x%04x / card_id 0x%04x\n",
 -                         p_dev->manf_id, p_dev->card_id);
 +              pr_err("unsupported manf_id 0x%04x / card_id 0x%04x\n",
 +                     p_dev->manf_id, p_dev->card_id);
                goto out2;
        }
  
        if (card->model == MODEL_8305) {
                card->align_regs = 1;
                if (prod_id < IF_CS_CF8305_B1_REV) {
 -                      lbs_pr_err("8305 rev B0 and older are not supported\n");
 +                      pr_err("8305 rev B0 and older are not supported\n");
                        ret = -ENODEV;
                        goto out2;
                }
        }
  
        if ((card->model == MODEL_8381) && prod_id < IF_CS_CF8381_B3_REV) {
 -              lbs_pr_err("8381 rev B2 and older are not supported\n");
 +              pr_err("8381 rev B2 and older are not supported\n");
                ret = -ENODEV;
                goto out2;
        }
  
        if ((card->model == MODEL_8385) && prod_id < IF_CS_CF8385_B1_REV) {
 -              lbs_pr_err("8385 rev B0 and older are not supported\n");
 +              pr_err("8385 rev B0 and older are not supported\n");
                ret = -ENODEV;
                goto out2;
        }
        ret = lbs_get_firmware(&p_dev->dev, NULL, NULL, card->model,
                                &fw_table[0], &helper, &mainfw);
        if (ret) {
 -              lbs_pr_err("failed to find firmware (%d)\n", ret);
 +              pr_err("failed to find firmware (%d)\n", ret);
                goto out2;
        }
  
        ret = request_irq(p_dev->irq, if_cs_interrupt,
                IRQF_SHARED, DRV_NAME, card);
        if (ret) {
 -              lbs_pr_err("error in request_irq\n");
 +              pr_err("error in request_irq\n");
                goto out3;
        }
  
 -      /* Clear any interrupt cause that happened while sending
 -       * firmware/initializing card */
 +      /*
 +       * Clear any interrupt cause that happened while sending
 +       * firmware/initializing card
 +       */
        if_cs_write16(card, IF_CS_CARD_INT_CAUSE, IF_CS_BIT_MASK);
        if_cs_enable_ints(card);
  
        /* And finally bring the card up */
        if (lbs_start_card(priv) != 0) {
 -              lbs_pr_err("could not activate card\n");
 +              pr_err("could not activate card\n");
                goto out3;
        }
  
@@@ -983,7 -965,7 +983,7 @@@ static void if_cs_detach(struct pcmcia_
  /* Module initialization                                            */
  /********************************************************************/
  
- static struct pcmcia_device_id if_cs_ids[] = {
+ static const struct pcmcia_device_id if_cs_ids[] = {
        PCMCIA_DEVICE_MANF_CARD(CF8305_MANFID, CF8305_CARDID),
        PCMCIA_DEVICE_MANF_CARD(CF8381_MANFID, CF8381_CARDID),
        PCMCIA_DEVICE_MANF_CARD(CF8385_MANFID, CF8385_CARDID),