[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2ea68c95-1581-a67d-613b-5315fcfd0016@starfivetech.com>
Date: Thu, 3 Aug 2023 11:00:47 +0800
From: Hal Feng <hal.feng@...rfivetech.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Mark Brown <broonie@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Claudiu Beznea <claudiu.beznea@...rochip.com>,
Rob Herring <robh+dt@...nel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Walker Chen <walker.chen@...rfivetech.com>,
Xingyu Wu <xingyu.wu@...rfivetech.com>,
Emil Renner Berthing <emil.renner.berthing@...onical.com>
CC: <alsa-devel@...a-project.org>, <devicetree@...r.kernel.org>,
<linux-riscv@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/3] ASoC: starfive: Add JH7110 PWM-DAC driver
On Mon, 31 Jul 2023 09:06:10 +0200, Krzysztof Kozlowski wrote:
> On 31/07/2023 05:28, Hal Feng wrote:
>> Add PWM-DAC driver support for the StarFive JH7110 SoC.
>>
>
>
> ...
>
>> +static int jh7110_pwmdac_probe(struct platform_device *pdev)
>> +{
>> + struct jh7110_pwmdac_dev *dev;
>> + struct resource *res;
>> + int ret;
>> +
>> + dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
>> + if (!dev)
>> + return -ENOMEM;
>> +
>> + dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
>> + if (IS_ERR(dev->base))
>> + return PTR_ERR(dev->base);
>> +
>> + dev->mapbase = res->start;
>> +
>> + dev->clks[0].id = "apb";
>> + dev->clks[1].id = "core";
>> +
>> + ret = devm_clk_bulk_get(&pdev->dev, ARRAY_SIZE(dev->clks), dev->clks);
>> + if (ret) {
>> + dev_err(&pdev->dev, "failed to get pwmdac clocks\n");
>
> return dev_err_probe
OK, will fix.
>
>> + return ret;
>> + }
>> +
>> + dev->rst_apb = devm_reset_control_get_exclusive(&pdev->dev, NULL);
>> + if (IS_ERR(dev->rst_apb)) {
>> + dev_err(&pdev->dev, "failed to get pwmdac apb reset\n");
>> + return PTR_ERR(dev->rst_apb);
>
> return dev_err_probe
Will fix.
>
>> + }
>> +
>> + dev->dev = &pdev->dev;
>> + dev->shift = PWMDAC_SHIFT_8;
>> + dev->duty_cycle = PWMDAC_CYCLE_CENTER;
>> + dev->cnt_n = PWMDAC_SAMPLE_CNT_1;
>> + dev->data_change = NO_CHANGE;
>> + dev->data_mode = INVERTER_DATA_MSB;
>> + dev->data_shift = PWMDAC_DATA_LEFT_SHIFT_BIT_0;
>> +
>> + dev_set_drvdata(&pdev->dev, dev);
>> + ret = devm_snd_soc_register_component(&pdev->dev,
>> + &jh7110_pwmdac_component,
>> + &jh7110_pwmdac_dai, 1);
>> + if (ret) {
>> + dev_err(&pdev->dev, "failed to register dai\n");
>> + return ret;
>
> I guess here as well for consistency and shorter code even though
> EPROBE_DEFER does not happen really.
>
> return dev_err_probe
Will fix.
>
>> + }
>> +
>> + ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
>> + if (ret) {
>> + dev_err(&pdev->dev, "failed to register pcm\n");
>> + return ret;
>
> return dev_err_probe
Will fix. Thanks for your review.
Best regards,
Hal
>
>> + }
>> +
Powered by blists - more mailing lists