From patchwork Thu Sep 6 12:45:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1414141 Return-Path: X-Original-To: patchwork-linux-omap@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 321F5DFFCF for ; Thu, 6 Sep 2012 12:50:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755247Ab2IFMug (ORCPT ); Thu, 6 Sep 2012 08:50:36 -0400 Received: from na3sys009aog123.obsmtp.com ([74.125.149.149]:34888 "EHLO na3sys009aog123.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755428Ab2IFMuf (ORCPT ); Thu, 6 Sep 2012 08:50:35 -0400 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]) (using TLSv1) by na3sys009aob123.postini.com ([74.125.148.12]) with SMTP ID DSNKUEicGf6janRWIsLENTb8fGRkmzC0s4Ya@postini.com; Thu, 06 Sep 2012 05:50:35 PDT Received: by lagy9 with SMTP id y9so1063187lag.19 for ; Thu, 06 Sep 2012 05:50:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=hRZ37iCmETHWvMV3WppK4GqVYbLfT5OzbBuJGPszXok=; b=lQj2ta3JPYxbEiFmKbZTYzwqnpb7sfeaRiTPjtPY7FP3nLR/zseWFg5ufNDhMnauCI F044nUYhjrd1JCpjrBVpL22vYNgKz45Orh79L+dIT17nR1C/D7CcOGJJIh4DWSd1BZLv 0OMDfm07wy+HUbgBNVlpnfov96p1ofBkMf+jOHDncZXbxwaSm/2bpuvzFC0g2FZIMeQw 6X1dyMrSa817njGRyO0+/mBiTtvNniYo8g8kFqeywbatoJqvb1VASnnaFez60NevxexO +ARkxPsNlrKb3Y8yMa+pm2LnSFlQiQb67r4QcJSEpkxywi9xSHwHDtQY7qvWk24GDoQC jeZA== Received: by 10.112.28.233 with SMTP id e9mr839648lbh.43.1346935831003; Thu, 06 Sep 2012 05:50:31 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id ba4sm561552lbb.14.2012.09.06.05.50.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 05:50:30 -0700 (PDT) From: Felipe Balbi To: Greg KH Cc: alan@linux.intel.com, Tony Lindgren , Kevin Hilman , Linux OMAP Mailing List , Linux ARM Kernel Mailing List , linux-serial@vger.kernel.org, Linux Kernel Mailing List , Santosh Shilimkar , Shubhrajyoti Datta , Sourav Poddar , Felipe Balbi Subject: [PATCH v4 08/21] serial: omap: set dev->drvdata before enabling pm_runtime Date: Thu, 6 Sep 2012 15:45:27 +0300 Message-Id: <1346935540-1792-9-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc3 In-Reply-To: <1346935540-1792-1-git-send-email-balbi@ti.com> References: <20120906122948.GC29202@arwen.pp.htv.fi> <1346935540-1792-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQlHke2By5rXV7ZDH19SqPHuOGKTr5k5EMLty30uiCwyrauHEaW6BWGNVYOX2u5C1Guw4fjQ Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org by the time we call our first pm_runtme_get_sync() after enable pm_runtime, our resume method might be called. To avoid problems, we must make sure that our dev->drvdata is set correctly before our resume method gets called. Tested-by: Shubhrajyoti D Acked-by: Santosh Shilimkar Signed-off-by: Felipe Balbi --- drivers/tty/serial/omap-serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index b2043df..8a696a4 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1333,6 +1333,7 @@ static int serial_omap_probe(struct platform_device *pdev) serial_omap_uart_wq = create_singlethread_workqueue(up->name); INIT_WORK(&up->qos_work, serial_omap_uart_qos_work); + platform_set_drvdata(pdev, up); pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_set_autosuspend_delay(&pdev->dev, omap_up_info->autosuspend_timeout); @@ -1352,7 +1353,6 @@ static int serial_omap_probe(struct platform_device *pdev) pm_runtime_mark_last_busy(up->dev); pm_runtime_put_autosuspend(up->dev); - platform_set_drvdata(pdev, up); return 0; err_add_port: