From: Thierry Reding <thierry.reding@gmail.com>
To: Paul Cercueil <paul@crapouillou.net>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
od@zcrc.me, linux-pwm@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Mathieu Malaterre" <malat@debian.org>,
"Artur Rojek" <contact@artur-rojek.eu>
Subject: Re: [PATCH v4 3/4] pwm: jz4740: Obtain regmap from parent node
Date: Mon, 30 Mar 2020 16:37:16 +0200 [thread overview]
Message-ID: <20200330143716.GI2431644@ulmo> (raw)
In-Reply-To: <20200323142421.42817-3-paul@crapouillou.net>
[-- Attachment #1: Type: text/plain, Size: 1005 bytes --]
On Mon, Mar 23, 2020 at 03:24:20PM +0100, Paul Cercueil wrote:
[...]
> diff --git a/drivers/pwm/pwm-jz4740.c b/drivers/pwm/pwm-jz4740.c
[...]
> @@ -196,12 +208,19 @@ static const struct pwm_ops jz4740_pwm_ops = {
> static int jz4740_pwm_probe(struct platform_device *pdev)
> {
> struct jz4740_pwm_chip *jz4740;
> + struct device *dev = &pdev->dev;
>
> - jz4740 = devm_kzalloc(&pdev->dev, sizeof(*jz4740), GFP_KERNEL);
> + jz4740 = devm_kzalloc(dev, sizeof(*jz4740), GFP_KERNEL);
> if (!jz4740)
> return -ENOMEM;
>
> - jz4740->chip.dev = &pdev->dev;
> + jz4740->map = device_node_to_regmap(dev->parent->of_node);
> + if (!jz4740->map) {
This seems wrong. According to the code, device_node_to_regmap() returns
an ERR_PTR()-encoded error code on failure, so I think this should be:
if (IS_ERR(jz4740->map)) {
...
return PTR_ERR(jz4740->map);
}
No need to resend for that, I can take care of that when applying. Let
me know if that doesn't work.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-03-30 14:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 14:24 [PATCH v4 1/4] pwm: jz4740: Use clocks from TCU driver Paul Cercueil
2020-03-23 14:24 ` [PATCH v4 2/4] pwm: jz4740: Improve algorithm of clock calculation Paul Cercueil
2020-03-23 14:24 ` [PATCH v4 3/4] pwm: jz4740: Obtain regmap from parent node Paul Cercueil
2020-03-30 14:37 ` Thierry Reding [this message]
2020-03-30 16:41 ` Paul Cercueil
2020-03-23 14:24 ` [PATCH v4 4/4] pwm: jz4740: Allow selection of PWM channels 0 and 1 Paul Cercueil
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=20200330143716.GI2431644@ulmo \
--to=thierry.reding@gmail.com \
--cc=contact@artur-rojek.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=malat@debian.org \
--cc=od@zcrc.me \
--cc=paul@crapouillou.net \
--cc=u.kleine-koenig@pengutronix.de \
/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).