public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: "Liang He" <windhl@126.com>
To: "Martin Blumenstingl" <martin.blumenstingl@googlemail.com>
Cc: "Neil Armstrong" <narmstrong@baylibre.com>,
	khilman@baylibre.com,  jbrunet@baylibre.com,
	inux-amlogic@lists.infradead.org,
	 linux-amlogic@lists.infradead.org,
	 linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re:Re: [PATCH] soc: amlogic: meson-pwrc: Hold reference returned by of_get_parent()
Date: Tue, 26 Jul 2022 08:58:13 +0800 (CST)	[thread overview]
Message-ID: <48085de5.7dd.1823802f2c1.Coremail.windhl@126.com> (raw)
In-Reply-To: <CAFBinCC1x-655H2LbbUhiVGmgXL+tdSRnCPV0a-NJcZKOFJZuw@mail.gmail.com>


At 2022-07-26 03:46:30, "Martin Blumenstingl" <martin.blumenstingl@googlemail.com> wrote:
>Hello,
>
>thank you for your patch!
>
>On Tue, Jul 5, 2022 at 4:20 AM Liang He <windhl@126.com> wrote:
>[...]
>> +       struct device_node *np;
>>
>>         int i, ret;
>>
>>         match = of_device_get_match_data(&pdev->dev);
>> @@ -495,7 +496,9 @@ static int meson_ee_pwrc_probe(struct platform_device *pdev)
>>
>>         pwrc->xlate.num_domains = match->count;
>>
>> -       regmap_hhi = syscon_node_to_regmap(of_get_parent(pdev->dev.of_node));
>> +       np = of_get_parent(pdev->dev.of_node);
>> +       regmap_hhi = syscon_node_to_regmap(np);
>This works but I had to read the code twice because I thought the
>wrong struct device_node was used.
>Other drivers typically use "np" for whatever the code section
>currently refers to. In this case the code section is about the power
>controller, so I thought that "np" was the same as
>"pdev->dev.of_node".
>
>I think the code would be easier to understand and the likelihood of
>someone making the same mistake as I did if you could rename "np" to
>"parent_np" (just like you have done in your other patches).
>
>[...]
>> +       struct device_node *np;
>same as above, I suggest renaming this to parent_np.

Thanks, I will send a new verison soon.

Liang
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-07-26  1:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220705022032.281665-1-windhl@126.com>
2022-07-05  7:22 ` [PATCH] soc: amlogic: meson-pwrc: Hold reference returned by of_get_parent() Neil Armstrong
2022-07-25 19:46 ` Martin Blumenstingl
2022-07-26  0:58   ` Liang He [this message]
2022-07-26  1:17   ` Liang He
2022-07-26  5:18     ` Martin Blumenstingl

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=48085de5.7dd.1823802f2c1.Coremail.windhl@126.com \
    --to=windhl@126.com \
    --cc=inux-amlogic@lists.infradead.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.com \
    /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