Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2658902pxa; Mon, 17 Aug 2020 15:46:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8oFowyB5zWQfMT52Q0CkJ33li+Bx91tHMIr1cBVrumHsjJzSU7PqLiuKOaSYYkuq/csDK X-Received: by 2002:a17:906:9592:: with SMTP id r18mr16671857ejx.464.1597704370067; Mon, 17 Aug 2020 15:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704370; cv=none; d=google.com; s=arc-20160816; b=fYbT3suD5ULJ8wleAwgvRDkStq5P9iMYxKXQA9ivgR57zUiF58l7B0+yOCM05LxC8f 9MJz+RftSOlld16BP9UwfTAdXA4w98tULxDoGWPs5h1EiQv/nL2YTYATnTCkCPSwljU+ dBLlLfn9fNvLZlt42vjd27rMWUrfDt6TWWSQL4EAr40XzXuKZvgRmMdOrDsEC0UAEUH2 A66dJtWrkbHgEcBxVlUk4yOqGcDVix+d2cNsVj1SgSAJr0yOSXnNqfJJjJooWcPGGwk2 4zkzy89vPk3i0HSyfhTHYLCv1zJPRTM3A7pTQZe/9xP4qiNGsie2euzC7jSygMv0/YMm 8lBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+o5647pdzcu6SNmjWs+r/LY++ePkQRpXDgkkqzd/CdI=; b=bR5AU6DKj0Z/t6KxBis17metT8voxdF36Njdcq2c7fnUMLMOkZktN8PjVeAWTiSRfC r5cCQQOaeT2P0bNbf7aNXGzInYQgJBxi2A4y67D15PwDdEtm+b0g623YdLf6Bhr88e9v JZMrKHKMuyEbripBd9YeZg0ieZegvB5Sr+UC5naixIFx8H1JE14VXykWWZ1Rf6wNZhcP ZOgr0ndQMT5CY5kuRc0b1xMfbkNMD2PoIpDAz/TYMr8spomxu/IH0ttsvBifH0OOK6wg ounTKttdWSz5LxEapKOOn/Bn2ictA7VtU7KDZ4ejJ8mg9Z+Z/N7JKZ41xpSsH4mJngu2 3Q3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZG4vJBYm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si12822474ejq.223.2020.08.17.15.45.46; Mon, 17 Aug 2020 15:46:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZG4vJBYm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731862AbgHQTGU (ORCPT + 99 others); Mon, 17 Aug 2020 15:06:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:54446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730466AbgHQPoU (ORCPT ); Mon, 17 Aug 2020 11:44:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9B21F22D0B; Mon, 17 Aug 2020 15:44:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679058; bh=CKEwHfjYMaMRptnZa9Xtr3VDwhMRZ/6+GvzVOGRbGrk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZG4vJBYmgu78cwFgckCnOZ2P0cbM3ZuE5hkJnWNddZ6bftlDiIrl2rcotyjcurlKD 1P3fa083qXF4DeWCaOQRcloaoFGP04MaSFCHWuNFlGHC01nPTnDlJI5wjxorm+xY6J ef8CQFgJr4BxU1gIGnCtJh0ooeDMQ7i0A3D9QgxE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 5.7 081/393] memory: samsung: exynos5422-dmc: Do not ignore return code of regmap_read() Date: Mon, 17 Aug 2020 17:12:11 +0200 Message-Id: <20200817143823.547062832@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Krzysztof Kozlowski [ Upstream commit c4f16e96d8fdd62ef12898fc0965c42093bed237 ] Check for regmap_read() return code before using the read value in following write in exynos5_switch_timing_regs(). Pass reading error code to the callers. This does not introduce proper error handling for such failed reads (and obviously regmap_write() error is still ignored) because the driver ignored this in all places. Therefor it only fixes reported issue while matching current driver coding style: drivers/memory/samsung/exynos5422-dmc.c: In function 'exynos5_switch_timing_regs': >> drivers/memory/samsung/exynos5422-dmc.c:216:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] Reported-by: kernel test robot Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sasha Levin --- drivers/memory/samsung/exynos5422-dmc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c index 22a43d6628336..3460ba55fd596 100644 --- a/drivers/memory/samsung/exynos5422-dmc.c +++ b/drivers/memory/samsung/exynos5422-dmc.c @@ -270,12 +270,14 @@ static int find_target_freq_idx(struct exynos5_dmc *dmc, * This function switches between these banks according to the * currently used clock source. */ -static void exynos5_switch_timing_regs(struct exynos5_dmc *dmc, bool set) +static int exynos5_switch_timing_regs(struct exynos5_dmc *dmc, bool set) { unsigned int reg; int ret; ret = regmap_read(dmc->clk_regmap, CDREX_LPDDR3PHY_CON3, ®); + if (ret) + return ret; if (set) reg |= EXYNOS5_TIMING_SET_SWI; @@ -283,6 +285,8 @@ static void exynos5_switch_timing_regs(struct exynos5_dmc *dmc, bool set) reg &= ~EXYNOS5_TIMING_SET_SWI; regmap_write(dmc->clk_regmap, CDREX_LPDDR3PHY_CON3, reg); + + return 0; } /** @@ -516,7 +520,7 @@ exynos5_dmc_switch_to_bypass_configuration(struct exynos5_dmc *dmc, /* * Delays are long enough, so use them for the new coming clock. */ - exynos5_switch_timing_regs(dmc, USE_MX_MSPLL_TIMINGS); + ret = exynos5_switch_timing_regs(dmc, USE_MX_MSPLL_TIMINGS); return ret; } @@ -577,7 +581,9 @@ exynos5_dmc_change_freq_and_volt(struct exynos5_dmc *dmc, clk_set_rate(dmc->fout_bpll, target_rate); - exynos5_switch_timing_regs(dmc, USE_BPLL_TIMINGS); + ret = exynos5_switch_timing_regs(dmc, USE_BPLL_TIMINGS); + if (ret) + goto disable_clocks; ret = clk_set_parent(dmc->mout_mclk_cdrex, dmc->mout_bpll); if (ret) -- 2.25.1