From patchwork Tue Aug 21 09:15:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1353091 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E858940210 for ; Tue, 21 Aug 2012 09:21:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755493Ab2HUJUf (ORCPT ); Tue, 21 Aug 2012 05:20:35 -0400 Received: from na3sys009aog133.obsmtp.com ([74.125.149.82]:53377 "EHLO na3sys009aog133.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755483Ab2HUJUb (ORCPT ); Tue, 21 Aug 2012 05:20:31 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]) (using TLSv1) by na3sys009aob133.postini.com ([74.125.148.12]) with SMTP ID DSNKUDNS3VAkJ5S6LFCqwA3G6UcDHbZh3j2d@postini.com; Tue, 21 Aug 2012 02:20:30 PDT Received: by lban1 with SMTP id n1so3872493lba.34 for ; Tue, 21 Aug 2012 02:20:28 -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=iHdp1nzecBbCkRhS792+W4QGAAVHJ2UTSc6hjgTaZw0=; b=EWDa98bamKaMWn+j1e47fsiHSGznUhl6XSFtCUDfyP67+UeluSCEmj5zwjknt5jryh cDUHCjwKLhSiwqMR+PVMdx0eIKRVBJKg2pDXGlRI5lQ1VaxygDpuo3+CVx+0PYn6IDBi mJLeydEX5KP884UZ2j12zEW9jkEnvsPhdblOQ627aYVywKBNrv4QxSYKxdOrk9fxqWc0 gC118bqIJzcI0bLrb/kzOa+TDPMtgLhoxSs/l8DBRlgYJNfrAq82jtefu0D/QJEQRDl2 4COiU765/tjWc/HEpGLM96x/Fc4ue/F8gutOZ6syFLDEOkh8oGAl7zCWq4j8dwskUtai 5ajA== Received: by 10.112.37.8 with SMTP id u8mr7382178lbj.30.1345540828259; Tue, 21 Aug 2012 02:20:28 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id h8sm281499lbi.13.2012.08.21.02.20.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2012 02:20:27 -0700 (PDT) From: Felipe Balbi To: alan@linux.intel.com Cc: 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 , Felipe Balbi Subject: [RFC/PATCH 11/13] serial: omap: set dev->drvdata before enabling pm_runtime Date: Tue, 21 Aug 2012 12:15:53 +0300 Message-Id: <1345540555-24359-12-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc3 In-Reply-To: <1345540555-24359-1-git-send-email-balbi@ti.com> References: <1345540555-24359-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQn1cjMUdhfXnHeSr3wNgdtcp/iIM2nV9cJxUyboMuP75P42ed3zK/NEI7/vuZWih1H6mWhT 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. 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 458d77c..ba9cdf1 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1298,6 +1298,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); @@ -1317,7 +1318,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: