From patchwork Sat Feb 29 00:01:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Dureghello X-Patchwork-Id: 1246928 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=timesys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=timesys-com.20150623.gappssmtp.com header.i=@timesys-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=mQFFaMgF; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Tmjf1j2nz9sQt for ; Sat, 29 Feb 2020 10:59:30 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9D14480911; Sat, 29 Feb 2020 00:59:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=timesys.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=timesys-com.20150623.gappssmtp.com header.i=@timesys-com.20150623.gappssmtp.com header.b="mQFFaMgF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C2CF280E45; Sat, 29 Feb 2020 00:59:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 52BA480671 for ; Sat, 29 Feb 2020 00:59:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=timesys.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=angelo.dureghello@timesys.com Received: by mail-wm1-x342.google.com with SMTP id m3so5207025wmi.0 for ; Fri, 28 Feb 2020 15:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timesys-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jm8C442ILyVdDKel/eO7QLzZ9t8Sg66d99J+1SwS5lM=; b=mQFFaMgFv/PBmJSwxMDm/VXDZENQgm2DVkTxaKPwlk8gB08M27OOCRCjYqszlOLy+r uS/enft2mcm/p8nbDJfT6pA6hVWsmT8AVk4A4qrzUdS7Rc5v8Li39j2muGa/CA6oAlAx BNI3KcVbKisZuRTd2261d9KPomHeF2asdqSjvfBw1EQKBoIO9fF/gjtpFS9K7T8kDFdF c9sq5hQtgJ6W0QEgKSfnf7yDgat89i5Ow26r35gdZeLcyFuinhxMWu8AQNZWzMDdJh10 fckvusM0zeEukB0XzdRogL7pfk7/SgYAG4vLborpL2MB9kqLEgIxqOInPHCqy2LcAn3r gHNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jm8C442ILyVdDKel/eO7QLzZ9t8Sg66d99J+1SwS5lM=; b=Lb1JazbP5YOvB334c/5PR99ncXyDIAcvnHUs6bbJ8+IO0Acqky0IzP49IuuzzJeJiT O2SXu2WwSaSI7/4B7sGLN99OYzvpvM1vfMS8FveRSAR8O4lFV7vMOx1tHw9jwdDqCeod juPjDtDva+NCmyNAa1UDoWG/KhdnB7DGmN3xzhntwjc3nXtkIiA/WsYME/NcPuVq2flf efBFSxevt6fhN1BqEkdHmkOpt3+F2vvrIRgfN3Zb+9gnAc5dDcU9mBJa3Z9ULU878xnK YTqsz+rCxhVwqb+oD11qsLOS+tTpWC9F4bB0lGwqC3C7JRBNQsYhxode2PJHKw841KUA mo/w== X-Gm-Message-State: APjAAAUqWfuFDEOXVRXm1ciZ5BOjMlvUABA9lJtkTCWjiaSEblquh5dq eFjIz9yFCx/P3Bh+Z3D7cfp9wg== X-Google-Smtp-Source: APXvYqwjr8C9qg9vuBG1bR3WhaP8EVV1lR0a3pYPjOzuQfbz381vTuRLKTlJ6yeQEenfS3PwI2fCaQ== X-Received: by 2002:a1c:9816:: with SMTP id a22mr4614603wme.16.1582934360662; Fri, 28 Feb 2020 15:59:20 -0800 (PST) Received: from localhost.localdomain (host134-3-dynamic.50-79-r.retail.telecomitalia.it. [79.50.3.134]) by smtp.gmail.com with ESMTPSA id 16sm4383181wmi.0.2020.02.28.15.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2020 15:59:20 -0800 (PST) From: Angelo Dureghello To: trini@konsulko.com Cc: u-boot@lists.denx.de, sjg@chromium.org, Angelo Durgehello Subject: [PATCH] serial: mcfuart: fix uart port index Date: Sat, 29 Feb 2020 01:01:32 +0100 Message-Id: <20200229000132.618227-1-angelo.dureghello@timesys.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Angelo Durgehello Actually, using dev->seq value before probe to deduce the current serial port index leads to reading an invalid seq value (-1). So, getting dev->seq at probe time. Signed-off-by: Angelo Durgehello --- drivers/serial/mcfuart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/serial/mcfuart.c b/drivers/serial/mcfuart.c index 066e5a18d8..b599064b48 100644 --- a/drivers/serial/mcfuart.c +++ b/drivers/serial/mcfuart.c @@ -85,6 +85,8 @@ static int coldfire_serial_probe(struct udevice *dev) { struct coldfire_serial_platdata *plat = dev->platdata; + plat->port = dev->seq; + return mcf_serial_init_common((uart_t *)plat->base, plat->port, plat->baudrate); } @@ -148,8 +150,6 @@ static int coldfire_ofdata_to_platdata(struct udevice *dev) return -ENODEV; plat->base = (uint32_t)addr_base; - - plat->port = dev->seq; plat->baudrate = gd->baudrate; return 0;