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] [thread-next>] [day] [month] [year] [list]
Message-ID: <51A85BEE.4000009@monstr.eu>
Date:	Fri, 31 May 2013 10:14:38 +0200
From:	Michal Simek <monstr@...str.eu>
To:	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>
CC:	Michal Simek <michal.simek@...inx.com>,
	Grant Likely <grant.likely@...aro.org>,
	devicetree-discuss@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
	Rob Herring <rob.herring@...xeda.com>
Subject: Re: [PATCH] of: Export of_irq_count for using in modules

Hi Jean-Christophe,

On 05/30/2013 10:17 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 15:49 Thu 30 May     , Michal Simek wrote:
>> Export of_irq_count for modules.
> 
> can you explain why do you need to call of_irq_count

I need to count number of irq written in the DTS node.
It is not fixed size that's why I need to proper way how to
find it out.

I am using this loop.
	count = of_irq_count(pdev->dev.of_node);
	/* Alloc IRQ based on DTS to be sure that no other driver will use it */
	while (count--) {
		tmp->irq = irq_of_parse_and_map(pdev->dev.of_node, count);
		dev_info(&pdev->dev, "%d: Alloc irq: %d\n", count, tmp->irq);
		ret = request_irq(tmp->irq, zynq_remoteproc_interrupt, 0,
					dev_name(&pdev->dev), &pdev->dev);
		if (ret) {
			...
		}
	}

But of course if you think that this is incorrect to export it
I can use what it is in of_irq_count body
368 int of_irq_count(struct device_node *dev)
369 {
370         int nr = 0;
371
372         while (of_irq_to_resource(dev, nr, NULL))
373                 nr++;
374
375         return nr;
376 }

Because of_irq_to_resource is exported for modules.
Or is there any better way how to loop over all interrupts in DT node?

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



Download attachment "signature.asc" of type "application/pgp-signature" (264 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ