Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3813640pxb; Tue, 10 Nov 2020 00:06:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcOVzanE9GOhuNvtz/KVYf05mZ8ZA5j8AG0FcYbxzbOl1XGCV4BWFbuTAnkp2EEhd5l8la X-Received: by 2002:aa7:d2d2:: with SMTP id k18mr19020093edr.290.1604995594631; Tue, 10 Nov 2020 00:06:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604995594; cv=none; d=google.com; s=arc-20160816; b=qMVmbR2dGj4SfFoOcR0fxneZVjj8OMgBtlpMeMFtu/1SSXr4wjU5KzsMPOdFqVJ8e5 H0+1qbIihJcLmKQv5KQR9shzn59rQQdLCk0hN3ZILqaGcUmO3IRX9J7iRtBvkKFuhxxK fKYgVv/Ls48DXtNPlahsghw7FgVeoj7sCN1Z1TbKz4+kFhuVD6UcQpKEEF2k2Y6SA4iI YFNykgS9wskSdyVhm8DmndH9NlCjPnkqYr8+5iZDSRW5quGnS+CBYhJ0Rq35v1V9o4Ah KrY8o03Gz1uVd5QY2VL5RzkIvQ58zWC04qu76ge1MzbaCxc0TJnUNcWof+GoLZdHfiEA vJSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=64TjGNurhU58K6SRpxGU5jfooD3SAdtkt7wKdxzo2Gk=; b=0hBBOTkAHJQP6Po2R5YxJthrMqCmzNE6mGq84Efu3Z5ZOrShBzeMeDBHoywe0jRBfU E89DkuFqtN6H4LMTl2eW2oYwfuxd/OgO8emGKPDI9IrIiqTb7qA4F0KZS3lccaHC8/dl AgnGCimeOijIRcTXOb6ANG5x7jIrf8tSSd2by9x6NUI1mAkQcbJMnxKwtxOTHiAaBoQD PHPBoIb/vl2Viz9Yon+EeUt1+ZTVHY7nwevTwDDzXCizVXo6Wv+OoTFfOZlh1fTReIVS tFVVy6v4njwDha3+yiRqfyiUuBxZ+mR1vHb0UtBuoD2i9b2Ni8W5tNk/SrTVOhc4fDaV Ggkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=rlx08U4N; 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=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w24si8730899ejy.97.2020.11.10.00.06.11; Tue, 10 Nov 2020 00:06:34 -0800 (PST) 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=@st.com header.s=STMicroelectronics header.b=rlx08U4N; 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=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729312AbgKJIEN (ORCPT + 99 others); Tue, 10 Nov 2020 03:04:13 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:55620 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726462AbgKJIEM (ORCPT ); Tue, 10 Nov 2020 03:04:12 -0500 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AA82nC9001686; Tue, 10 Nov 2020 09:04:02 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=64TjGNurhU58K6SRpxGU5jfooD3SAdtkt7wKdxzo2Gk=; b=rlx08U4NeuOYI99GHlQ0yu6/LUmCcMPs5BCQQRKgdfZHH8dDoCKjwQQWZ9+vNiTOY1ln kF4F9HVvhfR9XBo0XpHTuD2PYZr5y1qDFu0GyMlxPiYPYiB6Wj9hGI/RPcOKTrtwL76o XugoKyG/r/QQbbmPKkqt2jbj4FiLEApky931ENW2QQREBJUUwMuo09YSvIH3UR1sagBj d9ordx8JY86FGHZm/42rPw7XvUVB7t8tw2inmcmwo4L+UfBOG8NZY41YxUoJ8AqzWkJx lQI3wvQRVc0pWfd7feF1eZCVjKavqZRvZUe7p2cKU0cFkvtPbJIYjgbyJ9SMM0Cx46nQ BA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 34nkbmxnqa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Nov 2020 09:04:02 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1040C10002A; Tue, 10 Nov 2020 09:04:02 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag3node2.st.com [10.75.127.8]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id F22A322E873; Tue, 10 Nov 2020 09:04:01 +0100 (CET) Received: from localhost (10.75.127.46) by SFHDAG3NODE2.st.com (10.75.127.8) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 10 Nov 2020 09:04:01 +0100 From: Amelie Delaunay To: Lee Jones , Maxime Coquelin , Alexandre Torgue , Krzysztof Kozlowski CC: , , , Amelie Delaunay Subject: [PATCH 1/1] mfd: stmfx: fix dev_err_probe call in stmfx_chip_init Date: Tue, 10 Nov 2020 09:04:00 +0100 Message-ID: <20201110080400.7207-1-amelie.delaunay@st.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG4NODE2.st.com (10.75.127.11) To SFHDAG3NODE2.st.com (10.75.127.8) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-10_03:2020-11-05,2020-11-10 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ret may be 0 so, dev_err_probe should be called only when ret is an error code. Fixes: 41c9c06c491a ("mfd: stmfx: Simplify with dev_err_probe()") Signed-off-by: Amelie Delaunay --- drivers/mfd/stmfx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c index 5e680bfdf5c9..360fb4646688 100644 --- a/drivers/mfd/stmfx.c +++ b/drivers/mfd/stmfx.c @@ -329,12 +329,11 @@ static int stmfx_chip_init(struct i2c_client *client) stmfx->vdd = devm_regulator_get_optional(&client->dev, "vdd"); ret = PTR_ERR_OR_ZERO(stmfx->vdd); - if (ret == -ENODEV) { + if (ret == -ENODEV) stmfx->vdd = NULL; - } else { + else if (ret) return dev_err_probe(&client->dev, ret, "Failed to get VDD regulator\n"); - } if (stmfx->vdd) { ret = regulator_enable(stmfx->vdd); -- 2.17.1