Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp68005lqk; Wed, 13 Mar 2024 16:54:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXFOi8kTqdm5dQgoGaoicW/u1sAKTiAmID32f67X8nO3WGzcQq7od0I2Sjh9jbCHRwd5JCzEhRKXggPrW6ti+xwwVX0Kv7qfiz63woc1Q== X-Google-Smtp-Source: AGHT+IGQLQvgZ+sn4roExzrULXVDBICCEvuRCuXRBr23Hs6wow8HuMo4sAaVfkeJlyC1NF9+Dt85 X-Received: by 2002:a05:6870:1656:b0:219:23ed:8c5f with SMTP id c22-20020a056870165600b0021923ed8c5fmr331567oae.54.1710374094773; Wed, 13 Mar 2024 16:54:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710374094; cv=pass; d=google.com; s=arc-20160816; b=QO0MSu5AVYoDI6gawK4/oNBZZ5SUEB+85WhekZ3Uu9gIELi+7UzOCZpRSnUstSZkCk yNyeTiID7XRKYzEwp9FXuOUL9/uyodp/eU4K7Qqnd6DaM++4L9wfugKZ9iN3AlDwAMkA RaRFVnlQfHFqKyiErd8SlqPKUTLd0hJjzVynb1jjaSUvDu0x5+39y0QOrip/0lb2xtm6 YILA+Ulm/p8Z5CaaiYkZS0liD4Q/u8EyIuXsxvHyXbZ+mymg5GVERgcUFMJVDh1zoZVo EnbUpf/8F41CH1u5rsZ9/iwQcFPte4XShq8VQ5pjP1o8fNeHOflgnOJScUVLWhw8KmK8 LOgQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from; bh=8doT5DffX6DQ45TnSJfRCC0nP055SVCjKJTr9nJ5PLU=; fh=YgUZ2/lPRGLRG7A+awv03LUUmaPSy2eh3E767EmTYHs=; b=Rv/6dHgj2Nvkig66dvT0jnIf5tZS+jO+s2FwiL5lp8mxXQCorwI9FeBR5mY+JVr4/l osZ8fjrhlGmdXy0lQLcxxtvR5SV7Xr6auRhA9wLDWlzJmpbH38S3ea3BM9cCiovX0eP7 n2nus893Imxb8Z3HjvBJbwCVu3iPeYtjpcy7FaaEbbXA9rrqKweb9LI+7mEMPh8g+5/r 7bs2/yL+eQvzQgiBR16xwsbpiAQACBn0k1KMzl82BY9eicr/VnXiBd8Mh0rq7y3h5++N HB4Pl4QIBN3cRV0nG/7ObF/Y05LlV60MnGtlyvjauEQgxjOuusM16GU8UgFXnbbA7X8M 5v5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-102655-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102655-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d8-20020a654248000000b005dbd253d1ddsi342701pgq.871.2024.03.13.16.54.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 16:54:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102655-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-102655-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102655-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6E7502820F5 for ; Wed, 13 Mar 2024 23:54:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03FF15E07F; Wed, 13 Mar 2024 23:54:36 +0000 (UTC) Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF1735D73A for ; Wed, 13 Mar 2024 23:54:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.83 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374075; cv=none; b=C5fjKW1HjT62LutGfipEtNuOqxSUYmVfQPvEHeJI7j2FmnmwpyH6rrXNDmG+YTHnHBqrXeHM+9ryNQrxUufVqDocGhpOAEwNARz+0PgRZhdZMKZGNvu4WdzDhtjrViiZd0w/mudDL5cLOFY+ecDuu6a7ehGS//+ftNoAB2XlBus= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374075; c=relaxed/simple; bh=4haKc0BWmXZv48XAJVDKU0krU0tVfIaoXXWWf/W8YnQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Unb7JQ9BwaaB4GdhQGs1Y1NVkhvcjuS5h/c8C9dKSxdGeq2pLTwvciNhpSSjrWTTEg+X1+WkdWRgUzle8Y1v+LExY0wkEL8KVKvzXUOr/y8bpPz4EBcOznWW4R4zAxuif9wP3Wg2GKutMZzBUZlN8WLt+M27LAvXIwcCFOAfLNY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id 05614ad2-e195-11ee-a9de-005056bdf889; Thu, 14 Mar 2024 01:54:25 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 01/11] pinctrl: aw9523: Destroy mutex on ->remove() Date: Thu, 14 Mar 2024 01:52:04 +0200 Message-ID: <20240313235422.180075-2-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit If aw9523_hw_init() fails on ->remove() the mutex left alive. Destroy it in that case as well. While at it, remove never true check at the beginning of the function. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/pinctrl-aw9523.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9523.c index 4edd371c469fb..66629af0b88b4 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -1067,10 +1067,6 @@ static int aw9523_probe(struct i2c_client *client) static void aw9523_remove(struct i2c_client *client) { struct aw9523 *awi = i2c_get_clientdata(client); - int ret; - - if (!awi) - return; /* * If the chip VIO is connected to a regulator that we can turn @@ -1082,10 +1078,8 @@ static void aw9523_remove(struct i2c_client *client) regulator_disable(awi->vio_vreg); } else { mutex_lock(&awi->i2c_lock); - ret = aw9523_hw_init(awi); + aw9523_hw_init(awi); mutex_unlock(&awi->i2c_lock); - if (ret) - return; } mutex_destroy(&awi->i2c_lock); -- 2.44.0