Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3249444rwl; Thu, 13 Apr 2023 18:51:14 -0700 (PDT) X-Google-Smtp-Source: AKy350a753Ex6WU7swDKpyo7WjeDtytTgUm+1z3myhrh3x/UOK2yz3Qu8Hi8Xho8U1onZadQs3b8 X-Received: by 2002:a17:902:fb46:b0:1a0:50bd:31bf with SMTP id lf6-20020a170902fb4600b001a050bd31bfmr888001plb.32.1681437074517; Thu, 13 Apr 2023 18:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681437074; cv=none; d=google.com; s=arc-20160816; b=O/MQwklkduyA4M1pp4knBbWpTsd4etirqQCLfajgObpFo14R1jSbN//RDA2JMkAXwQ wApwT2a48iFHu8HYlKV0q0LwkifCxKMbbilSYPlY9hxsWmqj7ZoLw98ScXPR2oIKRz51 F4dQNWo4rQnzLNfWpRQugNEzTjk+TfMTjSMFUhOJVmaHKa2CPFLuk+jcAeURfo/99mkc 1+N+VY7TgZ9NY6RTAJJz4WMKIGADjL7y2h49Zjow119MqKUuevIOF9aoeZ6tL1wpz3nX WAdOwJsoHN9iwlZOq8Uo2DjvLNc4Onm2JtP/WRWcjdP4YOuWwORSPX9xKDtGa7YRfloU cPeA== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=2OUZfTe9xBnOGfWS9h1fENcVsxZeS15Q8IY7LWfUN50=; b=c8q8NVgsw8aLI6eVBQhNG2k06ORHzrybMw1T3Id0mXTar1z6sVuJQeis0N/7eZxzPJ 7V1jShlgU5DvatehT8ACmbxKLSgsPQgTQR8Yp9wJKpTwz9l0QVIB8AJRVSHGHlV91oqw MPXOTDGBP8p/SIUXJ/sQO+Qh4TRp8BLMOo9RbaTEgYZQA+5TBBiCaB4GWCtfFJa/GXgo aF/7oLzW5nP4AIHyv0BA1RfajckQrUXkj8rBVuj6P9T3etWAHIrT3BSHvjpZx9Ph1OnS 4B7mYxq8z4eeO2bQGOXl+Y7CGWA46E6nUdSG1Ka9CeTjBUEPEcedGBbgt2x/5+bMdUgE klPQ== 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 x5-20020a654145000000b005138c1f1fccsi3220089pgp.31.2023.04.13.18.50.40; Thu, 13 Apr 2023 18:51:14 -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 S229736AbjDNBip (ORCPT + 99 others); Thu, 13 Apr 2023 21:38:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjDNBin (ORCPT ); Thu, 13 Apr 2023 21:38:43 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD9F52697; Thu, 13 Apr 2023 18:38:39 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 1D2778086; Fri, 14 Apr 2023 09:38:27 +0800 (CST) Received: from EXMBX061.cuchost.com (172.16.6.61) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 14 Apr 2023 09:38:26 +0800 Received: from [192.168.125.131] (183.27.97.249) by EXMBX061.cuchost.com (172.16.6.61) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 14 Apr 2023 09:38:25 +0800 Message-ID: Date: Fri, 14 Apr 2023 09:37:29 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH v4 07/10] clk: starfive: Add StarFive JH7110 Video-Output clock driver Content-Language: en-US To: Stephen Boyd , Conor Dooley , "Emil Renner Berthing" , Krzysztof Kozlowski , Michael Turquette , Philipp Zabel , , CC: Rob Herring , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , , References: <20230411135558.44282-1-xingyu.wu@starfivetech.com> <20230411135558.44282-8-xingyu.wu@starfivetech.com> <683cbe934d1df9436e003466d2a419ef.sboyd@kernel.org> <463ee23c-f617-bed0-27a8-56c6fb40d092@starfivetech.com> <4ed4d0e6-8da5-7eef-8713-44854b8d4a9b@starfivetech.com> From: Xingyu Wu In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [183.27.97.249] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX061.cuchost.com (172.16.6.61) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_MSPIKE_H2,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 On 2023/4/14 2:38, Stephen Boyd wrote: > Quoting Xingyu Wu (2023-04-13 06:31:12) >> On 2023/4/13 12:04, Stephen Boyd wrote: >> > diff --git a/drivers/clk/starfive/clk-starfive-jh7110-sys.c b/drivers/clk/starfive/clk-starfive-jh7110-sys.c >> > index 5ec210644e1d..851b93d0f371 100644 >> > --- a/drivers/clk/starfive/clk-starfive-jh7110-sys.c >> > +++ b/drivers/clk/starfive/clk-starfive-jh7110-sys.c >> > @@ -11,6 +11,9 @@ >> > #include >> > #include >> > #include >> > +#include >> > + >> > +#include >> > >> > #include >> > >> > @@ -335,26 +338,32 @@ static void jh7110_reset_unregister_adev(void *_adev) >> > struct auxiliary_device *adev = _adev; >> > >> > auxiliary_device_delete(adev); >> > + auxiliary_device_uninit(adev); >> > } >> > >> > static void jh7110_reset_adev_release(struct device *dev) >> > { >> > struct auxiliary_device *adev = to_auxiliary_dev(dev); >> > + struct jh71x0_reset_adev *rdev = to_jh71x0_reset_adev(adev); >> > >> > - auxiliary_device_uninit(adev); >> > + kfree(rdev); >> > } >> > >> > int jh7110_reset_controller_register(struct jh71x0_clk_priv *priv, >> > const char *adev_name, >> > u32 adev_id) >> > { >> > + struct jh71x0_reset_adev *rdev; >> > struct auxiliary_device *adev; >> > int ret; >> > >> > - adev = devm_kzalloc(priv->dev, sizeof(*adev), GFP_KERNEL); >> > - if (!adev) >> > + rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); >> >> Can there use 'devm_kzalloc'? Are you not using this because the struct is public and clock driver >> and reset driver both use it. But I think the both clock driver and reset driver are the same >> device and can use 'devm_kzalloc'. > > No. The release function for the auxiliary_device is supposed to free > the memory. It shouldn't be tied to the lifetime of anything like the > lifetime of the clk driver being bound. Get it. Thanks. Best regards, Xingyu Wu