staging: brcm80211: bugfix for 32 bit power pc platform
On some platforms resource_size_t == 64 but but unsigned long is only 32-bits. In this particular problem, reported and fixed by Tony Breeds, a physical address was truncated as a result. Reported-by: Tony Breeds <tony@bakeyournoodle.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Roland Vossen <rvossen@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b5a44c8ad3
commit
b6f29edecd
@@ -752,12 +752,11 @@ static int brcms_set_hint(struct brcms_info *wl, char *abbrev)
|
|||||||
* is called in brcms_pci_probe() context, therefore no locking required.
|
* is called in brcms_pci_probe() context, therefore no locking required.
|
||||||
*/
|
*/
|
||||||
static struct brcms_info *brcms_attach(u16 vendor, u16 device,
|
static struct brcms_info *brcms_attach(u16 vendor, u16 device,
|
||||||
unsigned long regs,
|
resource_size_t regs,
|
||||||
struct pci_dev *btparam, uint irq)
|
struct pci_dev *btparam, uint irq)
|
||||||
{
|
{
|
||||||
struct brcms_info *wl = NULL;
|
struct brcms_info *wl = NULL;
|
||||||
int unit, err;
|
int unit, err;
|
||||||
unsigned long base_addr;
|
|
||||||
struct ieee80211_hw *hw;
|
struct ieee80211_hw *hw;
|
||||||
u8 perm[ETH_ALEN];
|
u8 perm[ETH_ALEN];
|
||||||
|
|
||||||
@@ -780,11 +779,7 @@ static struct brcms_info *brcms_attach(u16 vendor, u16 device,
|
|||||||
/* setup the bottom half handler */
|
/* setup the bottom half handler */
|
||||||
tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl);
|
tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl);
|
||||||
|
|
||||||
|
wl->regsva = ioremap_nocache(regs, PCI_BAR0_WINSZ);
|
||||||
|
|
||||||
base_addr = regs;
|
|
||||||
|
|
||||||
wl->regsva = ioremap_nocache(base_addr, PCI_BAR0_WINSZ);
|
|
||||||
if (wl->regsva == NULL) {
|
if (wl->regsva == NULL) {
|
||||||
wiphy_err(wl->wiphy, "wl%d: ioremap() failed\n", unit);
|
wiphy_err(wl->wiphy, "wl%d: ioremap() failed\n", unit);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
Reference in New Issue
Block a user