From patchwork Fri Jun 26 06:57:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11626615 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BFE392A for ; Fri, 26 Jun 2020 06:57:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3F2F208C7 for ; Fri, 26 Jun 2020 06:57:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="V+f/N1sh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728618AbgFZG5v (ORCPT ); Fri, 26 Jun 2020 02:57:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728585AbgFZG5t (ORCPT ); Fri, 26 Jun 2020 02:57:49 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8240C08C5DB for ; Thu, 25 Jun 2020 23:57:48 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id q5so8350509wru.6 for ; Thu, 25 Jun 2020 23:57:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7sD07a6En2jWPWH2kq8TUsn+RVkOBsvIFsWTqmBLW7Y=; b=V+f/N1sh9o182ePat9lbQamPC/xUQtqafZxm5ypirNrQKbDKBqQ4bjIcONYNaxl3bT SOVYt7m9hF2UYTxbT6EE1TVluOIxfDnbWgmea430ebNS8wCS8vBhHomJYiPwr3dEw7nC BEfJ83GZIJxiNxsokwodTwezX9wpLi5ZXnRjQ9jRvzdWxNoh+R56OGC3sRqBw2Mznu3Y HRU8Tb95/BKVOjFpbvDZbTd2016NZeX+SU7QjLc8cZed6J4jfxNf8yNYRNAiphrQYfo+ +5Vhrl7fj0n00G1l4XVsH0+wvvgUzFYgutMbkcK/ayG549z0zXCUKOd4GUhIXV2+r/vu vlyQ== 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:content-transfer-encoding; bh=7sD07a6En2jWPWH2kq8TUsn+RVkOBsvIFsWTqmBLW7Y=; b=k8So7hg2ZmWWlrQXOtga0ckJLJq1K/InfZD/qonMkEzkTydbF73kyCsCEoWGfgeeI7 0pE+geW9y6ggTtOZXewZjb1T3bdPIzgQr6FJPRhEW9eq/I/mXyqi6hvW0bJ2N2LmFqdE Y6a2NvIWCAEmYszvN4f/yZj0L/huAkdaAxPEjMXDMzJZQGJF/54WgiFffvYPTKN519ob 03629ax8r90NK5SoAnXbVLovpqT1bqFR4hF9eedB3cDBlMoRqF2W//HzSFzJPvbvlKMJ ds0DadIVqM/T4J0Hkcj4XGjXlsUOjsblTwDXRX4NBbQcWkIDVODDYWR6Icl+6Vgxwtth TElA== X-Gm-Message-State: AOAM532zjcDmXoW8NGNnBPQ/jkPaBLP/r1HXe7u6P+2ZXekkbnI9258M FY5L3uWEqpbR1nXggYk1bI/NKA== X-Google-Smtp-Source: ABdhPJxS9JeaA9nugKhk00ilscAGO+mjKuClzKn+M1SFU8Zww2GY/t5YayskghAfrWlTh0txvkRTVw== X-Received: by 2002:adf:f546:: with SMTP id j6mr2063748wrp.167.1593154667581; Thu, 25 Jun 2020 23:57:47 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.144]) by smtp.gmail.com with ESMTPSA id x18sm15355269wmi.35.2020.06.25.23.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 23:57:47 -0700 (PDT) From: Lee Jones To: broonie@kernel.org, lgirdwood@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones , Russ Dill , Keerthy , AnilKumar Ch , linux-omap@vger.kernel.org Subject: [PATCH 5/9] regulator: tps65217-regulator: Remove pointless 'is unsigned int <0' check Date: Fri, 26 Jun 2020 07:57:34 +0100 Message-Id: <20200626065738.93412-6-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200626065738.93412-1-lee.jones@linaro.org> References: <20200626065738.93412-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 'rid' is declared as unsigned int, so there is little point checking for <0. Removing these checks fixes the following W=1 warnings: drivers/regulator/tps65217-regulator.c: In function ‘tps65217_pmic_set_suspend_enable’: drivers/regulator/tps65217-regulator.c:127:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 127 | if (rid < TPS65217_DCDC_1 || rid > TPS65217_LDO_4) | ^ drivers/regulator/tps65217-regulator.c: In function ‘tps65217_pmic_set_suspend_disable’: drivers/regulator/tps65217-regulator.c:140:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 140 | if (rid < TPS65217_DCDC_1 || rid > TPS65217_LDO_4) | ^ Cc: Russ Dill Cc: Keerthy Cc: AnilKumar Ch Cc: linux-omap@vger.kernel.org Signed-off-by: Lee Jones --- drivers/regulator/tps65217-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c index d27dbbafcf721..f2d3a4a9f3e77 100644 --- a/drivers/regulator/tps65217-regulator.c +++ b/drivers/regulator/tps65217-regulator.c @@ -124,7 +124,7 @@ static int tps65217_pmic_set_suspend_enable(struct regulator_dev *dev) struct tps65217 *tps = rdev_get_drvdata(dev); unsigned int rid = rdev_get_id(dev); - if (rid < TPS65217_DCDC_1 || rid > TPS65217_LDO_4) + if (rid > TPS65217_LDO_4) return -EINVAL; return tps65217_clear_bits(tps, dev->desc->bypass_reg, @@ -137,7 +137,7 @@ static int tps65217_pmic_set_suspend_disable(struct regulator_dev *dev) struct tps65217 *tps = rdev_get_drvdata(dev); unsigned int rid = rdev_get_id(dev); - if (rid < TPS65217_DCDC_1 || rid > TPS65217_LDO_4) + if (rid > TPS65217_LDO_4) return -EINVAL; if (!tps->strobes[rid]) From patchwork Fri Jun 26 06:57:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11626619 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D1A560D for ; Fri, 26 Jun 2020 06:58:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77C3C2080C for ; Fri, 26 Jun 2020 06:58:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SKp3jqiW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728684AbgFZG6L (ORCPT ); Fri, 26 Jun 2020 02:58:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728612AbgFZG5u (ORCPT ); Fri, 26 Jun 2020 02:57:50 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9480C08C5DD for ; Thu, 25 Jun 2020 23:57:49 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id s10so8325443wrw.12 for ; Thu, 25 Jun 2020 23:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vqpawo5MJsJOmOd5oGBoADQ9AShkAYfWIevIqG7XtBk=; b=SKp3jqiWYrIXN0jB0OY408JIuyw4za4+UhL8h4rqgsIDHOoRrIpyJa6mqRtdVOps/0 mgEnzvPXKOyVwiok9xc3e/aGae/TCe+lyKlYblCgxaVLB7fMbQtnu11Fo+LZk4h2UfVY 8P1sCwqocGnNgb/S8jhEd6RpJSjY68unkDdCp+pHLc9YZnYIj1UgvuxvRk19OyaAut+a LmXMXl6hD2/rB7lZdVRXsKPxUxXp+btTwbd/amNtSAhDR5xvBKGtFOiZlDYFOrCx0d27 8kN6CjSFPWag25rf6VgKqLU1xAHYvr3vl9ay5I0DYXrHesL43//ThifVueOcz0HuZEjY gVIA== 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:content-transfer-encoding; bh=Vqpawo5MJsJOmOd5oGBoADQ9AShkAYfWIevIqG7XtBk=; b=aB2IFh/sXlylcakHWSz3hLDa18CP34Nqsf9GEKMn3Dp3jyrE83ID9qYAJAuZT1z0C4 OQ/Y6sePxLfhc0ol5I+n6Hf44ArU2hw6valb6IvFZ8xkQB+3aomWdrFYA7jJlXwM7//b ULAAzyK86ysZnSYAbGlMKs8QM7NoxPAWEut1Gz41ZW1I94a1SmiJXZKz9vTH6fpYgQWF edHgxS0TJwJeJFzqZWvXqrtle3Lw50BUyLpr0EJHUh+HCtl40vNdVoflY2OHQbA2cpRE s67jLZxRnlC8LxP+/qjlRxI1w7Ko/QTDwX6b6gCsMrdDkXxbdk5lu/TJMzJCONkzmCIJ U3Mg== X-Gm-Message-State: AOAM5320UvsQaB8094Dr1SBuwUQDNcy1+G1rGqkq3mHHkkJawDEpeX+L RXFlsM+MckU8wBpDOCoPDkt/vQ== X-Google-Smtp-Source: ABdhPJzUZcx9JMvk0I42jptf4iOIhyswi9h4IvKidFSgFgUMg8zyNP/ZGhoR0T7CSf8Q1Xinyvy5Tw== X-Received: by 2002:adf:9307:: with SMTP id 7mr2062805wro.414.1593154668628; Thu, 25 Jun 2020 23:57:48 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.144]) by smtp.gmail.com with ESMTPSA id x18sm15355269wmi.35.2020.06.25.23.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 23:57:48 -0700 (PDT) From: Lee Jones To: broonie@kernel.org, lgirdwood@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones , Russ Dill , Keerthy , AnilKumar Ch , linux-omap@vger.kernel.org Subject: [PATCH 6/9] regulator: tps65217-regulator: Use the returned value of tps65217_reg_read() Date: Fri, 26 Jun 2020 07:57:35 +0100 Message-Id: <20200626065738.93412-7-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200626065738.93412-1-lee.jones@linaro.org> References: <20200626065738.93412-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Until now the aforementioned return value has been ignored. Previous and current calls to tps65217_reg_read() return instantly when the value is not 0, so let's do that. Fixes the following W=1 warning: drivers/regulator/tps65217-regulator.c: In function ‘tps65217_regulator_probe’: drivers/regulator/tps65217-regulator.c:227:9: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] 227 | int i, ret; | ^~~ Cc: Russ Dill Cc: Keerthy Cc: AnilKumar Ch Cc: linux-omap@vger.kernel.org Signed-off-by: Lee Jones --- drivers/regulator/tps65217-regulator.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c index f2d3a4a9f3e77..3f5ea029e2e3f 100644 --- a/drivers/regulator/tps65217-regulator.c +++ b/drivers/regulator/tps65217-regulator.c @@ -254,6 +254,9 @@ static int tps65217_regulator_probe(struct platform_device *pdev) /* Store default strobe info */ ret = tps65217_reg_read(tps, regulators[i].bypass_reg, &val); + if (ret) + return ret; + tps->strobes[i] = val & regulators[i].bypass_mask; } From patchwork Fri Jun 26 06:57:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11626621 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 32A8A60D for ; Fri, 26 Jun 2020 06:58:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18A93208B6 for ; Fri, 26 Jun 2020 06:58:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Vfi1pBqW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728622AbgFZG6K (ORCPT ); Fri, 26 Jun 2020 02:58:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728585AbgFZG5v (ORCPT ); Fri, 26 Jun 2020 02:57:51 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09412C08C5DB for ; Thu, 25 Jun 2020 23:57:51 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id f139so8292693wmf.5 for ; Thu, 25 Jun 2020 23:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LxP+pj5dAfq9jSQlmqxGkL2BQjDUMxM20D8uW61hd/0=; b=Vfi1pBqWKvy+Zc8b6ok7wbVccd/dzbvbdRZeJ5pR8nYf1oFkBEn+32PfanZ68mKmr4 X7Tz4VRmpdTJNEbXUjgt/SMOKgRA7SoYdp1+rdmzItdFaoND9odQiqI4x7PWlymMow7j 47xl3ZNui7jVUD3/NPVzpvi3EVWYilYP2Jzrcr63XY4eDP1liqeFJQyXGPgziN12Wj82 b/Wl7AaVTxk1N7JZssKKbllkIfoVOUuPtnnjpdNEOVIDFnW/8NycoeMynve7OiuLkyFm MSiuq21fBdUJwWGnr52ypxku7WTHmFnVpZf+bceWW8T7hjkb7IxLrE+km3hzsv6Wnq9y QqIg== 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:content-transfer-encoding; bh=LxP+pj5dAfq9jSQlmqxGkL2BQjDUMxM20D8uW61hd/0=; b=GrLMRT3iq+Ms1GAIsvDWF3Tu95spyRmPGH/jooLHBB1bEn1qiN6+9X3bzzeOsfsEpH 1BFegyMaYKd+43Df22qFv5UYKqHo4G1CxWCMF6l0Im2gIdvFIHCCs5bHyor7a0WlZDja OWrUlUkZJzOCkdOSBFrE0QlFbTkU+HyBFu4KYdQni4yijJtcYmkewurJw31vEhXi4/iq E6ntVO2CR0CUHd1T2bcYXP3ICIKt7EWxQRMfDqfSuWN8i7HO8UywmpyvGaO3g/O47XD5 LRbjDNRvBvl+TnXgsY7VJC0aRhiPMVUmhg/maqUVFwyRiqWtXg+kz8mh2PDn0cq9+ZHu P7Pg== X-Gm-Message-State: AOAM533sj5NtfLuyoInqooAwuAtEhtJB0mOd0aefbNaL5fBHAfqnIkwB JMEM3BRv+p1xkk5MlNNyAVNRfw== X-Google-Smtp-Source: ABdhPJw73SIBNHcTFiMa5r63xLyQriFo1/WVEXa9xIrz7jwg0GpR9c0vG5B4g091gEXs8yriVT/9Og== X-Received: by 2002:a1c:4185:: with SMTP id o127mr1808366wma.8.1593154669736; Thu, 25 Jun 2020 23:57:49 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.144]) by smtp.gmail.com with ESMTPSA id x18sm15355269wmi.35.2020.06.25.23.57.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 23:57:49 -0700 (PDT) From: Lee Jones To: broonie@kernel.org, lgirdwood@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones , Keerthy , Tero Kristo , Dave Gerlach , linux-omap@vger.kernel.org Subject: [PATCH 7/9] regulator: tps65218-regulator: Remove pointless 'is unsigned int <0' check Date: Fri, 26 Jun 2020 07:57:36 +0100 Message-Id: <20200626065738.93412-8-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200626065738.93412-1-lee.jones@linaro.org> References: <20200626065738.93412-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 'rid' is declared as unsigned int, so there is little point checking for <0. Removing these checks fixes the following W=1 warnings: drivers/regulator/tps65218-regulator.c: In function ‘tps65218_pmic_set_suspend_enable’: drivers/regulator/tps65218-regulator.c:131:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 131 | if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) | ^ drivers/regulator/tps65218-regulator.c: In function ‘tps65218_pmic_set_suspend_disable’: drivers/regulator/tps65218-regulator.c:144:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 144 | if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) | ^ Cc: Keerthy Cc: Tero Kristo Cc: Dave Gerlach Cc: linux-omap@vger.kernel.org Signed-off-by: Lee Jones --- drivers/regulator/tps65218-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c index 05d13f8079182..9133d0af793a7 100644 --- a/drivers/regulator/tps65218-regulator.c +++ b/drivers/regulator/tps65218-regulator.c @@ -128,7 +128,7 @@ static int tps65218_pmic_set_suspend_enable(struct regulator_dev *dev) struct tps65218 *tps = rdev_get_drvdata(dev); unsigned int rid = rdev_get_id(dev); - if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) + if (rid > TPS65218_LDO_1) return -EINVAL; return tps65218_clear_bits(tps, dev->desc->bypass_reg, @@ -141,7 +141,7 @@ static int tps65218_pmic_set_suspend_disable(struct regulator_dev *dev) struct tps65218 *tps = rdev_get_drvdata(dev); unsigned int rid = rdev_get_id(dev); - if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) + if (rid > TPS65218_LDO_1) return -EINVAL; /*