diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-05-01 02:02:47 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:15:01 -0400 |
commit | 928841b1538df117658ec5977bcf336c27f7747b (patch) | |
tree | ea2b5ac0353b5bbdab4c10402403a0da5a108bd4 /drivers | |
parent | 8bce6121706dd82c266c3f527e592abfb3e164d1 (diff) |
Wireless: remove driver_data direct access of struct device
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device. Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used. These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.
Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/atmel_cs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2100.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2200.c | 47 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 26 |
5 files changed, 53 insertions, 50 deletions
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index 77406245dc7b..ddaa859c3491 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c | |||
@@ -279,7 +279,7 @@ static int atmel_config(struct pcmcia_device *link) | |||
279 | struct pcmcia_device_id *did; | 279 | struct pcmcia_device_id *did; |
280 | 280 | ||
281 | dev = link->priv; | 281 | dev = link->priv; |
282 | did = handle_to_dev(link).driver_data; | 282 | did = dev_get_drvdata(&handle_to_dev(link)); |
283 | 283 | ||
284 | DEBUG(0, "atmel_config(0x%p)\n", link); | 284 | DEBUG(0, "atmel_config(0x%p)\n", link); |
285 | 285 | ||
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index 97e5647ff050..742432388ca3 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c | |||
@@ -3488,7 +3488,7 @@ static DEVICE_ATTR(pci, S_IRUGO, show_pci, NULL); | |||
3488 | static ssize_t show_cfg(struct device *d, struct device_attribute *attr, | 3488 | static ssize_t show_cfg(struct device *d, struct device_attribute *attr, |
3489 | char *buf) | 3489 | char *buf) |
3490 | { | 3490 | { |
3491 | struct ipw2100_priv *p = d->driver_data; | 3491 | struct ipw2100_priv *p = dev_get_drvdata(d); |
3492 | return sprintf(buf, "0x%08x\n", (int)p->config); | 3492 | return sprintf(buf, "0x%08x\n", (int)p->config); |
3493 | } | 3493 | } |
3494 | 3494 | ||
@@ -3497,7 +3497,7 @@ static DEVICE_ATTR(cfg, S_IRUGO, show_cfg, NULL); | |||
3497 | static ssize_t show_status(struct device *d, struct device_attribute *attr, | 3497 | static ssize_t show_status(struct device *d, struct device_attribute *attr, |
3498 | char *buf) | 3498 | char *buf) |
3499 | { | 3499 | { |
3500 | struct ipw2100_priv *p = d->driver_data; | 3500 | struct ipw2100_priv *p = dev_get_drvdata(d); |
3501 | return sprintf(buf, "0x%08x\n", (int)p->status); | 3501 | return sprintf(buf, "0x%08x\n", (int)p->status); |
3502 | } | 3502 | } |
3503 | 3503 | ||
@@ -3506,7 +3506,7 @@ static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); | |||
3506 | static ssize_t show_capability(struct device *d, struct device_attribute *attr, | 3506 | static ssize_t show_capability(struct device *d, struct device_attribute *attr, |
3507 | char *buf) | 3507 | char *buf) |
3508 | { | 3508 | { |
3509 | struct ipw2100_priv *p = d->driver_data; | 3509 | struct ipw2100_priv *p = dev_get_drvdata(d); |
3510 | return sprintf(buf, "0x%08x\n", (int)p->capability); | 3510 | return sprintf(buf, "0x%08x\n", (int)p->capability); |
3511 | } | 3511 | } |
3512 | 3512 | ||
@@ -4224,7 +4224,7 @@ static ssize_t show_rf_kill(struct device *d, struct device_attribute *attr, | |||
4224 | 1 - SW based RF kill active (sysfs) | 4224 | 1 - SW based RF kill active (sysfs) |
4225 | 2 - HW based RF kill active | 4225 | 2 - HW based RF kill active |
4226 | 3 - Both HW and SW baed RF kill active */ | 4226 | 3 - Both HW and SW baed RF kill active */ |
4227 | struct ipw2100_priv *priv = (struct ipw2100_priv *)d->driver_data; | 4227 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
4228 | int val = ((priv->status & STATUS_RF_KILL_SW) ? 0x1 : 0x0) | | 4228 | int val = ((priv->status & STATUS_RF_KILL_SW) ? 0x1 : 0x0) | |
4229 | (rf_kill_active(priv) ? 0x2 : 0x0); | 4229 | (rf_kill_active(priv) ? 0x2 : 0x0); |
4230 | return sprintf(buf, "%i\n", val); | 4230 | return sprintf(buf, "%i\n", val); |
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index 9a123fbcc359..c3b3dfe43d1a 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -1527,7 +1527,7 @@ static DEVICE_ATTR(led, S_IWUSR | S_IRUGO, show_led, store_led); | |||
1527 | static ssize_t show_status(struct device *d, | 1527 | static ssize_t show_status(struct device *d, |
1528 | struct device_attribute *attr, char *buf) | 1528 | struct device_attribute *attr, char *buf) |
1529 | { | 1529 | { |
1530 | struct ipw_priv *p = d->driver_data; | 1530 | struct ipw_priv *p = dev_get_drvdata(d); |
1531 | return sprintf(buf, "0x%08x\n", (int)p->status); | 1531 | return sprintf(buf, "0x%08x\n", (int)p->status); |
1532 | } | 1532 | } |
1533 | 1533 | ||
@@ -1536,7 +1536,7 @@ static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); | |||
1536 | static ssize_t show_cfg(struct device *d, struct device_attribute *attr, | 1536 | static ssize_t show_cfg(struct device *d, struct device_attribute *attr, |
1537 | char *buf) | 1537 | char *buf) |
1538 | { | 1538 | { |
1539 | struct ipw_priv *p = d->driver_data; | 1539 | struct ipw_priv *p = dev_get_drvdata(d); |
1540 | return sprintf(buf, "0x%08x\n", (int)p->config); | 1540 | return sprintf(buf, "0x%08x\n", (int)p->config); |
1541 | } | 1541 | } |
1542 | 1542 | ||
@@ -1545,7 +1545,7 @@ static DEVICE_ATTR(cfg, S_IRUGO, show_cfg, NULL); | |||
1545 | static ssize_t show_nic_type(struct device *d, | 1545 | static ssize_t show_nic_type(struct device *d, |
1546 | struct device_attribute *attr, char *buf) | 1546 | struct device_attribute *attr, char *buf) |
1547 | { | 1547 | { |
1548 | struct ipw_priv *priv = d->driver_data; | 1548 | struct ipw_priv *priv = dev_get_drvdata(d); |
1549 | return sprintf(buf, "TYPE: %d\n", priv->nic_type); | 1549 | return sprintf(buf, "TYPE: %d\n", priv->nic_type); |
1550 | } | 1550 | } |
1551 | 1551 | ||
@@ -1555,7 +1555,7 @@ static ssize_t show_ucode_version(struct device *d, | |||
1555 | struct device_attribute *attr, char *buf) | 1555 | struct device_attribute *attr, char *buf) |
1556 | { | 1556 | { |
1557 | u32 len = sizeof(u32), tmp = 0; | 1557 | u32 len = sizeof(u32), tmp = 0; |
1558 | struct ipw_priv *p = d->driver_data; | 1558 | struct ipw_priv *p = dev_get_drvdata(d); |
1559 | 1559 | ||
1560 | if (ipw_get_ordinal(p, IPW_ORD_STAT_UCODE_VERSION, &tmp, &len)) | 1560 | if (ipw_get_ordinal(p, IPW_ORD_STAT_UCODE_VERSION, &tmp, &len)) |
1561 | return 0; | 1561 | return 0; |
@@ -1569,7 +1569,7 @@ static ssize_t show_rtc(struct device *d, struct device_attribute *attr, | |||
1569 | char *buf) | 1569 | char *buf) |
1570 | { | 1570 | { |
1571 | u32 len = sizeof(u32), tmp = 0; | 1571 | u32 len = sizeof(u32), tmp = 0; |
1572 | struct ipw_priv *p = d->driver_data; | 1572 | struct ipw_priv *p = dev_get_drvdata(d); |
1573 | 1573 | ||
1574 | if (ipw_get_ordinal(p, IPW_ORD_STAT_RTC, &tmp, &len)) | 1574 | if (ipw_get_ordinal(p, IPW_ORD_STAT_RTC, &tmp, &len)) |
1575 | return 0; | 1575 | return 0; |
@@ -1586,14 +1586,15 @@ static DEVICE_ATTR(rtc, S_IWUSR | S_IRUGO, show_rtc, NULL); | |||
1586 | static ssize_t show_eeprom_delay(struct device *d, | 1586 | static ssize_t show_eeprom_delay(struct device *d, |
1587 | struct device_attribute *attr, char *buf) | 1587 | struct device_attribute *attr, char *buf) |
1588 | { | 1588 | { |
1589 | int n = ((struct ipw_priv *)d->driver_data)->eeprom_delay; | 1589 | struct ipw_priv *p = dev_get_drvdata(d); |
1590 | int n = p->eeprom_delay; | ||
1590 | return sprintf(buf, "%i\n", n); | 1591 | return sprintf(buf, "%i\n", n); |
1591 | } | 1592 | } |
1592 | static ssize_t store_eeprom_delay(struct device *d, | 1593 | static ssize_t store_eeprom_delay(struct device *d, |
1593 | struct device_attribute *attr, | 1594 | struct device_attribute *attr, |
1594 | const char *buf, size_t count) | 1595 | const char *buf, size_t count) |
1595 | { | 1596 | { |
1596 | struct ipw_priv *p = d->driver_data; | 1597 | struct ipw_priv *p = dev_get_drvdata(d); |
1597 | sscanf(buf, "%i", &p->eeprom_delay); | 1598 | sscanf(buf, "%i", &p->eeprom_delay); |
1598 | return strnlen(buf, count); | 1599 | return strnlen(buf, count); |
1599 | } | 1600 | } |
@@ -1605,7 +1606,7 @@ static ssize_t show_command_event_reg(struct device *d, | |||
1605 | struct device_attribute *attr, char *buf) | 1606 | struct device_attribute *attr, char *buf) |
1606 | { | 1607 | { |
1607 | u32 reg = 0; | 1608 | u32 reg = 0; |
1608 | struct ipw_priv *p = d->driver_data; | 1609 | struct ipw_priv *p = dev_get_drvdata(d); |
1609 | 1610 | ||
1610 | reg = ipw_read_reg32(p, IPW_INTERNAL_CMD_EVENT); | 1611 | reg = ipw_read_reg32(p, IPW_INTERNAL_CMD_EVENT); |
1611 | return sprintf(buf, "0x%08x\n", reg); | 1612 | return sprintf(buf, "0x%08x\n", reg); |
@@ -1615,7 +1616,7 @@ static ssize_t store_command_event_reg(struct device *d, | |||
1615 | const char *buf, size_t count) | 1616 | const char *buf, size_t count) |
1616 | { | 1617 | { |
1617 | u32 reg; | 1618 | u32 reg; |
1618 | struct ipw_priv *p = d->driver_data; | 1619 | struct ipw_priv *p = dev_get_drvdata(d); |
1619 | 1620 | ||
1620 | sscanf(buf, "%x", ®); | 1621 | sscanf(buf, "%x", ®); |
1621 | ipw_write_reg32(p, IPW_INTERNAL_CMD_EVENT, reg); | 1622 | ipw_write_reg32(p, IPW_INTERNAL_CMD_EVENT, reg); |
@@ -1629,7 +1630,7 @@ static ssize_t show_mem_gpio_reg(struct device *d, | |||
1629 | struct device_attribute *attr, char *buf) | 1630 | struct device_attribute *attr, char *buf) |
1630 | { | 1631 | { |
1631 | u32 reg = 0; | 1632 | u32 reg = 0; |
1632 | struct ipw_priv *p = d->driver_data; | 1633 | struct ipw_priv *p = dev_get_drvdata(d); |
1633 | 1634 | ||
1634 | reg = ipw_read_reg32(p, 0x301100); | 1635 | reg = ipw_read_reg32(p, 0x301100); |
1635 | return sprintf(buf, "0x%08x\n", reg); | 1636 | return sprintf(buf, "0x%08x\n", reg); |
@@ -1639,7 +1640,7 @@ static ssize_t store_mem_gpio_reg(struct device *d, | |||
1639 | const char *buf, size_t count) | 1640 | const char *buf, size_t count) |
1640 | { | 1641 | { |
1641 | u32 reg; | 1642 | u32 reg; |
1642 | struct ipw_priv *p = d->driver_data; | 1643 | struct ipw_priv *p = dev_get_drvdata(d); |
1643 | 1644 | ||
1644 | sscanf(buf, "%x", ®); | 1645 | sscanf(buf, "%x", ®); |
1645 | ipw_write_reg32(p, 0x301100, reg); | 1646 | ipw_write_reg32(p, 0x301100, reg); |
@@ -1653,7 +1654,7 @@ static ssize_t show_indirect_dword(struct device *d, | |||
1653 | struct device_attribute *attr, char *buf) | 1654 | struct device_attribute *attr, char *buf) |
1654 | { | 1655 | { |
1655 | u32 reg = 0; | 1656 | u32 reg = 0; |
1656 | struct ipw_priv *priv = d->driver_data; | 1657 | struct ipw_priv *priv = dev_get_drvdata(d); |
1657 | 1658 | ||
1658 | if (priv->status & STATUS_INDIRECT_DWORD) | 1659 | if (priv->status & STATUS_INDIRECT_DWORD) |
1659 | reg = ipw_read_reg32(priv, priv->indirect_dword); | 1660 | reg = ipw_read_reg32(priv, priv->indirect_dword); |
@@ -1666,7 +1667,7 @@ static ssize_t store_indirect_dword(struct device *d, | |||
1666 | struct device_attribute *attr, | 1667 | struct device_attribute *attr, |
1667 | const char *buf, size_t count) | 1668 | const char *buf, size_t count) |
1668 | { | 1669 | { |
1669 | struct ipw_priv *priv = d->driver_data; | 1670 | struct ipw_priv *priv = dev_get_drvdata(d); |
1670 | 1671 | ||
1671 | sscanf(buf, "%x", &priv->indirect_dword); | 1672 | sscanf(buf, "%x", &priv->indirect_dword); |
1672 | priv->status |= STATUS_INDIRECT_DWORD; | 1673 | priv->status |= STATUS_INDIRECT_DWORD; |
@@ -1680,7 +1681,7 @@ static ssize_t show_indirect_byte(struct device *d, | |||
1680 | struct device_attribute *attr, char *buf) | 1681 | struct device_attribute *attr, char *buf) |
1681 | { | 1682 | { |
1682 | u8 reg = 0; | 1683 | u8 reg = 0; |
1683 | struct ipw_priv *priv = d->driver_data; | 1684 | struct ipw_priv *priv = dev_get_drvdata(d); |
1684 | 1685 | ||
1685 | if (priv->status & STATUS_INDIRECT_BYTE) | 1686 | if (priv->status & STATUS_INDIRECT_BYTE) |
1686 | reg = ipw_read_reg8(priv, priv->indirect_byte); | 1687 | reg = ipw_read_reg8(priv, priv->indirect_byte); |
@@ -1693,7 +1694,7 @@ static ssize_t store_indirect_byte(struct device *d, | |||
1693 | struct device_attribute *attr, | 1694 | struct device_attribute *attr, |
1694 | const char *buf, size_t count) | 1695 | const char *buf, size_t count) |
1695 | { | 1696 | { |
1696 | struct ipw_priv *priv = d->driver_data; | 1697 | struct ipw_priv *priv = dev_get_drvdata(d); |
1697 | 1698 | ||
1698 | sscanf(buf, "%x", &priv->indirect_byte); | 1699 | sscanf(buf, "%x", &priv->indirect_byte); |
1699 | priv->status |= STATUS_INDIRECT_BYTE; | 1700 | priv->status |= STATUS_INDIRECT_BYTE; |
@@ -1707,7 +1708,7 @@ static ssize_t show_direct_dword(struct device *d, | |||
1707 | struct device_attribute *attr, char *buf) | 1708 | struct device_attribute *attr, char *buf) |
1708 | { | 1709 | { |
1709 | u32 reg = 0; | 1710 | u32 reg = 0; |
1710 | struct ipw_priv *priv = d->driver_data; | 1711 | struct ipw_priv *priv = dev_get_drvdata(d); |
1711 | 1712 | ||
1712 | if (priv->status & STATUS_DIRECT_DWORD) | 1713 | if (priv->status & STATUS_DIRECT_DWORD) |
1713 | reg = ipw_read32(priv, priv->direct_dword); | 1714 | reg = ipw_read32(priv, priv->direct_dword); |
@@ -1720,7 +1721,7 @@ static ssize_t store_direct_dword(struct device *d, | |||
1720 | struct device_attribute *attr, | 1721 | struct device_attribute *attr, |
1721 | const char *buf, size_t count) | 1722 | const char *buf, size_t count) |
1722 | { | 1723 | { |
1723 | struct ipw_priv *priv = d->driver_data; | 1724 | struct ipw_priv *priv = dev_get_drvdata(d); |
1724 | 1725 | ||
1725 | sscanf(buf, "%x", &priv->direct_dword); | 1726 | sscanf(buf, "%x", &priv->direct_dword); |
1726 | priv->status |= STATUS_DIRECT_DWORD; | 1727 | priv->status |= STATUS_DIRECT_DWORD; |
@@ -1747,7 +1748,7 @@ static ssize_t show_rf_kill(struct device *d, struct device_attribute *attr, | |||
1747 | 1 - SW based RF kill active (sysfs) | 1748 | 1 - SW based RF kill active (sysfs) |
1748 | 2 - HW based RF kill active | 1749 | 2 - HW based RF kill active |
1749 | 3 - Both HW and SW baed RF kill active */ | 1750 | 3 - Both HW and SW baed RF kill active */ |
1750 | struct ipw_priv *priv = d->driver_data; | 1751 | struct ipw_priv *priv = dev_get_drvdata(d); |
1751 | int val = ((priv->status & STATUS_RF_KILL_SW) ? 0x1 : 0x0) | | 1752 | int val = ((priv->status & STATUS_RF_KILL_SW) ? 0x1 : 0x0) | |
1752 | (rf_kill_active(priv) ? 0x2 : 0x0); | 1753 | (rf_kill_active(priv) ? 0x2 : 0x0); |
1753 | return sprintf(buf, "%i\n", val); | 1754 | return sprintf(buf, "%i\n", val); |
@@ -1791,7 +1792,7 @@ static int ipw_radio_kill_sw(struct ipw_priv *priv, int disable_radio) | |||
1791 | static ssize_t store_rf_kill(struct device *d, struct device_attribute *attr, | 1792 | static ssize_t store_rf_kill(struct device *d, struct device_attribute *attr, |
1792 | const char *buf, size_t count) | 1793 | const char *buf, size_t count) |
1793 | { | 1794 | { |
1794 | struct ipw_priv *priv = d->driver_data; | 1795 | struct ipw_priv *priv = dev_get_drvdata(d); |
1795 | 1796 | ||
1796 | ipw_radio_kill_sw(priv, buf[0] == '1'); | 1797 | ipw_radio_kill_sw(priv, buf[0] == '1'); |
1797 | 1798 | ||
@@ -1803,7 +1804,7 @@ static DEVICE_ATTR(rf_kill, S_IWUSR | S_IRUGO, show_rf_kill, store_rf_kill); | |||
1803 | static ssize_t show_speed_scan(struct device *d, struct device_attribute *attr, | 1804 | static ssize_t show_speed_scan(struct device *d, struct device_attribute *attr, |
1804 | char *buf) | 1805 | char *buf) |
1805 | { | 1806 | { |
1806 | struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; | 1807 | struct ipw_priv *priv = dev_get_drvdata(d); |
1807 | int pos = 0, len = 0; | 1808 | int pos = 0, len = 0; |
1808 | if (priv->config & CFG_SPEED_SCAN) { | 1809 | if (priv->config & CFG_SPEED_SCAN) { |
1809 | while (priv->speed_scan[pos] != 0) | 1810 | while (priv->speed_scan[pos] != 0) |
@@ -1818,7 +1819,7 @@ static ssize_t show_speed_scan(struct device *d, struct device_attribute *attr, | |||
1818 | static ssize_t store_speed_scan(struct device *d, struct device_attribute *attr, | 1819 | static ssize_t store_speed_scan(struct device *d, struct device_attribute *attr, |
1819 | const char *buf, size_t count) | 1820 | const char *buf, size_t count) |
1820 | { | 1821 | { |
1821 | struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; | 1822 | struct ipw_priv *priv = dev_get_drvdata(d); |
1822 | int channel, pos = 0; | 1823 | int channel, pos = 0; |
1823 | const char *p = buf; | 1824 | const char *p = buf; |
1824 | 1825 | ||
@@ -1857,14 +1858,14 @@ static DEVICE_ATTR(speed_scan, S_IWUSR | S_IRUGO, show_speed_scan, | |||
1857 | static ssize_t show_net_stats(struct device *d, struct device_attribute *attr, | 1858 | static ssize_t show_net_stats(struct device *d, struct device_attribute *attr, |
1858 | char *buf) | 1859 | char *buf) |
1859 | { | 1860 | { |
1860 | struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; | 1861 | struct ipw_priv *priv = dev_get_drvdata(d); |
1861 | return sprintf(buf, "%c\n", (priv->config & CFG_NET_STATS) ? '1' : '0'); | 1862 | return sprintf(buf, "%c\n", (priv->config & CFG_NET_STATS) ? '1' : '0'); |
1862 | } | 1863 | } |
1863 | 1864 | ||
1864 | static ssize_t store_net_stats(struct device *d, struct device_attribute *attr, | 1865 | static ssize_t store_net_stats(struct device *d, struct device_attribute *attr, |
1865 | const char *buf, size_t count) | 1866 | const char *buf, size_t count) |
1866 | { | 1867 | { |
1867 | struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; | 1868 | struct ipw_priv *priv = dev_get_drvdata(d); |
1868 | if (buf[0] == '1') | 1869 | if (buf[0] == '1') |
1869 | priv->config |= CFG_NET_STATS; | 1870 | priv->config |= CFG_NET_STATS; |
1870 | else | 1871 | else |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index dd8b15ed8296..6cdee0b4b486 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2268,7 +2268,7 @@ static int iwl_mac_get_stats(struct ieee80211_hw *hw, | |||
2268 | static ssize_t show_debug_level(struct device *d, | 2268 | static ssize_t show_debug_level(struct device *d, |
2269 | struct device_attribute *attr, char *buf) | 2269 | struct device_attribute *attr, char *buf) |
2270 | { | 2270 | { |
2271 | struct iwl_priv *priv = d->driver_data; | 2271 | struct iwl_priv *priv = dev_get_drvdata(d); |
2272 | 2272 | ||
2273 | return sprintf(buf, "0x%08X\n", priv->debug_level); | 2273 | return sprintf(buf, "0x%08X\n", priv->debug_level); |
2274 | } | 2274 | } |
@@ -2276,7 +2276,7 @@ static ssize_t store_debug_level(struct device *d, | |||
2276 | struct device_attribute *attr, | 2276 | struct device_attribute *attr, |
2277 | const char *buf, size_t count) | 2277 | const char *buf, size_t count) |
2278 | { | 2278 | { |
2279 | struct iwl_priv *priv = d->driver_data; | 2279 | struct iwl_priv *priv = dev_get_drvdata(d); |
2280 | unsigned long val; | 2280 | unsigned long val; |
2281 | int ret; | 2281 | int ret; |
2282 | 2282 | ||
@@ -2299,7 +2299,7 @@ static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO, | |||
2299 | static ssize_t show_version(struct device *d, | 2299 | static ssize_t show_version(struct device *d, |
2300 | struct device_attribute *attr, char *buf) | 2300 | struct device_attribute *attr, char *buf) |
2301 | { | 2301 | { |
2302 | struct iwl_priv *priv = d->driver_data; | 2302 | struct iwl_priv *priv = dev_get_drvdata(d); |
2303 | struct iwl_alive_resp *palive = &priv->card_alive; | 2303 | struct iwl_alive_resp *palive = &priv->card_alive; |
2304 | ssize_t pos = 0; | 2304 | ssize_t pos = 0; |
2305 | u16 eeprom_ver; | 2305 | u16 eeprom_ver; |
@@ -2330,7 +2330,7 @@ static DEVICE_ATTR(version, S_IWUSR | S_IRUGO, show_version, NULL); | |||
2330 | static ssize_t show_temperature(struct device *d, | 2330 | static ssize_t show_temperature(struct device *d, |
2331 | struct device_attribute *attr, char *buf) | 2331 | struct device_attribute *attr, char *buf) |
2332 | { | 2332 | { |
2333 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2333 | struct iwl_priv *priv = dev_get_drvdata(d); |
2334 | 2334 | ||
2335 | if (!iwl_is_alive(priv)) | 2335 | if (!iwl_is_alive(priv)) |
2336 | return -EAGAIN; | 2336 | return -EAGAIN; |
@@ -2343,7 +2343,7 @@ static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL); | |||
2343 | static ssize_t show_tx_power(struct device *d, | 2343 | static ssize_t show_tx_power(struct device *d, |
2344 | struct device_attribute *attr, char *buf) | 2344 | struct device_attribute *attr, char *buf) |
2345 | { | 2345 | { |
2346 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2346 | struct iwl_priv *priv = dev_get_drvdata(d); |
2347 | 2347 | ||
2348 | if (!iwl_is_ready_rf(priv)) | 2348 | if (!iwl_is_ready_rf(priv)) |
2349 | return sprintf(buf, "off\n"); | 2349 | return sprintf(buf, "off\n"); |
@@ -2355,7 +2355,7 @@ static ssize_t store_tx_power(struct device *d, | |||
2355 | struct device_attribute *attr, | 2355 | struct device_attribute *attr, |
2356 | const char *buf, size_t count) | 2356 | const char *buf, size_t count) |
2357 | { | 2357 | { |
2358 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2358 | struct iwl_priv *priv = dev_get_drvdata(d); |
2359 | unsigned long val; | 2359 | unsigned long val; |
2360 | int ret; | 2360 | int ret; |
2361 | 2361 | ||
@@ -2373,7 +2373,7 @@ static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power); | |||
2373 | static ssize_t show_flags(struct device *d, | 2373 | static ssize_t show_flags(struct device *d, |
2374 | struct device_attribute *attr, char *buf) | 2374 | struct device_attribute *attr, char *buf) |
2375 | { | 2375 | { |
2376 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2376 | struct iwl_priv *priv = dev_get_drvdata(d); |
2377 | 2377 | ||
2378 | return sprintf(buf, "0x%04X\n", priv->active_rxon.flags); | 2378 | return sprintf(buf, "0x%04X\n", priv->active_rxon.flags); |
2379 | } | 2379 | } |
@@ -2382,7 +2382,7 @@ static ssize_t store_flags(struct device *d, | |||
2382 | struct device_attribute *attr, | 2382 | struct device_attribute *attr, |
2383 | const char *buf, size_t count) | 2383 | const char *buf, size_t count) |
2384 | { | 2384 | { |
2385 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2385 | struct iwl_priv *priv = dev_get_drvdata(d); |
2386 | unsigned long val; | 2386 | unsigned long val; |
2387 | u32 flags; | 2387 | u32 flags; |
2388 | int ret = strict_strtoul(buf, 0, &val); | 2388 | int ret = strict_strtoul(buf, 0, &val); |
@@ -2411,7 +2411,7 @@ static DEVICE_ATTR(flags, S_IWUSR | S_IRUGO, show_flags, store_flags); | |||
2411 | static ssize_t show_filter_flags(struct device *d, | 2411 | static ssize_t show_filter_flags(struct device *d, |
2412 | struct device_attribute *attr, char *buf) | 2412 | struct device_attribute *attr, char *buf) |
2413 | { | 2413 | { |
2414 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2414 | struct iwl_priv *priv = dev_get_drvdata(d); |
2415 | 2415 | ||
2416 | return sprintf(buf, "0x%04X\n", | 2416 | return sprintf(buf, "0x%04X\n", |
2417 | le32_to_cpu(priv->active_rxon.filter_flags)); | 2417 | le32_to_cpu(priv->active_rxon.filter_flags)); |
@@ -2421,7 +2421,7 @@ static ssize_t store_filter_flags(struct device *d, | |||
2421 | struct device_attribute *attr, | 2421 | struct device_attribute *attr, |
2422 | const char *buf, size_t count) | 2422 | const char *buf, size_t count) |
2423 | { | 2423 | { |
2424 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2424 | struct iwl_priv *priv = dev_get_drvdata(d); |
2425 | unsigned long val; | 2425 | unsigned long val; |
2426 | u32 filter_flags; | 2426 | u32 filter_flags; |
2427 | int ret = strict_strtoul(buf, 0, &val); | 2427 | int ret = strict_strtoul(buf, 0, &val); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index dc0359ce1ec0..9f5191a84a13 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -3595,7 +3595,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3595 | static ssize_t show_debug_level(struct device *d, | 3595 | static ssize_t show_debug_level(struct device *d, |
3596 | struct device_attribute *attr, char *buf) | 3596 | struct device_attribute *attr, char *buf) |
3597 | { | 3597 | { |
3598 | struct iwl_priv *priv = d->driver_data; | 3598 | struct iwl_priv *priv = dev_get_drvdata(d); |
3599 | 3599 | ||
3600 | return sprintf(buf, "0x%08X\n", priv->debug_level); | 3600 | return sprintf(buf, "0x%08X\n", priv->debug_level); |
3601 | } | 3601 | } |
@@ -3603,7 +3603,7 @@ static ssize_t store_debug_level(struct device *d, | |||
3603 | struct device_attribute *attr, | 3603 | struct device_attribute *attr, |
3604 | const char *buf, size_t count) | 3604 | const char *buf, size_t count) |
3605 | { | 3605 | { |
3606 | struct iwl_priv *priv = d->driver_data; | 3606 | struct iwl_priv *priv = dev_get_drvdata(d); |
3607 | unsigned long val; | 3607 | unsigned long val; |
3608 | int ret; | 3608 | int ret; |
3609 | 3609 | ||
@@ -3624,7 +3624,7 @@ static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO, | |||
3624 | static ssize_t show_temperature(struct device *d, | 3624 | static ssize_t show_temperature(struct device *d, |
3625 | struct device_attribute *attr, char *buf) | 3625 | struct device_attribute *attr, char *buf) |
3626 | { | 3626 | { |
3627 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3627 | struct iwl_priv *priv = dev_get_drvdata(d); |
3628 | 3628 | ||
3629 | if (!iwl_is_alive(priv)) | 3629 | if (!iwl_is_alive(priv)) |
3630 | return -EAGAIN; | 3630 | return -EAGAIN; |
@@ -3637,7 +3637,7 @@ static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL); | |||
3637 | static ssize_t show_tx_power(struct device *d, | 3637 | static ssize_t show_tx_power(struct device *d, |
3638 | struct device_attribute *attr, char *buf) | 3638 | struct device_attribute *attr, char *buf) |
3639 | { | 3639 | { |
3640 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3640 | struct iwl_priv *priv = dev_get_drvdata(d); |
3641 | return sprintf(buf, "%d\n", priv->tx_power_user_lmt); | 3641 | return sprintf(buf, "%d\n", priv->tx_power_user_lmt); |
3642 | } | 3642 | } |
3643 | 3643 | ||
@@ -3645,7 +3645,7 @@ static ssize_t store_tx_power(struct device *d, | |||
3645 | struct device_attribute *attr, | 3645 | struct device_attribute *attr, |
3646 | const char *buf, size_t count) | 3646 | const char *buf, size_t count) |
3647 | { | 3647 | { |
3648 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3648 | struct iwl_priv *priv = dev_get_drvdata(d); |
3649 | char *p = (char *)buf; | 3649 | char *p = (char *)buf; |
3650 | u32 val; | 3650 | u32 val; |
3651 | 3651 | ||
@@ -3663,7 +3663,7 @@ static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power); | |||
3663 | static ssize_t show_flags(struct device *d, | 3663 | static ssize_t show_flags(struct device *d, |
3664 | struct device_attribute *attr, char *buf) | 3664 | struct device_attribute *attr, char *buf) |
3665 | { | 3665 | { |
3666 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3666 | struct iwl_priv *priv = dev_get_drvdata(d); |
3667 | 3667 | ||
3668 | return sprintf(buf, "0x%04X\n", priv->active_rxon.flags); | 3668 | return sprintf(buf, "0x%04X\n", priv->active_rxon.flags); |
3669 | } | 3669 | } |
@@ -3672,7 +3672,7 @@ static ssize_t store_flags(struct device *d, | |||
3672 | struct device_attribute *attr, | 3672 | struct device_attribute *attr, |
3673 | const char *buf, size_t count) | 3673 | const char *buf, size_t count) |
3674 | { | 3674 | { |
3675 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3675 | struct iwl_priv *priv = dev_get_drvdata(d); |
3676 | u32 flags = simple_strtoul(buf, NULL, 0); | 3676 | u32 flags = simple_strtoul(buf, NULL, 0); |
3677 | 3677 | ||
3678 | mutex_lock(&priv->mutex); | 3678 | mutex_lock(&priv->mutex); |
@@ -3697,7 +3697,7 @@ static DEVICE_ATTR(flags, S_IWUSR | S_IRUGO, show_flags, store_flags); | |||
3697 | static ssize_t show_filter_flags(struct device *d, | 3697 | static ssize_t show_filter_flags(struct device *d, |
3698 | struct device_attribute *attr, char *buf) | 3698 | struct device_attribute *attr, char *buf) |
3699 | { | 3699 | { |
3700 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3700 | struct iwl_priv *priv = dev_get_drvdata(d); |
3701 | 3701 | ||
3702 | return sprintf(buf, "0x%04X\n", | 3702 | return sprintf(buf, "0x%04X\n", |
3703 | le32_to_cpu(priv->active_rxon.filter_flags)); | 3703 | le32_to_cpu(priv->active_rxon.filter_flags)); |
@@ -3707,7 +3707,7 @@ static ssize_t store_filter_flags(struct device *d, | |||
3707 | struct device_attribute *attr, | 3707 | struct device_attribute *attr, |
3708 | const char *buf, size_t count) | 3708 | const char *buf, size_t count) |
3709 | { | 3709 | { |
3710 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3710 | struct iwl_priv *priv = dev_get_drvdata(d); |
3711 | u32 filter_flags = simple_strtoul(buf, NULL, 0); | 3711 | u32 filter_flags = simple_strtoul(buf, NULL, 0); |
3712 | 3712 | ||
3713 | mutex_lock(&priv->mutex); | 3713 | mutex_lock(&priv->mutex); |
@@ -3992,7 +3992,7 @@ static DEVICE_ATTR(antenna, S_IWUSR | S_IRUGO, show_antenna, store_antenna); | |||
3992 | static ssize_t show_status(struct device *d, | 3992 | static ssize_t show_status(struct device *d, |
3993 | struct device_attribute *attr, char *buf) | 3993 | struct device_attribute *attr, char *buf) |
3994 | { | 3994 | { |
3995 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3995 | struct iwl_priv *priv = dev_get_drvdata(d); |
3996 | if (!iwl_is_alive(priv)) | 3996 | if (!iwl_is_alive(priv)) |
3997 | return -EAGAIN; | 3997 | return -EAGAIN; |
3998 | return sprintf(buf, "0x%08x\n", (int)priv->status); | 3998 | return sprintf(buf, "0x%08x\n", (int)priv->status); |
@@ -4004,10 +4004,11 @@ static ssize_t dump_error_log(struct device *d, | |||
4004 | struct device_attribute *attr, | 4004 | struct device_attribute *attr, |
4005 | const char *buf, size_t count) | 4005 | const char *buf, size_t count) |
4006 | { | 4006 | { |
4007 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
4007 | char *p = (char *)buf; | 4008 | char *p = (char *)buf; |
4008 | 4009 | ||
4009 | if (p[0] == '1') | 4010 | if (p[0] == '1') |
4010 | iwl3945_dump_nic_error_log((struct iwl_priv *)d->driver_data); | 4011 | iwl3945_dump_nic_error_log(priv); |
4011 | 4012 | ||
4012 | return strnlen(buf, count); | 4013 | return strnlen(buf, count); |
4013 | } | 4014 | } |
@@ -4018,10 +4019,11 @@ static ssize_t dump_event_log(struct device *d, | |||
4018 | struct device_attribute *attr, | 4019 | struct device_attribute *attr, |
4019 | const char *buf, size_t count) | 4020 | const char *buf, size_t count) |
4020 | { | 4021 | { |
4022 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
4021 | char *p = (char *)buf; | 4023 | char *p = (char *)buf; |
4022 | 4024 | ||
4023 | if (p[0] == '1') | 4025 | if (p[0] == '1') |
4024 | iwl3945_dump_nic_event_log((struct iwl_priv *)d->driver_data); | 4026 | iwl3945_dump_nic_event_log(priv); |
4025 | 4027 | ||
4026 | return strnlen(buf, count); | 4028 | return strnlen(buf, count); |
4027 | } | 4029 | } |