lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 02 Feb 2010 07:31:22 -0800 (PST)
From:	David Miller <davem@...emloft.net>
To:	kristoffer@...sler.com
Cc:	netdev@...r.kernel.org, shemminger@...tta.com
Subject: Re: [PATCH 1/1 V5] net: Add Aeroflex Gaisler 10/100/1G Ethernet
 MAC driver

From: Kristoffer Glembo <kristoffer@...sler.com>
Date: Thu, 28 Jan 2010 08:43:49 +0100

> +	struct amba_prom_registers *prom_regs;
> +	unsigned int addr;
 ...
> +	irqs = (int *) of_get_property(ofdev->node, "interrupts", NULL);
> +	prom_regs = (struct amba_prom_registers *) of_get_property(ofdev->node, "reg", NULL);
 ...
> +	addr = prom_regs->phys_addr;
 ...
> +struct amba_prom_registers {
> +	unsigned int phys_addr;
> +	unsigned int reg_size;
> +};

These kinds of constructs should never be necessary in an OF driver.

The device probing layer calculates OF device resources that you can
use to obtain the register (op->resource[]) and IRQ (op->irq[])
mappings portably.

And you use of_ioremap() on the resource object to map the register
I/O space properly, and of_iounmap() it on unload.

See drivers/net/niu.c:niu_of_probe() for an example.

Please fix this up, thank you.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists