Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp991205lqh; Fri, 29 Mar 2024 03:59:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLvW+2y/f1qOSeRDw7q+OObBbhWd9FAUauL92A0LPJ4JhuDmW2tKLpxu6IS7+EJHSM9EOKytHSIDclyxq1xi00MmjtJ6+72UF5U0RyAw== X-Google-Smtp-Source: AGHT+IE+mlcGU9gL5r0DLRiIZ4Cjhwbns62N06eQi4e3+/sdu0aeUgDupiLwdfphWx95Mt1PfVCX X-Received: by 2002:a05:6a20:3d1c:b0:1a5:69a3:4c51 with SMTP id y28-20020a056a203d1c00b001a569a34c51mr1769604pzi.46.1711709968531; Fri, 29 Mar 2024 03:59:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711709968; cv=pass; d=google.com; s=arc-20160816; b=OJcU0/C8zKJYtlG6XXRLh4xzQvV46MWQ2687/HwgjtgbRCYdXMFDrONoSU37yfd33F 58tCG8E69J/Oc9blTWq8j8ePY2x+pMwDtOF4OAeGRT5oWBNa8gsaqJBKAg5ncAKkH2m0 wTZ24hUaTL2D7UyMEZLAGuOMdAkf9Ky6dWJwBYTetmUf8j0LhUYXawJrsTvjYi4lxucL SDqlfdnxljL/4di8Xs+L4NAiNYGudQ8QWhz72LGXh2dI4ztE0/Lxww8xuV8LUuY+XlPH lA16AY/ISuCoVpLwxT6ezgsD7gbAe8U9LnqJJRHG4KilQMjDq7OM1yI4acsdDUPJYcnB 8/gg== 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=DkPrZEmi729KgYOkYNyxTSOuwuJKWXBjfL3C3MClIsWdKw0tsMqTFabBSzhrn+bC60 WeDmoAIRktUY5XHjXqEthbrik/2G51c2WCEZhG36WXGV9rw/DtEMYD0OaXzrUWnykcCf KXWWmH1JL8KULRBsTrcUCMzKA1c+gPzK95VCa66h0DCsDY+gejGDbeVnT/phnLdPml2Q xYN0SP5v1IyfIgsEG8FFisXpjHHexJ+3vIMpQi8+9cr6XMRdr3ZebNd9NQfLtZwoP7Hu JCt7dyNjwMw4AlfcO7eLtgS03AP4zMhRSxscW828u7+/hWpIL+gzXJSd4Ejs+z3Tn+fg WLFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-124418-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124418-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 m12-20020a63fd4c000000b005d8bb714e7csi3345583pgj.593.2024.03.29.03.59.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 03:59:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124418-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-124418-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124418-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 D95652882A3 for ; Fri, 29 Mar 2024 10:59:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB6426A323; Fri, 29 Mar 2024 10:57:50 +0000 (UTC) Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) (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 9205D69E0D for ; Fri, 29 Mar 2024 10:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709870; cv=none; b=DUr6fcvhqt2qDwIkgM4HFiJmi2xPfv96hcg6qRO6XWAH+94oytXM86T5AYBu756cZb4YygNx3dE56v9qDYG2k88Bhj1R/uOWSbPqTxWP0ni5qYG+DBCb5nABkjC6PO+hJ4mOLVvtmDykFyzG+BThuGesfWWhQqMFB+vVlzVGtPI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709870; c=relaxed/simple; bh=4haKc0BWmXZv48XAJVDKU0krU0tVfIaoXXWWf/W8YnQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T/XXIHKXmPHphBkZ3PreHulCy5SVVprKBQ2VyJ8WrqArS7oIiOiW2zAj1fmYfYMhKEvYhwCzIDZ6rQ7SXFPB69uE6Ag2svzrNvIy/P3M60r0PZF+ZGgdO/aMqayvbu7I1rFephm3tigm2wR4lYeRi0qjXATkXtigjlm4Al9z1PA= 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.81 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 fgw20.mail.saunalahti.fi (Halon) with ESMTP id 04261c89-edbb-11ee-b3cf-005056bd6ce9; Fri, 29 Mar 2024 12:56:38 +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 v2 01/11] pinctrl: aw9523: Destroy mutex on ->remove() Date: Fri, 29 Mar 2024 12:55:15 +0200 Message-ID: <20240329105634.712457-2-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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