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-next>] [day] [month] [year] [list]
Message-ID: <1363683500-24891-1-git-send-email-ldewangan@nvidia.com>
Date:	Tue, 19 Mar 2013 14:28:20 +0530
From:	Laxman Dewangan <ldewangan@...dia.com>
To:	<sameo@...ux.intel.com>
CC:	<swarren@...dia.com>, <broonie@...nsource.wolfsonmicro.com>,
	<gg@...mlogic.co.uk>, <linux-kernel@...r.kernel.org>,
	Laxman Dewangan <ldewangan@...dia.com>
Subject: [PATCH] mfd: palmas: initialise client->of_node for dummy created client

Palmas device have three different i2c addresses. The device creates
the two new dummy i2c clients for accessing the register by using
primary client adapter. This new dummy i2c client have their of_node
as NULL.

The dummy i2c client is used for registering interrupt and on this,
it creates irq domain handle. This created irq domain handle has
their of_node as NULL.

Now when any child of this device is registered through the DT as
follows:
         palmas: tps65913@58 {
         	::::::::::::::::::

         	#interrupt-cells = <2>;
                interrupt-controller;

                palmas_rtc {
                       compatible = "ti,palmas-rtc";
                       interrupt-parent = <&palmas>;
                       interrupts = <8 0>;
                };
                ::::::::::;;;
         };

And child driver (palam-rtc in this case) get their irq number as
	irq = platform_get_irq(pdev, 0);

The returned irq number is error in this case. The reason is that
the created irq_domain handle for the palmas interrupt does not have
valid node and so matching of node fails with palmas node.

Hence initialising the newly dummy created client->of_node with the
primary clients of_node so that irq_domain handle have proper of_node
for matching.

Signed-off-by: Laxman Dewangan <ldewangan@...dia.com>
---
 drivers/mfd/palmas.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
index 73bf76d..a3f2836 100644
--- a/drivers/mfd/palmas.c
+++ b/drivers/mfd/palmas.c
@@ -349,6 +349,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
 				ret = -ENOMEM;
 				goto err;
 			}
+			palmas->i2c_clients[i]->dev.of_node = of_node_get(node);
 		}
 		palmas->regmap[i] = devm_regmap_init_i2c(palmas->i2c_clients[i],
 				&palmas_regmap_config[i]);
-- 
1.7.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ