From patchwork Tue Aug 21 12:16:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1354631 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 8CD6EDFB34 for ; Tue, 21 Aug 2012 12:22:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757377Ab2HUMVg (ORCPT ); Tue, 21 Aug 2012 08:21:36 -0400 Received: from na3sys009aog114.obsmtp.com ([74.125.149.211]:51425 "EHLO na3sys009aog114.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757320Ab2HUMUk (ORCPT ); Tue, 21 Aug 2012 08:20:40 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]) (using TLSv1) by na3sys009aob114.postini.com ([74.125.148.12]) with SMTP ID DSNKUDN9F5V7OMvdUC9H1mPX+7ng81zAd9Kf@postini.com; Tue, 21 Aug 2012 05:20:40 PDT Received: by lbao2 with SMTP id o2so3173456lba.38 for ; Tue, 21 Aug 2012 05:20:37 -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=93Y4XRM5vV7v9JHr+6cEHM6ZXvyzMkalMaev9tOr0iw=; b=DhaEXFT2lf7dRQhVfphpYUnEfW0yLfjLICBZeWMzxNyCR1FnsConoiQ+8e+xU9VD9v DVri2LG/2HZuQjetgJHGFQHeP/6vBAdo4qPMznqu9EaS2xoAY7mEYeVFy972W5TiCFbI k4+svQPFclHQ0zUlFHYMXkzD4FiL70XU0boZOt8CNFkwJmKzDDgwHhWNdlOVDc3uR+/l HndWO9fCi7NokndKhaKt4/7oiiRw3i+uF4riHPCTc+sN3XC8xeirlaOnK6sOF4aeY4wS 9Y+an0cbV8TEiFnnIhSicdVpILAjfGiL1bbpFOeAmOSJvukhal3ggG6qT8OcFhHDRVgj gzRQ== Received: by 10.112.82.66 with SMTP id g2mr7739193lby.15.1345551637870; Tue, 21 Aug 2012 05:20:37 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id sy1sm1366783lab.13.2012.08.21.05.20.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2012 05:20:37 -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: [PATCH v2 10/13] serial: omap: set dev->drvdata before enabling pm_runtime Date: Tue, 21 Aug 2012 15:16:08 +0300 Message-Id: <1345551371-18862-11-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc3 In-Reply-To: <1345551371-18862-1-git-send-email-balbi@ti.com> References: <1345540555-24359-1-git-send-email-balbi@ti.com> <1345551371-18862-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQn/m6xs8dT2TRBEatSaoP8UdBbghcGplT6X+BVP4pIQA8Oc5jFPUn/xoaihf/ONzMXxCdEy 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. 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 c272ecc..1aaba77 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1301,6 +1301,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); @@ -1320,7 +1321,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: