From patchwork Sun Apr 30 14:01:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lizhe X-Patchwork-Id: 88918 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2178870vqo; Sun, 30 Apr 2023 07:36:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7SgHT2wg3XQrPN+YIJ1SK5xWxgTZevTc77nZwypcQFJc9E2ZArZpLxVd9Z7+MZfZPLK1+6 X-Received: by 2002:a05:6a20:9143:b0:f4:1acb:8b1f with SMTP id x3-20020a056a20914300b000f41acb8b1fmr14768340pzc.2.1682865396132; Sun, 30 Apr 2023 07:36:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682865396; cv=none; d=google.com; s=arc-20160816; b=yylsVHspOtYBuehb0FaGLVnlQzFAg1Hwa8qpbP1VTve05pIvrA/JInNYzJkRefy85h rt9m/ILOo+iGCOZ+Dl/sW8dDO8urikaB4iVOmQB9wg8NfPG24gjVaSbwcceomIC2lD4j 3ToRZevNP93ac0pmumvktChiC3iQXjZdkJJjkNyb0aHRIHgYMT/cP4oM49STV3ZstyX1 IJC3ErC075MicW7Bbscv0O1wnAI3ejauTrzVYdnGCrfuGs4c0iomETSSiRUciJCjOGu2 skqVDOfAPzhWJzwNUCY36ZwC6KaTQONC0Rzl3U+piUG5gV77We5XKPt8n2OAgX4hKdCs /PRw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=vdfSe6AsEohOXu+zr/OQxFcuRoEL1V+oA5NLjf5c/Og=; b=CfPMs/5Ohe1plf7jdvNaVLZUtPerCByJ8nO/Amn8Ph1Sm/igVJKoEbNvS+By3z/vrg 6C8yGxbO/pKxWFFbZpjmjdZEesuMxzbfRYANZ0LeTJ4JHwMumTCiqsmrWQt7SYsqzUjm cosi+Ex20iFCugnkzFTUti3YYP06UfUlEIWwSkmHD4Ia3j8JH2Tbk6Q4/LWpwZXgkbpN vb5IR3z2pyap38ZNt25QXWNerqTEImp9MHELnwIBn+Huir+uh+ym9m+ZPM9gwygMUbDI ZOOShMSBXrAwA90NP6XG90ivuxIEfT6W6UM1Blf86p3HHJ0azERi6FKFXCHAgxE+MxDt 8TPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=nUEQXrBc; 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=NONE sp=NONE dis=NONE) header.from=163.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a63e855000000b0051b70782bc7si26026567pgk.234.2023.04.30.07.36.13; Sun, 30 Apr 2023 07:36:36 -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=@163.com header.s=s110527 header.b=nUEQXrBc; 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=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbjD3OCn (ORCPT + 99 others); Sun, 30 Apr 2023 10:02:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjD3OCm (ORCPT ); Sun, 30 Apr 2023 10:02:42 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 93D68199B; Sun, 30 Apr 2023 07:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=vdfSe 6AsEohOXu+zr/OQxFcuRoEL1V+oA5NLjf5c/Og=; b=nUEQXrBc0Znqa3Fp4IG6P EaUip6IbY3kQM0LHke99z3dCx2viPpPJZa/qm/IWx8T4Jkt8Se5S/VrwLem6oRp4 RMsY//zGBzvj+K2xQdBEdvUrsuXSeTs/Z1+UhZFLIz0+jNxmAgh+xAJZLgqomChE 2zNvfeHjq/fpa/uVtMyquk= Received: from lizhe.. (unknown [120.245.132.239]) by zwqz-smtp-mta-g4-2 (Coremail) with SMTP id _____wB3r1+6dE5kijFUAg--.48793S4; Sun, 30 Apr 2023 22:01:59 +0800 (CST) From: Lizhe To: linus.walleij@linaro.org, orsonzhai@gmail.com, baolin.wang@linux.alibaba.com, zhang.lyra@gmail.com, andriy.shevchenko@linux.intel.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Lizhe Subject: [PATCH] pinctrl:sprd: Check if the pinctrl_dev still exists Date: Sun, 30 Apr 2023 22:01:29 +0800 Message-Id: <20230430140129.112081-1-sensor1010@163.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CM-TRANSID: _____wB3r1+6dE5kijFUAg--.48793S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrKF13GFW7tw4DCr1rCryrtFb_yoWfGrc_GF yrJrWxJw4UGw4Y9w1jkry7ZFWIyF43Xr1SvFnFqFy3C347Xw4UtrykCFs8G34xGwnrAry7 Gry2q3s3Zr17AjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRKGYLJUUUUU== X-Originating-IP: [120.245.132.239] X-CM-SenderInfo: 5vhq20jurqiii6rwjhhfrp/xtbBohhhq1aEIFHrrwAAsX X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764612265574859920?= X-GMAIL-MSGID: =?utf-8?q?1764612265574859920?= to check if the pinctrl_dev still exists before calling pinctrl_unregister(). Signed-off-by: Lizhe --- drivers/pinctrl/sprd/pinctrl-sprd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c index ca9659f4e4b1..52089e34435c 100644 --- a/drivers/pinctrl/sprd/pinctrl-sprd.c +++ b/drivers/pinctrl/sprd/pinctrl-sprd.c @@ -1114,8 +1114,10 @@ EXPORT_SYMBOL_GPL(sprd_pinctrl_core_probe); int sprd_pinctrl_remove(struct platform_device *pdev) { struct sprd_pinctrl *sprd_pctl = platform_get_drvdata(pdev); + + if (sprd_pctl->pctl) + pinctrl_unregister(sprd_pctl->pctl); - pinctrl_unregister(sprd_pctl->pctl); return 0; } EXPORT_SYMBOL_GPL(sprd_pinctrl_remove);