Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp176433rwb; Tue, 4 Oct 2022 02:22:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6FelxRB0HX2X5PYzsJQ1p65fMgXwmtf8+UDSgpT70J8vv3JHxFu49/R2TbZ4SMg6qlnnhN X-Received: by 2002:a63:2c90:0:b0:439:ee2c:ab2f with SMTP id s138-20020a632c90000000b00439ee2cab2fmr23236053pgs.2.1664875320735; Tue, 04 Oct 2022 02:22:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664875320; cv=none; d=google.com; s=arc-20160816; b=fsBGVfUF1HRKgJx9h5Cy9m8q8gqsDBgtJd8Aqtg7ei1iSpBThhWt68/Oj2MrlYPH55 /Jie8A+uM0qOa211275eprOXeXY9x7s1oM1moaxo40ih7wjIbxJiO/AaKIuQmBIoPXbj AKavrpr3AHmphQKz/Hci1Aoe7zpmwjuFatnBLhwMBypFc5mPzspemk0BYQKipUP9TabU cvMKg2aE89ND3kJuWZF1iz3OckQAUvFtcE5GA/lK2ngYc9ZoxB4FWAlPGPh9SgTglfdV Kl0P7TKDCRV7teSy7nOiJbg4dJz6pBZdsc1HCHPTp4SJPjvGm6sOj979z5xipafWepbn uPsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1TShRxOXdXzikLcCAMTU0UuvmL5GKEd08RwA5BOWrd4=; b=eCh0OO0Y/HorJSyc5b0AyOu8vJrNJkDxcELF5ChrXVspReXH3YxkBaFEHtf0zYd8CV hcWlTUFf2AFxj1r8yLNDfecffCDAFyOqiIxqD2CNrVu2SpKiPbqDm+pGvqZc0aQ2wGsr j3vw0TByx/orzPpoNXZVGaWNZrgfZrMcE4jzs1jhOp8oDHS+T+ZFqAOmI28L64BnvIp2 uT9njJx0MQAVe37sPTwABhssw/CWUVoATaiqEjJ3SOJKBAyhEYp8SatrHb8dttjujJff 0LRc8xhd3CzQ4JZ8WBnwOJzUAfnUOOt8LmHvvEvQJ15YAO3oot3iiVmpbFQObzBHdHab QMgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=UWvjRFjJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lp8-20020a17090b4a8800b001f541fc751fsi2543511pjb.190.2022.10.04.02.21.48; Tue, 04 Oct 2022 02:22:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=UWvjRFjJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230400AbiJDJJU (ORCPT + 99 others); Tue, 4 Oct 2022 05:09:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiJDJJS (ORCPT ); Tue, 4 Oct 2022 05:09:18 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FFBA36873; Tue, 4 Oct 2022 02:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1664874557; x=1696410557; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=d0Q4O+kmvKaauRU9ZS3xkd85MWtpgvf4CT6+vWYRHb0=; b=UWvjRFjJWYZiDVV5Ch4LmHnb5ycRmOrX2V1hWgsW4ofljXeqDM6BK88p 54XTyW+5v+uNDuXjunMBq+hddE95IGYfM6Zz/o87DwO0q67R5hfSsQWUQ 4CKvgocbpUS1Iojn1GDeADKnN6PpvD2sKKx3Sh30EuMXVbDY24SPvKcaD hoB6b2KLlcDJPZ3dZn1xcdQWBVU7Q2mxLslybiMQ+THAdncwX8YHimKiS ogtyabzv0tfBoe838P+l7F0MFh9Lj0LmUp+h8JBSDiR42+Ic9H2CU0SE/ x7CrroY57EusdkbSAPj769CIMTZEW5SjN+d4+xy6w8jUrQLCoNJVFXC4g w==; X-IronPort-AV: E=Sophos;i="5.93,367,1654585200"; d="scan'208";a="176912392" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Oct 2022 02:09:16 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Tue, 4 Oct 2022 02:09:15 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Tue, 4 Oct 2022 02:09:15 -0700 Date: Tue, 4 Oct 2022 11:13:47 +0200 From: Horatiu Vultur To: Yang Yingliang CC: , , , , Subject: Re: [PATCH -next v3] pinctrl: ocelot: add missing destroy_workqueue() in error path in ocelot_pinctrl_probe() Message-ID: <20221004091347.fotcdx75ut7zaly5@soft-dev3-1.localhost> References: <20220925021258.1492905-1-yangyingliang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20220925021258.1492905-1-yangyingliang@huawei.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 09/25/2022 10:12, Yang Yingliang wrote: > > Using devm_add_action_or_reset() to make workqueue device-managed, so it can be > destroy whenever the driver is unbound. Reviewed-by: Horatiu Vultur > > Fixes: c297561bc98a ("pinctrl: ocelot: Fix interrupt controller") > Signed-off-by: Yang Yingliang > --- > v3: > Using devm_add_action_or_reset(). > > v2: > move alloc_ordered_workqueue() after ocelot_pinctrl_register(). > --- > drivers/pinctrl/pinctrl-ocelot.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c > index 62ce3957abe4..266fbc957273 100644 > --- a/drivers/pinctrl/pinctrl-ocelot.c > +++ b/drivers/pinctrl/pinctrl-ocelot.c > @@ -2038,6 +2038,11 @@ static struct regmap *ocelot_pinctrl_create_pincfg(struct platform_device *pdev, > return devm_regmap_init_mmio(&pdev->dev, base, ®map_config); > } > > +static void ocelot_destroy_workqueue(void *data) > +{ > + destroy_workqueue(data); > +} > + > static int ocelot_pinctrl_probe(struct platform_device *pdev) > { > const struct ocelot_match_data *data; > @@ -2069,6 +2074,11 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) > if (!info->wq) > return -ENOMEM; > > + ret = devm_add_action_or_reset(dev, ocelot_destroy_workqueue, > + info->wq); > + if (ret) > + return ret; > + > info->pincfg_data = &data->pincfg_data; > > reset = devm_reset_control_get_optional_shared(dev, "switch"); > @@ -2110,15 +2120,6 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) > return 0; > } > > -static int ocelot_pinctrl_remove(struct platform_device *pdev) > -{ > - struct ocelot_pinctrl *info = platform_get_drvdata(pdev); > - > - destroy_workqueue(info->wq); > - > - return 0; > -} > - > static struct platform_driver ocelot_pinctrl_driver = { > .driver = { > .name = "pinctrl-ocelot", > @@ -2126,7 +2127,6 @@ static struct platform_driver ocelot_pinctrl_driver = { > .suppress_bind_attrs = true, > }, > .probe = ocelot_pinctrl_probe, > - .remove = ocelot_pinctrl_remove, > }; > module_platform_driver(ocelot_pinctrl_driver); > > -- > 2.25.1 > -- /Horatiu