From patchwork Wed Dec 14 11:55:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajendra Nayak X-Patchwork-Id: 5692 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 992F023E10 for ; Wed, 14 Dec 2011 11:56:02 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 8BBBEA183F3 for ; Wed, 14 Dec 2011 11:56:02 +0000 (UTC) Received: by eaak10 with SMTP id k10so417788eaa.11 for ; Wed, 14 Dec 2011 03:56:02 -0800 (PST) Received: by 10.205.129.137 with SMTP id hi9mr541056bkc.90.1323863762377; Wed, 14 Dec 2011 03:56:02 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.129.2 with SMTP id hg2cs6274bkc; Wed, 14 Dec 2011 03:56:02 -0800 (PST) Received: by 10.236.91.67 with SMTP id g43mr11272992yhf.68.1323863760290; Wed, 14 Dec 2011 03:56:00 -0800 (PST) Received: from comal.ext.ti.com (comal.ext.ti.com. [198.47.26.152]) by mx.google.com with ESMTPS id n6si6532664ybe.16.2011.12.14.03.55.59 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Dec 2011 03:56:00 -0800 (PST) Received-SPF: pass (google.com: domain of rnayak@ti.com designates 198.47.26.152 as permitted sender) client-ip=198.47.26.152; Authentication-Results: mx.google.com; spf=pass (google.com: domain of rnayak@ti.com designates 198.47.26.152 as permitted sender) smtp.mail=rnayak@ti.com Received: from dbdp20.itg.ti.com ([172.24.170.38]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id pBEBtuSd023526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Dec 2011 05:55:58 -0600 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id pBEBttqK025563; Wed, 14 Dec 2011 17:25:55 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Wed, 14 Dec 2011 17:25:55 +0530 Received: from ula0131687.apr.dhcp.ti.com (ula0131687-172024137230.apr.dhcp.ti.com [172.24.137.230]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id pBEBtnkI005240; Wed, 14 Dec 2011 17:25:55 +0530 (IST) From: Rajendra Nayak To: , , , CC: , , , , , , , Rajendra Nayak Subject: [PATCH v3 2/4] omap-serial: Use default clock speed (48Mhz) if not specified Date: Wed, 14 Dec 2011 17:25:44 +0530 Message-ID: <1323863746-18145-3-git-send-email-rnayak@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1323863746-18145-1-git-send-email-rnayak@ti.com> References: <1323863746-18145-1-git-send-email-rnayak@ti.com> MIME-Version: 1.0 Use a default clock speed of 48Mhz, instead of ending up with 0, if platforms fail to specify a valid clock speed. Signed-off-by: Rajendra Nayak --- drivers/tty/serial/omap-serial.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index a02cc9f..f14b9c5 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -43,6 +43,8 @@ #include #include +#define DEFAULT_CLK_SPEED 48000000 /* 48Mhz*/ + static struct uart_omap_port *ui[OMAP_MAX_HSUART_PORTS]; /* Forward declaration of functions */ @@ -1386,6 +1388,11 @@ static int serial_omap_probe(struct platform_device *pdev) up->port.flags = omap_up_info->flags; up->port.uartclk = omap_up_info->uartclk; + if (!up->port.uartclk) { + up->port.uartclk = DEFAULT_CLK_SPEED; + dev_warn(&pdev->dev, "No clock speed specified: using default:" + "%d\n", DEFAULT_CLK_SPEED); + } up->uart_dma.uart_base = mem->start; up->errata = omap_up_info->errata;