devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xingyu Wu <xingyu.wu@starfivetech.com>
To: Stephen Boyd <sboyd@kernel.org>, Conor Dooley <conor@kernel.org>,
	"Emil Renner Berthing" <kernel@esmil.dk>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	<devicetree@vger.kernel.org>, <linux-riscv@lists.infradead.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Hal Feng <hal.feng@starfivetech.com>,
	<linux-kernel@vger.kernel.org>, <linux-clk@vger.kernel.org>
Subject: Re: [PATCH v4 07/10] clk: starfive: Add StarFive JH7110 Video-Output clock driver
Date: Fri, 14 Apr 2023 09:37:29 +0800	[thread overview]
Message-ID: <f020e55c-d4e4-dbb9-d658-7bef2b8bd94b@starfivetech.com> (raw)
In-Reply-To: <d70886f6ee13e70845a72354fe9a2b7d.sboyd@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 <linux/init.h>
>> >  #include <linux/io.h>
>> >  #include <linux/platform_device.h>
>> > +#include <linux/slab.h>
>> > +
>> > +#include <soc/starfive/reset-starfive-jh71x0.h>
>> >  
>> >  #include <dt-bindings/clock/starfive,jh7110-crg.h>
>> >  
>> > @@ -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

  reply	other threads:[~2023-04-14  1:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11 13:55 [PATCH v4 00/10] Add new partial clock and reset drivers for StarFive JH7110 Xingyu Wu
2023-04-11 13:55 ` [PATCH v4 01/10] reset: starfive: jh7110: Add StarFive STG/ISP/VOUT resets support Xingyu Wu
2023-04-11 13:55 ` [PATCH v4 02/10] dt-bindings: clock: Add StarFive JH7110 System-Top-Group clock and reset generator Xingyu Wu
2023-04-11 13:55 ` [PATCH v4 03/10] clk: starfive: Add StarFive JH7110 System-Top-Group clock driver Xingyu Wu
2023-04-11 13:55 ` [PATCH v4 04/10] dt-bindings: clock: Add StarFive JH7110 Image-Signal-Process clock and reset generator Xingyu Wu
2023-04-11 13:55 ` [PATCH v4 05/10] clk: starfive: Add StarFive JH7110 Image-Signal-Process clock driver Xingyu Wu
2023-04-11 13:55 ` [PATCH v4 06/10] dt-bindings: clock: Add StarFive JH7110 Video-Output clock and reset generator Xingyu Wu
2023-04-11 13:55 ` [PATCH v4 07/10] clk: starfive: Add StarFive JH7110 Video-Output clock driver Xingyu Wu
2023-04-11 18:33   ` Stephen Boyd
2023-04-12  6:15     ` Xingyu Wu
2023-04-13  4:04       ` Stephen Boyd
2023-04-13 13:31         ` Xingyu Wu
2023-04-13 18:38           ` Stephen Boyd
2023-04-14  1:37             ` Xingyu Wu [this message]
2023-04-13 13:52         ` Conor Dooley
2023-04-11 13:55 ` [PATCH v4 08/10] MAINTAINERS: Update maintainer of JH71x0 clock drivers Xingyu Wu
2023-04-11 13:55 ` [PATCH v4 09/10] riscv: dts: starfive: jh7110: Add DVP and HDMI TX pixel external clocks Xingyu Wu
2023-04-11 13:55 ` [PATCH v4 10/10] riscv: dts: starfive: jh7110: Add STGCRG/ISPCRG/VOUTCRG nodes Xingyu Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f020e55c-d4e4-dbb9-d658-7bef2b8bd94b@starfivetech.com \
    --to=xingyu.wu@starfivetech.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hal.feng@starfivetech.com \
    --cc=kernel@esmil.dk \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).