From patchwork Mon Jul 14 11:12:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laxman Dewangan X-Patchwork-Id: 4544621 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 90943C0514 for ; Mon, 14 Jul 2014 11:13:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C638F2012F for ; Mon, 14 Jul 2014 11:13:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED72920131 for ; Mon, 14 Jul 2014 11:13:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753869AbaGNLNX (ORCPT ); Mon, 14 Jul 2014 07:13:23 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:19879 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752252AbaGNLNX (ORCPT ); Mon, 14 Jul 2014 07:13:23 -0400 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Mon, 14 Jul 2014 04:12:39 -0700 Received: from hqemhub02.nvidia.com ([172.20.12.94]) by hqnvupgp08.nvidia.com (PGP Universal service); Mon, 14 Jul 2014 04:06:04 -0700 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Mon, 14 Jul 2014 04:06:04 -0700 Received: from ldewanganubuntu-System-Product-Name.nvidia.com (172.20.144.16) by hqemhub02.nvidia.com (172.20.150.31) with Microsoft SMTP Server (TLS) id 8.3.342.0; Mon, 14 Jul 2014 04:13:22 -0700 From: Laxman Dewangan To: , CC: , , Laxman Dewangan Subject: [PATCH] thermal: of: look for sensor driver parent node if device node missing Date: Mon, 14 Jul 2014 16:42:34 +0530 Message-ID: <1405336354-31310-1-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 1.8.1.5 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are some mfd devices which supports junction thermal interrupt like ams,AS3722. The DT binding of these devices are defined as the flat and drivers for sub module of such devices are registered as the mfd_add_devices. In this method, the sub devices registered as platform driver and these do not have the of_node pointer on their device structure. In this case, use the parent of_node pointer to get the required of_node pointer. Signed-off-by: Laxman Dewangan --- drivers/thermal/of-thermal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index 04b1be7..85a7d71 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -396,6 +396,8 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id, return ERR_PTR(-EINVAL); sensor_np = dev->of_node; + if (!sensor_np && dev->parent) + sensor_np = dev->parent->of_node; for_each_child_of_node(np, child) { struct of_phandle_args sensor_specs;