| Message ID | 20190715182110.21336-5-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBL4IWPUQKGQEHL6LCIQ@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id CD1833F0E1 for <linux-amarula@patchwork.amarulasolutions.com>; Mon, 15 Jul 2019 20:21:36 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id a21sf4108362pgv.0 for <linux-amarula@patchwork.amarulasolutions.com>; Mon, 15 Jul 2019 11:21:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214895; cv=pass; d=google.com; s=arc-20160816; b=DT0w2fzixXwVtBfiT5KWs44LUDiYcVb7VyZUBUIAnls8S/IT5dF7TDY3f1JqrwL0Y+ +oHfkkC+sMrBvw0Wn63mFczC1QlGUaxB2yNXWZDwnYHViJL6IgVhPGu4lcb6ZOSQwyDT wC+f7Jh2eg01TH9KDJxqNvl21WEy03bCZLNL4j6FowO0EsTagKcmtxH5Ks2W+RVbNupo UwDtgQabi7H6eBDBKBBnyOcgbqdAQey/9FuT0yBo3SHV/I4YTlnsvFFaFtwCDSP9uFoZ qdmqgJ3nF7NKeKEcdX4tHmh8Jaj/mYGkEt1dbKhArpwAgBm0SBDNDmgaDntJb0a09p0N fwPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=iJ7j/+YZfWFybOhMFjwtDQpLbeGViqOtHszwkAn30rQ=; b=mScqEXYiXl7BI7qG5uAAvrvkuqzhNo1riv7y6JBq1qOGfCGtVubCvYg1w4kxG6PZNf fQezOo7xl2ZAUkrIpXdr6fdSLozr7CN2eYOxjS7oT7htNXkVolT5qDN2lnWCBONjbAkC ZWFMI5jDC94pWN4jHBtTbM4AAP0K25uhToNFrFhoQ1jUP5DS29f8lvDPlnW7AWvqGLzq n3VmJhwifEhPDaRPZK0sMr76gtH5CC22ygGpXy8MqBEOlGbBmulBH+c3hwHVUxBGOskQ g1tyt0K8CQge++3ObD5PamjT0k8bI1hyxFASjpXUoLPIkDfeS6/29ytBwwEqqpIJqgGs JeaA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hQY2ym+H; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=iJ7j/+YZfWFybOhMFjwtDQpLbeGViqOtHszwkAn30rQ=; b=F3km0LsJVHpJA1t+vFfMhvhUZfIcVi9iFLXHjKEYHbBqEvyx2hByCFH/Sp1kR7834R t9oaGr0vRSpg39AH9lGxxDDxWHEHKMSigwmXkRxa5u0Fh9ElEX5c1bxxbTkoC85UqIn4 MrLk7Y/4Ih4E8ZJRn0Fs3YtW7e/nl/2FhwKi0= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=iJ7j/+YZfWFybOhMFjwtDQpLbeGViqOtHszwkAn30rQ=; b=K3adNAiUS2u/Rmhv3pZlmE26nloMXs1f6VyV9yhrvRlEm8j2N0C5EiWtBvM9wABK2L W43/JCPyEJqTzxZB830DwqSbrFx2P924qMDBZQAZnyQOedpEF8NrAf6eA9cCAhP9y7oL foyT6PhI+Zgfe+s6yuzUhehQ2f8WEDKGrvgNbHo393hzIZ9j82Zu2Jd9yRkTR2f8qzAu nUBytyaGsxduKCOdVxE+dRCbTfWdVuAoI2PHoGHrW2Hb9R10EBUq1uxipRcJ/zefrruw eu+EaJu+holhu5JWqhcBlCpnLobxFzDDN0YDdmawDHB+r7vgU+Fn4J5OotT9Yai8YZ6i 3Uxw== X-Gm-Message-State: APjAAAUO/zCFZSbvrgWFqlUJ4WnrMwhfnxyod60ZEWUCYFtQkB76E9i4 7v4gM8k3a7yhOI/x39kuT3H1cJaO X-Google-Smtp-Source: APXvYqzklp9Jm4QcXVZd3FydCqqmmpNnyJUmftUybZRdoD9GFAW7F6uI3rze2Qr3q7rz1B9CresBzA== X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr30853617pjd.72.1563214895648; Mon, 15 Jul 2019 11:21:35 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:614e:: with SMTP id o14ls2981136pgv.7.gmail; Mon, 15 Jul 2019 11:21:35 -0700 (PDT) X-Received: by 2002:a65:448a:: with SMTP id l10mr3974729pgq.327.1563214895241; Mon, 15 Jul 2019 11:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214895; cv=none; d=google.com; s=arc-20160816; b=kqEjTRmkA63rSSCHkBJtQyz/N7zD4MtaWjAZkb0ero6aLhfJwVm0wnzry0IhthhV5P XoEMfkjUyuZPmpatRgiOkHMzKQIycExeBn/s+bEs4wmo43Wmz0CK+LLd5G9RcqOwkL58 wF1zaG5cqjCfWK3JguuoXs6EQ/dGXlvtVeoNZwNJGzp7g3QjubIoFcDDI+OmD5QAdXci 3p0OkeTWjHadOWj4vo2fwo2SpGfQBnPa+Q5vf7TXV6IfZrfCIVNB2s1PjSfg1Hpd/ZyP XtK5wQmiWVWdpd60oCIzI4eIufvFKwim8KCt+aicOII5sF7v3AozZvdNHB0L6XocQSxF /2kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=wtH+L++PhkK0wx6pSCUYJbZO6pOG2ERf3vcIuQe4X5s=; b=JkGxcubakn0y4NNUT4NPee7jcK69ZnrOuNdQUJtXi9iLf5mcOYZasiaonj5wSDQ5wi /ODFl3tgIPBV0Rf9GtwkN6pxrjYIidU3Xbc8Nreazw12t82Z6sv3xdlOalp5HtuhdYBg lovM8/r3pO/auf4NV+jLxHAJ67gRSg2YnbUjiMkB6A3mOZtIh3+p0LJuOuYdBkR5StOb dZwEPQhjROFOUBQyjDazXobiviUIQIH+tJ6SQkroYrZ6VNBOT+aVseUlLWRBT058v/UM +HfnrM+9MthbfGsyyvq+1HtNOUbvcnDkG+1yMBIgxR+iuskTfbfDHOl6uu1y/Z1rtWHT GS+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hQY2ym+H; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id s16sor9591903pfd.52.2019.07.15.11.21.35 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Mon, 15 Jul 2019 11:21:35 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:d448:: with SMTP id i8mr9006870pgj.173.1563214894885; Mon, 15 Jul 2019 11:21:34 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:21:34 -0700 (PDT) From: Jagan Teki <jagan@amarulasolutions.com> To: Simon Glass <sjg@chromium.org>, Philipp Tomsich <philipp.tomsich@theobroma-systems.com>, Kever Yang <kever.yang@rock-chips.com>, YouMin Chen <cym@rock-chips.com>, u-boot@lists.denx.de Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>, gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v3 04/15] ram: rk3399: Handle pctl_cfg return type Date: Mon, 15 Jul 2019 23:50:59 +0530 Message-Id: <20190715182110.21336-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hQY2ym+H; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
ram: rk3399: Code cleanup
|
|
Commit Message
Jagan Teki
July 15, 2019, 6:20 p.m. UTC
Add proper return type handling of pctl_cfg with
meaningful print statement.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
drivers/ram/rockchip/sdram_rk3399.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
Comments
On 2019/7/16 上午2:20, Jagan Teki wrote: > Add proper return type handling of pctl_cfg with > meaningful print statement. > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Kever Yang <Kever.yang@rock-chips.com> Thanks, - Kever > --- > drivers/ram/rockchip/sdram_rk3399.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c > index c918c2e588..de5d8c1b5f 100644 > --- a/drivers/ram/rockchip/sdram_rk3399.c > +++ b/drivers/ram/rockchip/sdram_rk3399.c > @@ -1063,6 +1063,7 @@ static int sdram_init(struct dram_info *dram, > unsigned char dramtype = params->base.dramtype; > unsigned int ddr_freq = params->base.ddr_freq; > int channel; > + int ret; > > debug("Starting SDRAM initialization...\n"); > > @@ -1082,9 +1083,10 @@ static int sdram_init(struct dram_info *dram, > if (channel >= params->base.num_channels) > continue; > > - if (pctl_cfg(chan, channel, params) != 0) { > - printf("pctl_cfg fail, reset\n"); > - return -EIO; > + ret = pctl_cfg(chan, channel, params); > + if (ret < 0) { > + printf("%s: pctl config failed\n", __func__); > + return ret; > } > > /* LPDDR2/LPDDR3 need to wait DAI complete, max 10us */
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index c918c2e588..de5d8c1b5f 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1063,6 +1063,7 @@ static int sdram_init(struct dram_info *dram, unsigned char dramtype = params->base.dramtype; unsigned int ddr_freq = params->base.ddr_freq; int channel; + int ret; debug("Starting SDRAM initialization...\n"); @@ -1082,9 +1083,10 @@ static int sdram_init(struct dram_info *dram, if (channel >= params->base.num_channels) continue; - if (pctl_cfg(chan, channel, params) != 0) { - printf("pctl_cfg fail, reset\n"); - return -EIO; + ret = pctl_cfg(chan, channel, params); + if (ret < 0) { + printf("%s: pctl config failed\n", __func__); + return ret; } /* LPDDR2/LPDDR3 need to wait DAI complete, max 10us */