From patchwork Tue Nov 10 08:04:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amelie Delaunay X-Patchwork-Id: 11893483 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF05DC388F7 for ; Tue, 10 Nov 2020 08:04:41 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4ED732080A for ; Tue, 10 Nov 2020 08:04:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="REEhMNAh"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=st.com header.i=@st.com header.b="rlx08U4N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4ED732080A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=st.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=CbamL6P82Pd2mrzz+LrnKlxbcG2d92j7M45RuWXCQeg=; b=REEhMNAhW8j1mJCRXu0QXICH5b i4y7Dpo0lEsmt12TpV59oGwAIE3K2gv8mV8hhoqBrm7SdOqkCx9RZofWZd9WZtc2KCxT3lZiKUUey 4a73HaYxKKWA5bMUHSv9bo8u18j5V3UL+ViCb6MCf0uMMdN1vdU8Ei1epilDn8AJxzhblzxEIcPyn 5wjnJiuQJ5mqs2ddnRfzeuofRVg4vl2iGdvhF45v3qxsArjZXEssWY5MW0enuMLMTo1afebyCsLed yedPgDR/bRX+5wJ2AZKvcSknodTTBcQys+1+kAFaEtJB5VtceHhObcUDRlgImybeROmyeFHCQFsrf /sSysJPA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcOdP-0001WT-Vb; Tue, 10 Nov 2020 08:04:12 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcOdM-0001Vg-Dt for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2020 08:04:10 +0000 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 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_030409_266569_380710D0 X-CRM114-Status: GOOD ( 16.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amelie Delaunay , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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);