From patchwork Fri Sep 7 18:10:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1424771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id D8A393FC85 for ; Fri, 7 Sep 2012 18:17:50 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TA358-0002QC-Cr; Fri, 07 Sep 2012 18:15:06 +0000 Received: from na3sys009aog111.obsmtp.com ([74.125.149.205]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1TA354-0002Pk-5M for linux-arm-kernel@lists.infradead.org; Fri, 07 Sep 2012 18:15:03 +0000 Received: from mail-lb0-f177.google.com ([209.85.217.177]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKUEo5o7Sg2HmuPKvds1zNUmzxjweHpz8B@postini.com; Fri, 07 Sep 2012 11:15:01 PDT Received: by lbbgf7 with SMTP id gf7so16584lbb.36 for ; Fri, 07 Sep 2012 11:14:58 -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=xmGtT/KFfx4eTwXk7+17HA3p3dm+HJF7hDpMWBzF6Aw=; b=e5GsXuFs1cS5AuVWUh9c80Y6+PKEegCKwHN6tNiZ/HLPmQe7yUdMuAb6Y/SYE4larM ygRHCoaQXhN15lYiI0NNL93lb+Rq9KKsqMWhJnhGeGxRB5GAeE/PvULqQxXaSjuGzBPp fyXftxdtSWxhu76oGqiqsRaVgkf7RligCkJNC3BOh2udT2HUYM1yUNI3Xq06xzrUSLpr ovtibJ0vhQCzR4Cf8XNt+eeS1ZLMc/ByxfiQZLpKGsCuCKr45wq5Z5I2Verw44PL/A3d WGvncXiiJzuoW7S1mbGMBkchNckXq1ZifiiTB7oX36ZqE1qaYCPgsX6BhaH1zgzEUWw7 saEg== Received: by 10.112.101.104 with SMTP id ff8mr2376784lbb.45.1347041698186; Fri, 07 Sep 2012 11:14:58 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id lr17sm5831221lab.12.2012.09.07.11.14.56 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Sep 2012 11:14:56 -0700 (PDT) From: Felipe Balbi To: Greg KH Subject: [PATCH] serial: omap: fix DeviceTree boot Date: Fri, 7 Sep 2012 21:10:33 +0300 Message-Id: <1347041433-11723-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc3 In-Reply-To: <20120907175721.GD1303@atomide.com> References: <20120907175721.GD1303@atomide.com> X-Gm-Message-State: ALoCoQk9rxaoVIjU1wksIDUVYsG+I2WG2HOQuIaqPH5gTmAHx+oY6s2ujTWZlzvhYUdNwtyLQlt4 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.205 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Tony Lindgren , Linux OMAP Mailing List , Felipe Balbi , Linux ARM Kernel Mailing List , linux-serial@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org OMAP Architecture code, passes a few function pointers for UART driver to use in order to properly implement Power Management and Wakeup capabilities. The problem is that those function pointers, which are passed (ab)using platform_data on non-DT kernels, can't be passed down to drivers through DT. commit e5b57c0 (serial: omap: define helpers for pdata function pointers) failed to take DT kernels into consideration and caused a regression to DT kernel boot. Fix that by (re-)adding a check for valid pdata pointer together with valid pdata->$FUNCTION pointer. Reported-by: Tony Lindgren Signed-off-by: Felipe Balbi Tested-by: Tony Lindgren --- Tony, does this solve the issue ? drivers/tty/serial/omap-serial.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 0a6e78e..743e8e1 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -143,7 +143,7 @@ static int serial_omap_get_context_loss_count(struct uart_omap_port *up) { struct omap_uart_port_info *pdata = up->dev->platform_data; - if (!pdata->get_context_loss_count) + if (!pdata || !pdata->get_context_loss_count) return 0; return pdata->get_context_loss_count(up->dev); @@ -153,24 +153,30 @@ static void serial_omap_set_forceidle(struct uart_omap_port *up) { struct omap_uart_port_info *pdata = up->dev->platform_data; - if (pdata->set_forceidle) - pdata->set_forceidle(up->dev); + if (!pdata || !pdata->set_forceidle) + return; + + pdata->set_forceidle(up->dev); } static void serial_omap_set_noidle(struct uart_omap_port *up) { struct omap_uart_port_info *pdata = up->dev->platform_data; - if (pdata->set_noidle) - pdata->set_noidle(up->dev); + if (!pdata || !pdata->set_noidle) + return; + + pdata->set_noidle(up->dev); } static void serial_omap_enable_wakeup(struct uart_omap_port *up, bool enable) { struct omap_uart_port_info *pdata = up->dev->platform_data; - if (pdata->enable_wakeup) - pdata->enable_wakeup(up->dev, enable); + if (!pdata || !pdata->enable_wakeup) + return; + + pdata->enable_wakeup(up->dev, enable); } /*