Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5905624pxv; Thu, 29 Jul 2021 01:06:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwwyEGDgG6FBuqdY5iPDJX/gS3PTLhfvm/bjuy88ehsBndSOMplt2VGQDBw5yIvR9kJqkn X-Received: by 2002:a17:906:3e02:: with SMTP id k2mr3368125eji.479.1627546007221; Thu, 29 Jul 2021 01:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627546007; cv=none; d=google.com; s=arc-20160816; b=kH+9VxxuDt7kudLSId9OvXQ1PNNU450Q/91fYJjhTa7qznEdcTLjkBxqSlB18hIjU1 mJkSRaoJ3UMbcWhZj+mMov8NRq/bmmPIc7f/L9acQbcs5sg+flZ8Spwy6FsMDPNOBwXJ lh6ZZlg8NVn9jVCeYtvWwcXNBeY++Be7dXf43Uh8h+CJHGCQxCR8R+Mo0okeRbFHYi97 SSwaMl5wCut//Wc1Tb0bTa20Cy7/s7714KUHrM3sd3HwGn0VI+Lme9n3xSo+tii/onjr FV6GTMC3zBYG12+0FFvusCCMjwTT3+6Onj5Uj4+sBY+xnOMTPYSLCuuPFZNVcaiDZawa Tg9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=/ditySLPLaLNdFPGGnrAk4NIUAIW2g0czPOJewRph6E=; b=sH6mYM3hq2GVzTHotl8ROezVc4dahyuASGtDlo8hySFVpkeR7OoN6B8LHHZgvxComg tQEvEBiTEsPuQxHqfMDET2NUbtwFyZIcJIXB+nhhyqErDfy0TmCm44BcnVOqcPU5p42i bhc2y0xk4H8m5mRaEFuLL/4CJZYhK2MTkq2j3CVJMR29vn1sLuRawPziqZMj1d/73fxQ eznFqMNqln/sRg0AYyKp7JKSLL8r7y5zCKy5VmG8XP1qJMPp9+FtN/7S4Z1dUjLn9vs0 B8m/itabaVI9/QNzVIyMOcmG+V/OVrbmeY4vznHiZzYZaT7HORoaILt/mQbQKFtuS8H5 5Vmg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si2250188ejd.416.2021.07.29.01.06.23; Thu, 29 Jul 2021 01:06:47 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234843AbhG2IDB (ORCPT + 99 others); Thu, 29 Jul 2021 04:03:01 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:58844 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S234683AbhG2ICy (ORCPT ); Thu, 29 Jul 2021 04:02:54 -0400 X-UUID: 6a40c968f07941fba8a03fcde679b9ae-20210729 X-UUID: 6a40c968f07941fba8a03fcde679b9ae-20210729 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1639818568; Thu, 29 Jul 2021 16:02:11 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 29 Jul 2021 16:02:09 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 29 Jul 2021 16:02:08 +0800 From: Hui Liu To: , , , CC: , , , , , , , , , , , , Subject: [PATCH v1] iio: mtk-auxadc: add mutex_destroy Date: Thu, 29 Jul 2021 16:01:35 +0800 Message-ID: <20210729080135.17436-2-hui.liu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210729080135.17436-1-hui.liu@mediatek.com> References: <20210729080135.17436-1-hui.liu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add mutex_destroy when probe fail and remove device. Signed-off-by: Hui Liu --- drivers/iio/adc/mt6577_auxadc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c index 79c1dd68b909..d57243037ad6 100644 --- a/drivers/iio/adc/mt6577_auxadc.c +++ b/drivers/iio/adc/mt6577_auxadc.c @@ -289,6 +289,7 @@ static int mt6577_auxadc_probe(struct platform_device *pdev) ret = iio_device_register(indio_dev); if (ret < 0) { dev_err(&pdev->dev, "failed to register iio device\n"); + mutex_destroy(&adc_dev->lock); goto err_power_off; } @@ -313,6 +314,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev) 0, MT6577_AUXADC_PDN_EN); clk_disable_unprepare(adc_dev->adc_clk); + mutex_destroy(&adc_dev->lock); return 0; } -- 2.18.0