From patchwork Tue Mar 17 09:36:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6029481 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3A3B4BF90F for ; Tue, 17 Mar 2015 09:39:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E2E820459 for ; Tue, 17 Mar 2015 09:39:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 72A6120035 for ; Tue, 17 Mar 2015 09:39:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932233AbbCQJiv (ORCPT ); Tue, 17 Mar 2015 05:38:51 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:34305 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934018AbbCQJhZ (ORCPT ); Tue, 17 Mar 2015 05:37:25 -0400 Received: by wegp1 with SMTP id p1so3110723weg.1; Tue, 17 Mar 2015 02:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=iAvKjZ8VW1ov7deyjIwc0Ppm3qiUe1Ti51jbBVya/9A=; b=mbEkEwJ2QxhAhL/U9hPfw1PkJ80ywaz3EbCFy7EOvv6LYRBSVY8kuzkF3Ri5p0UXwo 95/+Ho4hLOIE3sMn9Tor+T1PFIQONshbatQji8dMN+RRk54Ll2pDN9r4otcKy4Ri6ClV og6pie6Wps5IupsfR2liNFEhoU/c2Ve7gMjk3DHFIIDM6223q/otpSMdUD7NOiLISzKz 2NibbbdOm9WPt9bNyiGhcfGm/IdROeN3Oxz6iK5qHRltbnF8/2mqODdOwUCIO+pG9lmu JXhI7kcUq72RiHTXTMr47EZHXMAz7l2ABUC5uEeibhFLFaMIsw40ptAn+NuCmUZx5KfC JAPg== X-Received: by 10.194.61.51 with SMTP id m19mr132086856wjr.39.1426585043701; Tue, 17 Mar 2015 02:37:23 -0700 (PDT) Received: from cizrna.lan ([109.72.12.78]) by mx.google.com with ESMTPSA id q10sm19113700wjr.41.2015.03.17.02.37.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2015 02:37:22 -0700 (PDT) From: Tomeu Vizoso To: linux-tegra@vger.kernel.org Cc: Mikko Perttunen , Tomeu Vizoso , MyungJoo Ham , Kyungmin Park , Stephen Warren , Thierry Reding , Alexandre Courbot , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 6/8] PM / devfreq: tegra: Set drvdata before enabling the irq Date: Tue, 17 Mar 2015 10:36:16 +0100 Message-Id: <1426584991-11110-7-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1426584991-11110-1-git-send-email-tomeu.vizoso@collabora.com> References: <1426584991-11110-1-git-send-email-tomeu.vizoso@collabora.com> 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_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 To avoid a race in which the interrupt will be handled before the drvdata has been set up. Signed-off-by: Tomeu Vizoso --- drivers/devfreq/tegra-devfreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c index 1de3f8b..23be954 100644 --- a/drivers/devfreq/tegra-devfreq.c +++ b/drivers/devfreq/tegra-devfreq.c @@ -697,6 +697,8 @@ static int tegra_devfreq_probe(struct platform_device *pdev) return -ENODEV; } + platform_set_drvdata(pdev, tegra); + err = devm_request_threaded_irq(&pdev->dev, irq, actmon_isr, actmon_thread_isr, IRQF_SHARED, "tegra-devfreq", tegra); @@ -705,8 +707,6 @@ static int tegra_devfreq_probe(struct platform_device *pdev) return err; } - platform_set_drvdata(pdev, tegra); - tegra_devfreq_profile.initial_freq = clk_get_rate(tegra->emc_clock); tegra->devfreq = devm_devfreq_add_device(&pdev->dev, &tegra_devfreq_profile,