From: "Rojewski, Cezary" <cezary.rojewski@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "pierre-louis.bossart@linux.intel.com"
<pierre-louis.bossart@linux.intel.com>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"Kaczmarski, Filip" <filip.kaczmarski@intel.com>,
"N, Harshapriya" <harshapriya.n@intel.com>,
"Barlik, Marcin" <marcin.barlik@intel.com>,
"zwisler@google.com" <zwisler@google.com>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"tiwai@suse.com" <tiwai@suse.com>,
"Proborszcz, Filip" <filip.proborszcz@intel.com>,
"broonie@kernel.org" <broonie@kernel.org>,
"amadeuszx.slawinski@linux.intel.com"
<amadeuszx.slawinski@linux.intel.com>,
"Wasko, Michal" <michal.wasko@intel.com>,
"cujomalainey@chromium.org" <cujomalainey@chromium.org>,
"Hejmowski, Krzysztof" <krzysztof.hejmowski@intel.com>,
"Papierkowski, Piotr \(Habana\)" <ppapierkowski@habana.ai>,
"Gopal, Vamshi Krishna" <vamshi.krishna.gopal@intel.com>
Subject: RE: [PATCH v5 01/13] ASoC: Intel: Add catpt device
Date: Mon, 21 Sep 2020 10:59:13 +0000 [thread overview]
Message-ID: <f4a2b707794c4b95b031f0566fd5b76a@intel.com> (raw)
In-Reply-To: <106a660275de43fd93cce153b529ef2a@intel.com>
On 2020-09-17 5:15 PM, Rojewski, Cezary wrote:
> On 2020-09-16 5:24 PM, Andy Shevchenko wrote:
>> On Tue, Sep 15, 2020 at 06:29:32PM +0200, Cezary Rojewski wrote:
>>> Declare base structures, registers and device routines for the catpt
>>> solution. Catpt deprecates and is a direct replacement for
>>> sound/soc/intel/haswell. Supports Lynxpoint and Wildcat Point both.
...
>>> +static int __maybe_unused catpt_suspend(struct device *dev)
>>> +{
>>> + struct catpt_dev *cdev = dev_get_drvdata(dev);
>>> + struct dma_chan *chan;
>>> + int ret;
>>> +
>>> + chan = catpt_dma_request_config_chan(cdev);
>>> + if (IS_ERR(chan))
>>> + return PTR_ERR(chan);
>>> +
>>> + memset(&cdev->dx_ctx, 0, sizeof(cdev->dx_ctx));
>>> + ret = catpt_ipc_enter_dxstate(cdev, CATPT_DX_STATE_D3, &cdev->dx_ctx);
>>> + if (ret) {
>>> + ret = CATPT_IPC_ERROR(ret);
>>> + goto exit;
>>> + }
>>> +
>>> + ret = catpt_dsp_stall(cdev, true);
>>> + if (ret)
>>> + goto exit;
>>> +
>>> + ret = catpt_store_memdumps(cdev, chan);
>>> + if (ret) {
>>> + dev_err(cdev->dev, "store memdumps failed: %d\n", ret);
>>> + goto exit;
>>> + }
>>> +
>>> + ret = catpt_store_module_states(cdev, chan);
>>> + if (ret) {
>>> + dev_err(cdev->dev, "store module states failed: %d\n", ret);
>>> + goto exit;
>>> + }
>>> +
>>> + ret = catpt_store_streams_context(cdev, chan);
>>> + if (ret) {
>>> + dev_err(cdev->dev, "store streams ctx failed: %d\n", ret);
>>> + goto exit;
>>> + }
>>
>>> +exit:
>>
>> I would rather name it as 'out_dma_release' or so to explain what's going to be
>> done.
>>
>
> I find more descriptive labels inviting reader into: "this is an error
> path" thinking and that's why I prefer to stick with simple 'exit'. If
> you think that's not a way to go, can change this.
>
As I'm sending v7, goto labels have been updated to be move readable as
you requested: 'release_dma_chan'.
Notice that 'if' preceding 'exit' label can be simplified: drop goto,
drop redundant brackets.
I've added that into v7 update too.
Thanks,
Czarek
next prev parent reply other threads:[~2020-09-21 11:00 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 16:29 [PATCH v5 00/13] ASoC: Intel: Catpt - Lynx and Wildcat point Cezary Rojewski
2020-09-15 16:29 ` [PATCH v5 01/13] ASoC: Intel: Add catpt device Cezary Rojewski
2020-09-16 15:24 ` Andy Shevchenko
2020-09-16 16:56 ` Andy Shevchenko
2020-09-16 18:30 ` Rojewski, Cezary
2020-09-16 19:12 ` Andy Shevchenko
2020-09-16 19:53 ` Rojewski, Cezary
2020-09-17 10:58 ` Liam Girdwood
2020-09-17 15:15 ` Rojewski, Cezary
2020-09-21 10:59 ` Rojewski, Cezary [this message]
2020-09-15 16:29 ` [PATCH v5 02/13] ASoC: Intel: catpt: Define DSP operations Cezary Rojewski
2020-09-16 15:44 ` Andy Shevchenko
2020-09-17 15:29 ` Rojewski, Cezary
2020-09-18 13:52 ` Andy Shevchenko
2020-09-21 10:54 ` Rojewski, Cezary
2020-09-15 16:29 ` [PATCH v5 03/13] ASoC: Intel: catpt: Firmware loading and context restore Cezary Rojewski
2020-09-16 16:58 ` Andy Shevchenko
2020-09-15 16:29 ` [PATCH v5 04/13] ASoC: Intel: catpt: Implement IPC protocol Cezary Rojewski
2020-09-15 16:29 ` [PATCH v5 05/13] ASoC: Intel: catpt: Add IPC messages Cezary Rojewski
2020-09-15 16:29 ` [PATCH v5 06/13] ASoC: Intel: catpt: PCM operations Cezary Rojewski
2020-09-15 16:29 ` [PATCH v5 07/13] ASoC: Intel: catpt: Event tracing Cezary Rojewski
2020-09-15 16:29 ` [PATCH v5 08/13] ASoC: Intel: catpt: Simple sysfs attributes Cezary Rojewski
2020-09-16 16:50 ` Andy Shevchenko
2020-09-17 15:37 ` Rojewski, Cezary
2020-09-18 13:54 ` Andy Shevchenko
2020-09-15 16:29 ` [PATCH v5 09/13] ASoC: Intel: Select catpt and deprecate haswell Cezary Rojewski
2020-09-15 16:29 ` [PATCH v5 10/13] ASoC: Intel: haswell: Remove haswell-solution specific code Cezary Rojewski
2020-09-16 15:50 ` Andy Shevchenko
2020-09-15 16:29 ` [PATCH v5 11/13] ASoC: Intel: broadwell: " Cezary Rojewski
2020-09-15 16:29 ` [PATCH v5 12/13] ASoC: Intel: bdw-5650: " Cezary Rojewski
2020-09-15 16:29 ` [PATCH v5 13/13] ASoC: Intel: bdw-5677: " Cezary Rojewski
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=f4a2b707794c4b95b031f0566fd5b76a@intel.com \
--to=cezary.rojewski@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=amadeuszx.slawinski@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=cujomalainey@chromium.org \
--cc=filip.kaczmarski@intel.com \
--cc=filip.proborszcz@intel.com \
--cc=harshapriya.n@intel.com \
--cc=krzysztof.hejmowski@intel.com \
--cc=lgirdwood@gmail.com \
--cc=marcin.barlik@intel.com \
--cc=michal.wasko@intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=ppapierkowski@habana.ai \
--cc=tiwai@suse.com \
--cc=vamshi.krishna.gopal@intel.com \
--cc=zwisler@google.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).