Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17786909rwd; Tue, 27 Jun 2023 07:34:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5a+gXWTX1/eLgX4NgECsID93VairGeRzk7KB37TT9Fpp33c1szzuxuBv6FNdR1thjzXPVZ X-Received: by 2002:a05:6808:1592:b0:3a1:e757:ea14 with SMTP id t18-20020a056808159200b003a1e757ea14mr5668562oiw.51.1687876488482; Tue, 27 Jun 2023 07:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687876488; cv=none; d=google.com; s=arc-20160816; b=pscwvaR3y/IzDGImbk4b3j9lgTvuIWh0tkG5j6Pp7vSrDyRy/UOSJ85SRYW0XkDclN FXZxnTzEFfNfoxXRiuRQlsiEx5wb0bZOlGF3xEdoRtMRmDQKTr5fmTerbbHdskm5PqKb DB2E7iZ8qHuSsGyhOWw6LeJHEsaickQqQyXXlsJ5eSz9QzFre4oh5IUg+gXQ/JfJZOb3 93aA8hmohljJvR7uj5KAUKthp8DP/KxXun/Zjl7RG62FGAyqWNbAYChPcWu1k4q25zQ0 r1Y5n2m+YP7bZr5BDcmaChf2OUvG6aZ5cFqdssG7yTs8Dtf4aVgAmW++H9lHH7Zre+Sx AQGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:references:cc:to:from:content-language:subject :user-agent:mime-version:date:message-id; bh=UAUHyWPnQp7ff7rbMG/M6/sU1H3Qijj6h582W9qEpiI=; fh=J/ZNQK1HOo8qSty2ogx43IkozGOMfaQUxNZ+CFgxiT0=; b=iPVynQfuLxiO4obzJpWFYV0rop9lnQQ4Oa82s8e51g+maiTIY4JK7/EXFaluf9+n3U MEEreXfrC2TH+Y0CPXyDEpGQcWSQHXvlWEP+zfmmF1PXP82Glx4nVm/yd46FyJYMb7UD MUdunF29llvdHvq3+R4RYAz1ckECy3ibHD2ZVYRyTnls8duWQvSYWgPMAbUlI1cEGo6a amcfOo0qiuhR3vt2fbK7pGI7u/SpGKCpHf3QABD7AKjNJp/FU0apAJ0k/m145+RPW3uP 0ub6LrX9C9eh04LuhiSipDOO3CUYA2UwUVvQY8ukOIexPFJWRQam+2taaCvFyJRF1AIN iuBA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a63e113000000b0055b0e39eecdsi1067427pgh.462.2023.06.27.07.34.35; Tue, 27 Jun 2023 07:34:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230477AbjF0OPV (ORCPT + 99 others); Tue, 27 Jun 2023 10:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230259AbjF0OPS (ORCPT ); Tue, 27 Jun 2023 10:15:18 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3AEF12D7B for ; Tue, 27 Jun 2023 07:15:13 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8BxU8Tw7ppkXCYDAA--.5073S3; Tue, 27 Jun 2023 22:15:12 +0800 (CST) Received: from [10.20.42.43] (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7yPv7ppkeVcMAA--.9012S3; Tue, 27 Jun 2023 22:15:11 +0800 (CST) Message-ID: Date: Tue, 27 Jun 2023 22:15:11 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] drm: Remove the deprecated drm_put_dev() function Content-Language: en-US From: Sui Jingfeng To: Thomas Zimmermann , Maarten Lankhorst , Maxime Ripard , David Airlie , Daniel Vetter , Alex Deucher , Christian Koenig , Pan Xinhui Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org References: <20230625050901.393055-1-suijingfeng@loongson.cn> <4672fc8d-ca95-6d00-1303-cb5968c51703@suse.de> <766f323a-efcf-6552-f7e5-a736830c3f12@loongson.cn> Organization: Loongson In-Reply-To: <766f323a-efcf-6552-f7e5-a736830c3f12@loongson.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Cx7yPv7ppkeVcMAA--.9012S3 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj9xXoW7Jw4xuFyUtFW8Aw4xJryUCFX_yoW3ZFg_Wa yDuFZ3Ww4kJ397JF1DAr4xZry7GF4qvrykAa1SvF43Cry7XrZ5Ga45WrnYvryUWwsakry7 KrW5Zrn3J3WavosvyTuYvTs0mTUanT9S1TB71UUUUjUqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUbg8YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_JrI_Jryl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV WUJVW8JwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1ln4kS14v26r1Y6r17M2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12 xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r12 6r1DMcIj6I8E87Iv67AKxVWxJVW8Jr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI4 8JMxk0xIA0c2IEe2xFo4CEbIxvr21lc7CjxVAaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64vI r41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xFxVAFwI0_Jrv_JF1lx2IqxVAqx4xG67 AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIY rxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14 v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWxJVW8 Jr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8xsqJ UUUUU== X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 Hi, On 2023/6/27 16:41, Sui Jingfeng wrote: > I have verified that > > if the ->probe() failed, then the ->remove will be get called. > Sorry, if the ->probe() failed, then the ->remove() will *NOT* get called. > I'm doing the test by add a line before the drm_dev_alloc() > I do the test by adding one line code before the drm_dev_alloc() function  to generate a fault(error) manually, > > See below: > > ``` > >     return -ENODEV; > >     dev = drm_dev_alloc(&kms_driver, &pdev->dev); >     if (IS_ERR(dev)) >         return PTR_ERR(dev); > >     ret = pci_enable_device(pdev); >     if (ret) >         goto err_free; > ``` > > > So, there is no problem, as far as I can see. All in all,  if the ->probe() failed, then the ->remove() will *NOT* get called. -- Jingfeng