From patchwork Tue Nov 7 19:05:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 741932 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1793559wrr; Tue, 7 Nov 2023 11:06:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDPX0JLJjahXG7/7G6NcW+D4SxBIhnhwM2WAuBO+5JfO0xW2F9Hr7f9pxxCumaxjSqXw0D X-Received: by 2002:a17:906:794d:b0:9be:705:d7d0 with SMTP id l13-20020a170906794d00b009be0705d7d0mr16079565ejo.0.1699383992339; Tue, 07 Nov 2023 11:06:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699383992; cv=none; d=google.com; s=arc-20160816; b=U/Wyj8NsvuaK7QcE1LNUVJnNk3HXmBOKEV4pjwTLXvUO+EYsyayPwxl1EaSg0fovle h8iTD/IgHObLcxXi8H6xo6g0otkd19PUaVxj6eIl9GX4bH8MlzJ2pFsOzSbJPt1fZQJC 38cb1XnwVgijjDDlJ4R/PC49hFMgSTuCKKEQI4tfbPLIYV6mXl/KiRIDWBDy5veBjtjp X/gVRd9OER3em31dJt0jU/WVVNT3aXbm5P6S6uY47mW8B9PwlaLo+ZvHBZUSywhjxDkk /hb2OmtRKGCGv8UCAYaRvRBZjI86qUZpVRALzmnynR3AoIiQYN4avakKXDqgqEiOdqJm l5dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LjFvinfoEp/lieblzIudkNY2qHMs8fgFELz/BB33aNQ=; fh=V8mDuKiLPNtyICTEK9bwK0gdoM7g2D1lZIysD2SFi7U=; b=m1xqqfCPiRaIcyu28UUzLAvKlyPWNc2QcPFIKD0Omek6Ba3e2zDmidPiPnrAFO6g3i N2DWYpNQzTbIQ++cxmFDT1KBAFIoNw+k4a6KyiIW9rtP17Ak5ZbHS2qETFQlviKf/CYY ve29IXd2FB012U9W4Q4zPtDigdP1DaRm9q/DCGkADKbSEO7gxbXgiDGKekvClCDg3koy Ap+zBBfF46kSiv6/0oIwHUxWu5GDTeB2FO0yZw29QltTxTQ8izQ+d5ycvZozKfQO4SZb rpt+9mfquAhyhnEGLLUPig7k8AQ+I9wUWmv5x/klieRDMjP3ybm5smPSiBsmeKIrkdeU AMtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CBJj3Vr7; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id dt3-20020a170907728300b0099318060d40si1373475ejc.459.2023.11.07.11.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 11:06:32 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CBJj3Vr7; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CDCFD87584; Tue, 7 Nov 2023 20:06:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="CBJj3Vr7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DAF53875BF; Tue, 7 Nov 2023 20:06:07 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oo1-xc34.google.com (mail-oo1-xc34.google.com [IPv6:2607:f8b0:4864:20::c34]) (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 3F7CB875BF for ; Tue, 7 Nov 2023 20:06:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-5869914484fso3332145eaf.0 for ; Tue, 07 Nov 2023 11:06:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699383964; x=1699988764; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LjFvinfoEp/lieblzIudkNY2qHMs8fgFELz/BB33aNQ=; b=CBJj3Vr7foH4nbrfZcin8300dQjm4CFsD/VqfDmAmszs7mGq5b27uJZeUpMHP6olOQ ID7U005oKeTKWTMkQqrPaW5YE6pGRHFU0CxTRQtJ4lvtI6JMwSRv0en04nreC12BRSXu 7HSadGNzSMdUKFnvkyKQks8+4rv8Cy68jOJf2CVpcUm1n6NgEFNDLXjNs/IK+qUCqTu0 cui91paCcEbjstYI6nV3tYcF8rYXv3OZYhxM01rBYOUBrAWZsygKhxRaegkV1fpZLJ9/ G+/H8rA6dz9rjPlxg3ScPAnWnxIFQur4lzo8s7Ohg9S+I4hzsp35Lcoez3MdxTC/gw8Q 8mTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699383964; x=1699988764; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LjFvinfoEp/lieblzIudkNY2qHMs8fgFELz/BB33aNQ=; b=asfNF5apg28KfUq9n56EUWqmjmwQzlcQ9WEY+9psaqvMM6nDdJFOKr82FwisUrGe7a j0swWTcnUlRXbtERKCuFFKpa0dNllqbeZNZTXxKEuOtvbODQetPeG2V1o9pcOcMaW+ji iLU6TtPG+j8gubMfZWvMy9TMKhl75CsuyW/eAZCgMVnC3nKJlEeTkt68ewhCJmzQ6lG4 JK/FE8CTfFe1f3dqw6S8dte3QfY4HsjXWhPEgha1csgi5Z5nUm7lRHS7E7/Go1s7/KJz fkBkd5dCkDWNrpmU09bII93JyrzrhVtNH4lGcOAvCPtDk9K8HOEcVindnJhdGUl1qUNE 3ROQ== X-Gm-Message-State: AOJu0Yx1CIeqP4ysBvLKxMkVnyRt8jRFtQTzvjtniVBWAFyzrwxO3xPW imGVyewsjOQ1rSZxdsXl55mXaFanGZkKOwBQvcOjWA== X-Received: by 2002:a05:6820:211:b0:581:3e7d:12e8 with SMTP id bw17-20020a056820021100b005813e7d12e8mr33524767oob.2.1699383963913; Tue, 07 Nov 2023 11:06:03 -0800 (PST) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id q23-20020a4a3317000000b00589ce21f6bfsm114454ooq.15.2023.11.07.11.06.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 11:06:03 -0800 (PST) From: Sam Protsenko To: Simon Glass , Tom Rini Cc: Mark Kettenis , u-boot@lists.denx.de Subject: [PATCH 2/4] serial: s5p: Use livetree API to get "id" property Date: Tue, 7 Nov 2023 13:05:59 -0600 Message-Id: <20231107190601.17151-3-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231107190601.17151-1-semen.protsenko@linaro.org> References: <20231107190601.17151-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean Use dev_read_u8_default() instead of fdtdec_get_int() to read the "id" property from device tree, as suggested in [1]. dev_* API is already used in this driver, so there is no reason to stick to fdtdec_* API. This also fixes checkpatch warning: WARNING: Use the livetree API (dev_read_...) [1] doc/develop/driver-model/livetree.rst Signed-off-by: Sam Protsenko Reviewed-by: Simon Glass --- drivers/serial/serial_s5p.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c index 177215535676..c57bdd059ea6 100644 --- a/drivers/serial/serial_s5p.c +++ b/drivers/serial/serial_s5p.c @@ -20,8 +20,6 @@ #include #include -DECLARE_GLOBAL_DATA_PTR; - enum { PORT_S5P = 0, PORT_S5L @@ -220,8 +218,7 @@ static int s5p_serial_of_to_plat(struct udevice *dev) plat->reg = (struct s5p_uart *)addr; plat->reg_width = dev_read_u32_default(dev, "reg-io-width", 1); - plat->port_id = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), - "id", dev_seq(dev)); + plat->port_id = dev_read_u8_default(dev, "id", dev_seq(dev)); if (port_type == PORT_S5L) { plat->rx_fifo_count_shift = S5L_RX_FIFO_COUNT_SHIFT;