devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hal Feng <hal.feng@starfivetech.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Rob Herring <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Walker Chen <walker.chen@starfivetech.com>,
	Xingyu Wu <xingyu.wu@starfivetech.com>,
	Emil Renner Berthing <emil.renner.berthing@canonical.com>
Cc: <alsa-devel@alsa-project.org>, <devicetree@vger.kernel.org>,
	<linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] ASoC: starfive: Add JH7110 PWM-DAC driver
Date: Thu, 3 Aug 2023 11:00:47 +0800	[thread overview]
Message-ID: <2ea68c95-1581-a67d-613b-5315fcfd0016@starfivetech.com> (raw)
In-Reply-To: <b938ba84-38e9-b220-9686-6656e4452c10@linaro.org>

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

> 
>> +	}
>> +


  reply	other threads:[~2023-08-03  3:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31  3:28 [PATCH v2 0/3] Add PWM-DAC audio support for StarFive JH7110 RISC-V SoC Hal Feng
2023-07-31  3:28 ` [PATCH v2 1/3] ASoC: dt-bindings: Add StarFive JH7110 PWM-DAC controller Hal Feng
2023-07-31  3:28 ` [PATCH v2 2/3] ASoC: starfive: Add JH7110 PWM-DAC driver Hal Feng
2023-07-31  7:06   ` Krzysztof Kozlowski
2023-08-03  3:00     ` Hal Feng [this message]
2023-07-31 19:14   ` Mark Brown
2023-08-03  8:37     ` Hal Feng
2023-07-31  3:28 ` [PATCH v2 3/3] riscv: dts: starfive: Add JH7110 PWM-DAC support Hal Feng

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=2ea68c95-1581-a67d-613b-5315fcfd0016@starfivetech.com \
    --to=hal.feng@starfivetech.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=claudiu.beznea@microchip.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=emil.renner.berthing@canonical.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=tiwai@suse.com \
    --cc=walker.chen@starfivetech.com \
    --cc=xingyu.wu@starfivetech.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;
as well as URLs for NNTP newsgroup(s).