Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4021781rwr; Sat, 29 Apr 2023 21:25:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7mfZ/pkRqdz/w+FFhmAoJMVme0cFIO/SvjTOeQhLpu3AVFtUIo8zMpBkLuHq09wvnTlGHu X-Received: by 2002:a05:6a20:7da6:b0:f1:1ab5:5076 with SMTP id v38-20020a056a207da600b000f11ab55076mr8150835pzj.2.1682828709900; Sat, 29 Apr 2023 21:25:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682828709; cv=none; d=google.com; s=arc-20160816; b=LWhrYoOMGeLrObDRmZwUQf8ENYURUJUaTZY96U8t1nb0kGQ503yYkBmcdDIx0mUe6A rsrlaJYxtmMH7ED4dKASTUm9cphKkA8oEybYxKQQvX5jKozTMnieT7JXlbqiYhk7EVHG R01F697upMGWcjCBuj13CmrPxR6tDx0sfPR3dEOu/rvU+6mVUOFAz2tGJKgLTqe7tH0O FQJM96dmFeYv9tA7XOgfDGhuBGk9qOzh/pzjv2l5upoOQN2gZnoFCjlU5oTswoQ9uzn9 t52M8weWdjQuAiNQ5E6jnNIlXL302rLodNaau4vYkrIUFdlpAFnv1KMAgd334cDnZnAe X2wg== 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=qS63VbA9VLHyDMasvm7Ft009tQW4scOgwMZkX8i1AEE=; b=Tc1vdqrboMT/5kBDHYS/frT5HNLO/VaCdxaHHvMFybZLVKUhbXXjNAOgALNa7+Mef9 BlYd6BOuehmMbrTftPwX15ySgpN2kA3UOZMMED2Q1JoFequ746hoduvX0KxOeX6l2knu zngWN6tiNB0iNJdIl80Ju802xmV7GPS6fOZnQzLWLFKtkzmDmhDZEzWQOTFFVCyks8mv g6TKVfumZw/eFFmdRniI98gSWELHZmq2Gc7a6RD68U/A4TEG4eoT+awdnGk4ZPDNub+z A1Qyz1T7qUJd5qRJIrmxz0MqCNzRhGs50WiKRN7xGB6UhAhkmSYp3hW7+DiA31EKtD0e qCig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=AVdCFteF; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j23-20020a632317000000b0051a650b8f52si24777016pgj.259.2023.04.29.21.24.52; Sat, 29 Apr 2023 21:25:09 -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=AVdCFteF; 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 S229814AbjD3EX6 (ORCPT + 99 others); Sun, 30 Apr 2023 00:23:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjD3EX4 (ORCPT ); Sun, 30 Apr 2023 00:23:56 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E737312F; Sat, 29 Apr 2023 21:23:52 -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=qS63V bA9VLHyDMasvm7Ft009tQW4scOgwMZkX8i1AEE=; b=AVdCFteFfFT5oKkJBpaax UvV2HF97t/OntLR67emuqmehv09sCuP6h2Ng1hc5F4GQ76LOdGzqhtoQrjARyOJQ OAAIhQa/WL1TWTAZdrf5g/njT63KuQAgfZYH6wW22okeXUg0LZz8xmn0Uy9pomfx muEC2TnlKwTK3rqavav/I4= Received: from lizhe.. (unknown [120.245.132.239]) by zwqz-smtp-mta-g3-1 (Coremail) with SMTP id _____wCnVFYi7U1kk68oAg--.9220S4; Sun, 30 Apr 2023 12:23:33 +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, sensor1010@163.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl:sprd: Check if the pinctrl_dev still exists Date: Sun, 30 Apr 2023 12:22:54 +0800 Message-Id: <20230430042254.7543-1-sensor1010@163.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wCnVFYi7U1kk68oAg--.9220S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrKF13GFW7tw4DCr1rCryrtFb_yoW3ZFg_WF yrGrWxJ3yUGw4Y9w1jkry3ZFW0yF43Xr1SvFnFqFy3C347Xw4UtrykCF45G34xG3s7CryU Gryjq393Ar13AjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRKpBTDUUUUU== X-Originating-IP: [120.245.132.239] X-CM-SenderInfo: 5vhq20jurqiii6rwjhhfrp/1tbiKAhhq17WMwX-sAAAsb 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 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..6f3369130e8a 100644 --- a/drivers/pinctrl/sprd/pinctrl-sprd.c +++ b/drivers/pinctrl/sprd/pinctrl-sprd.c @@ -1115,7 +1115,9 @@ int sprd_pinctrl_remove(struct platform_device *pdev) { struct sprd_pinctrl *sprd_pctl = platform_get_drvdata(pdev); - pinctrl_unregister(sprd_pctl->pctl); + if (sprd_pctl->dev) + pinctrl_unregister(sprd_pctl->pctl); + return 0; } EXPORT_SYMBOL_GPL(sprd_pinctrl_remove); -- 2.34.1