Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9128281pxu; Mon, 28 Dec 2020 07:18:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwz1EwcKksEoXsO+1PTXgpB6U20lzIxhQjEwfOdgypceV/T9UKw9q2eLyOy0DWc8No+kqm4 X-Received: by 2002:a17:907:1182:: with SMTP id uz2mr42916141ejb.183.1609168719102; Mon, 28 Dec 2020 07:18:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168719; cv=none; d=google.com; s=arc-20160816; b=VGh8e7XSzLSw1DeCaXyYsR43x3Q7Oejy+W8B9HlBvJPlPVtiN1xnZPjOADNunoLd5w qeUoEY0cWZx0CeNvgwKAKMwVSUUlE0+ZfUBx3/CAm9e/NjBs04ykhJkcCDggm7beu37K xn4FUQczK8N+dWQ+3nS4TstFs4JpzYeAkNvW6DSLEaK6ZwuNFwNdKIEUNnmYIsxigmoT rStMYcUzB7Zl6hRx+qmvSs5uhJGY3W2nfbkk+8QKhb6vG7aakIdmowZ/bMhj6CGJRZxE Wi+D4xjn6RVKQ3BShp4Trc3fzrmc5yompMdnV4y+mN2b2PIwZzm52jRtltVfBDM8jAC8 oRyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u1KHpNEslWEcbz+Y+pm0LN8lSRI86Jg82WvOz5XIfdA=; b=tE5q99tfpxEUCge4kW3xo6UjKvt3+wV5H5rYduqUb8q+eOCaVyrDghJoU6lJ5+u6HG A7Xrh21SYbYt/ql5CTvmdLa7lILNOgoaBsEVeZ08+Q09Xq0AAuQZGd7p6YydXdTPtlBb gnZpBG8x4fKS6cBd0tKSofbS2D8PSuMdS2uI/zs5thk5oipVIg0w1tl3+n5ZrxKr4Kld KLA7cqPqEJr860Ct4MxzpA9qSjFq1KCat8+Lj5l8GxOBDittNEmtOVuqAaOLI/a3yAOp Hl3rgerTkXq4U3tJPKAQNHx/73kU4Ugg3XhGTuw51C/Sg8/ZXPU7RlOa80xP9zdxGvU6 j5Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vLCWEbf2; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb20si18875607ejb.329.2020.12.28.07.18.12; Mon, 28 Dec 2020 07:18:39 -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=@linuxfoundation.org header.s=korg header.b=vLCWEbf2; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441132AbgL1POq (ORCPT + 99 others); Mon, 28 Dec 2020 10:14:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:40644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438027AbgL1OGm (ORCPT ); Mon, 28 Dec 2020 09:06:42 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 305CC20791; Mon, 28 Dec 2020 14:06:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164386; bh=5Yj+Icl0cTkfiOcHrsPRlfV0BgvmHbw5Ijx5i1JtqAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vLCWEbf2DZlcpaEn+MJ+7azK7JVUsFGtF/ln7kzxYsQxHBkwwnmOIYfDapdhmRkFx M8dVilCKok2Z27bVytcu/EF38AwQrOm3JyRAu0O/VwimIvy2yXaCx7IGNGzDmBnSwM V0JIPmrgGBRVrywa3SucWvL3TsO836HMwCtnRRfo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amelie Delaunay , Lee Jones , Sasha Levin Subject: [PATCH 5.10 162/717] mfd: stmfx: Fix dev_err_probe() call in stmfx_chip_init() Date: Mon, 28 Dec 2020 13:42:40 +0100 Message-Id: <20201228125028.718295346@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amelie Delaunay [ Upstream commit d75846ed08e6f4135ec73778575c34d9c0ace993 ] '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 Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/stmfx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c index 5e680bfdf5c90..988e2ba6dd0f3 100644 --- a/drivers/mfd/stmfx.c +++ b/drivers/mfd/stmfx.c @@ -329,11 +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) { - stmfx->vdd = NULL; - } else { - return dev_err_probe(&client->dev, ret, - "Failed to get VDD regulator\n"); + if (ret) { + if (ret == -ENODEV) + stmfx->vdd = NULL; + else + return dev_err_probe(&client->dev, ret, "Failed to get VDD regulator\n"); } if (stmfx->vdd) { -- 2.27.0