[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<PNXPR01MB7488BA555BDE96E59741DBACFEF72@PNXPR01MB7488.INDPRD01.PROD.OUTLOOK.COM>
Date: Wed, 5 Feb 2025 20:57:20 +0800
From: Chen Wang <unicorn_wang@...look.com>
To: Uwe Kleine-König <ukleinek@...nel.org>,
Chen Wang <unicornxw@...il.com>
Cc: robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
inochiama@...look.com, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pwm@...r.kernel.org,
linux-riscv@...ts.infradead.org, chao.wei@...hgo.com,
haijiao.liu@...hgo.com, xiaoguang.xing@...hgo.com, chunzhi.lin@...hgo.com,
Sean Young <sean@...s.org>
Subject: Re: [PATCH v7 2/3] pwm: sophgo: add driver for Sophgo SG2042 PWM
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
Powered by blists - more mailing lists