From patchwork Thu Nov 22 06:50:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 1786941 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B695CE013C for ; Thu, 22 Nov 2012 19:49:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757101Ab2KVTtc (ORCPT ); Thu, 22 Nov 2012 14:49:32 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:49367 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756430Ab2KVTt3 (ORCPT ); Thu, 22 Nov 2012 14:49:29 -0500 Received: by mail-pb0-f46.google.com with SMTP id wy7so6055875pbc.19 for ; Thu, 22 Nov 2012 11:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:to:cc:in-reply-to:references:from:subject :mime-version:content-type; bh=A7g3VUaI61dxwYcVs964H+YdVRl8i9YEuLxqmmhYr+A=; b=ABld0Enxgg5Kx5x+0t+ZquqeU+rcNOBI4+sNq49diZ5bv5rhJpnMdNG0de2J7wLnX7 q8Ioe47arW6TyEtiMhsCFS6e2Mxui4SjqFMIfEDbVF9OVeELvIwky1qzEcriu87DYIcr tW8iFXWWar8w/6lEJYQB+KWqskKVwHsDxGHs/jriPGGAOEfBtyeLOYR9r8jFtc53ZfLZ oPqkAEu0ex47QvItk4iAm1vLoWUnAzmPQM/JSbPIW13QVryb69OrfuyqiLXzg626GYfZ rHovSo5eH9Xv3RX9SwV9a8QSj9ww/hAJFJdUQA6wTidncVPdsm2vBj5Le73M+vJfVhF7 YR0g== Received: by 10.66.84.163 with SMTP id a3mr24647907paz.2.1353567014580; Wed, 21 Nov 2012 22:50:14 -0800 (PST) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPS id un16sm1557466pbc.47.2012.11.21.22.50.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 22:50:12 -0800 (PST) Date: Wed, 21 Nov 2012 22:50:12 -0800 (PST) Message-ID: <87r4nmuo66.wl%kuninori.morimoto.gx@renesas.com> To: Zhang Rui Cc: Simon , Magnus , linux-pm@vger.kernel.org, Kuninori Morimoto In-Reply-To: <87sj82uo7o.wl%kuninori.morimoto.gx@renesas.com> References: <87sj82uo7o.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 1/2] thermal: rcar: add rcar_zone_to_priv() macro MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patch adds rcar_zone_to_priv() which is a helper macro for gettign private data. Signed-off-by: Kuninori Morimoto --- drivers/thermal/rcar_thermal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index f7a1b57..454035c 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -43,6 +43,8 @@ struct rcar_thermal_priv { u32 comp; }; +#define rcar_zone_to_priv(zone) (zone->devdata) + /* * basic functions */ @@ -96,7 +98,7 @@ static void rcar_thermal_bset(struct rcar_thermal_priv *priv, u32 reg, static int rcar_thermal_get_temp(struct thermal_zone_device *zone, unsigned long *temp) { - struct rcar_thermal_priv *priv = zone->devdata; + struct rcar_thermal_priv *priv = rcar_zone_to_priv(zone); int val, min, max, tmp; tmp = -200; /* default */ @@ -235,7 +237,7 @@ error_free_priv: static int rcar_thermal_remove(struct platform_device *pdev) { struct thermal_zone_device *zone = platform_get_drvdata(pdev); - struct rcar_thermal_priv *priv = zone->devdata; + struct rcar_thermal_priv *priv = rcar_zone_to_priv(zone); thermal_zone_device_unregister(zone); platform_set_drvdata(pdev, NULL);