From patchwork Mon Sep 22 15:48:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 392043 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B244E14017D for ; Tue, 23 Sep 2014 01:54:26 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 63C9FA7540; Mon, 22 Sep 2014 17:54:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y0pGqsXrXF3O; Mon, 22 Sep 2014 17:54:23 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 367AEB37A9; Mon, 22 Sep 2014 17:53:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B6D4AA7441 for ; Mon, 22 Sep 2014 17:53:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kA4Qnn8aSQfK for ; Mon, 22 Sep 2014 17:53:25 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-oa0-f73.google.com (mail-oa0-f73.google.com [209.85.219.73]) by theia.denx.de (Postfix) with ESMTPS id 86808A747B for ; Mon, 22 Sep 2014 17:53:13 +0200 (CEST) Received: by mail-oa0-f73.google.com with SMTP id eb12so990953oac.0 for ; Mon, 22 Sep 2014 08:53:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sCPh1jMGpn2On/1IN9TkWamOOUZBm/lx7pjGfUtyK54=; b=hHJsNLw8Jedz0+3wdJYW648mLrV/Tfub696GcU7AMJ+R3oVBFkmQk9G2Olj+d08zX/ Irv4h4iFyt+4OKy+eNMTgcLf5j0wEEdu1mA7+24sHMPGefst5+Gh4kh4pXd/4cMlhHa2 62UhwoER50X79S2zNQ3zzi1xcCF9zUmjUPLBrem63SxTPztx80g+KoUNvrpt6CsDrLIS WPIgYmj/lFfZt6gF2rH4rzaWbK0/rB7rMLIsSK4YGZOGrCtjEVscdB0cxS/wZQouKoAm QgkXOyRzAVQgwikR0hIOIJ/mgzwggimPRBhrmuIH6JWgZNn2VV5NQlDSaad0Q7e6LU8V AuAw== X-Gm-Message-State: ALoCoQlEZYqtr4LzvaRHDFKtxtWkVT5K74pF116rkJW2oUZKAGKH4ILx2WMGanOj1PLIWxoPi+qg X-Received: by 10.42.118.200 with SMTP id y8mr26706625icq.4.1411401192283; Mon, 22 Sep 2014 08:53:12 -0700 (PDT) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id e24si501033yhe.3.2014.09.22.08.53.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Sep 2014 08:53:12 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id 3vshHgcY.1; Mon, 22 Sep 2014 08:53:12 -0700 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 7706F221D4F; Mon, 22 Sep 2014 09:53:11 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 22 Sep 2014 09:48:45 -0600 Message-Id: <1411400934-7754-6-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1411400934-7754-1-git-send-email-sjg@chromium.org> References: <1411400934-7754-1-git-send-email-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [PATCH 05/14] dm: ns16550: Correct the probe logic for platform data X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The probe logic sets up the pointer to the platform data in the device tree decode method. It should be done in the probe() method, and anyway the device tree decode method can't be used when CONFIG_OF_CONTROL is not enabled. Fix these two problems. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- drivers/serial/ns16550.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 2301f0a..0799aa4 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -276,14 +276,15 @@ int ns16550_serial_probe(struct udevice *dev) { struct NS16550 *const com_port = dev_get_priv(dev); + com_port->plat = dev_get_platdata(dev); NS16550_init(com_port, -1); return 0; } +#ifdef CONFIG_OF_CONTROL int ns16550_serial_ofdata_to_platdata(struct udevice *dev) { - struct NS16550 *const com_port = dev_get_priv(dev); struct ns16550_platdata *plat = dev->platdata; fdt_addr_t addr; @@ -294,10 +295,10 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev) plat->base = addr; plat->reg_shift = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "reg-shift", 1); - com_port->plat = plat; return 0; } +#endif const struct dm_serial_ops ns16550_serial_ops = { .putc = ns16550_serial_putc,