From: Chen Wang <unicorn_wang@outlook.com>
To: "Uwe Kleine-König" <ukleinek@kernel.org>,
"Chen Wang" <unicornxw@gmail.com>
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
inochiama@outlook.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org,
linux-riscv@lists.infradead.org, chao.wei@sophgo.com,
haijiao.liu@sophgo.com, xiaoguang.xing@sophgo.com,
chunzhi.lin@sophgo.com, Sean Young <sean@mess.org>
Subject: Re: [PATCH v7 2/3] pwm: sophgo: add driver for Sophgo SG2042 PWM
Date: Wed, 5 Feb 2025 20:57:20 +0800 [thread overview]
Message-ID: <PNXPR01MB7488BA555BDE96E59741DBACFEF72@PNXPR01MB7488.INDPRD01.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <ivgsidvdx2ypntnlopww6fiwyuzj2sadt3znyofr54dsz3c5d4@3mr25vhwlwy3>
On 2025/2/5 18:06, Uwe Kleine-König wrote:
> Hello Chen,
>
> I was tempted to apply this patch while reading throug it until nearly
> the end ...
>
> On Wed, Feb 05, 2025 at 03:01:13PM +0800, Chen Wang wrote:
>> [...]
>> +static int pwm_sg2042_probe(struct platform_device *pdev)
>> +{
>> [...]
>> + rst = devm_reset_control_get_optional_shared_deasserted(dev, NULL);
>> + if (IS_ERR(rst))
>> + return dev_err_probe(dev, PTR_ERR(rst), "Failed to get reset\n");
>> +
>> + chip->ops = &pwm_sg2042_ops;
>> + chip->atomic = true;
>> +
>> + ret = devm_pwmchip_add(dev, chip);
>> + if (ret < 0) {
>> + reset_control_assert(rst);
> This is wrong (well, or unneeded). With
> devm_reset_control_get_optional_shared_deasserted() the devm cleanup
> cares for reasserting the reset.
>
>> + return dev_err_probe(dev, ret, "Failed to register PWM chip\n");
>> + }
>> +
>> + return 0;
>> +}
> If you want I can apply and squash the following in:
>
> diff --git a/drivers/pwm/pwm-sophgo-sg2042.c b/drivers/pwm/pwm-sophgo-sg2042.c
> index ce8cf8af3402..ff4639d849ce 100644
> --- a/drivers/pwm/pwm-sophgo-sg2042.c
> +++ b/drivers/pwm/pwm-sophgo-sg2042.c
> @@ -174,10 +174,8 @@ static int pwm_sg2042_probe(struct platform_device *pdev)
> chip->atomic = true;
>
> ret = devm_pwmchip_add(dev, chip);
> - if (ret < 0) {
> - reset_control_assert(rst);
> + if (ret < 0)
> return dev_err_probe(dev, ret, "Failed to register PWM chip\n");
> - }
>
> return 0;
> }
>
> ack?
>
> Best regards
> Uwe
Ack.
Thanks,
Chen
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2025-02-05 13:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 6:59 [PATCH v7 0/3] pwm: Add pwm driver for Sophgo SG2042 Chen Wang
2025-02-05 7:00 ` [PATCH v7 1/3] dt-bindings: pwm: sophgo: add PWM controller for SG2042 Chen Wang
2025-02-05 7:01 ` [PATCH v7 2/3] pwm: sophgo: add driver for Sophgo SG2042 PWM Chen Wang
2025-02-05 10:06 ` Uwe Kleine-König
2025-02-05 12:57 ` Chen Wang [this message]
2025-02-05 16:33 ` Uwe Kleine-König
2025-02-06 1:10 ` Inochi Amaoto
2025-02-05 7:01 ` [PATCH v7 3/3] riscv: sophgo: dts: add pwm controller for SG2042 SoC Chen Wang
2025-02-09 1:35 ` (subset) [PATCH v7 0/3] pwm: Add pwm driver for Sophgo SG2042 Inochi Amaoto
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=PNXPR01MB7488BA555BDE96E59741DBACFEF72@PNXPR01MB7488.INDPRD01.PROD.OUTLOOK.COM \
--to=unicorn_wang@outlook.com \
--cc=chao.wei@sophgo.com \
--cc=chunzhi.lin@sophgo.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=haijiao.liu@sophgo.com \
--cc=inochiama@outlook.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=robh@kernel.org \
--cc=sean@mess.org \
--cc=ukleinek@kernel.org \
--cc=unicornxw@gmail.com \
--cc=xiaoguang.xing@sophgo.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