Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Lee Jones <lee@kernel.org>
Cc: James Ogletree <James.Ogletree@cirrus.com>,
	James Ogletree <jogletre@opensource.cirrus.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Mark Brown <broonie@kernel.org>, Jeff LaBundy <jeff@labundy.com>,
	"open list:CIRRUS LOGIC HAPTIC DRIVERS"
	<patches@opensource.cirrus.com>,
	"linux-sound@vger.kernel.org" <linux-sound@vger.kernel.org>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v8 3/5] mfd: cs40l50: Add support for CS40L50 core driver
Date: Tue, 5 Mar 2024 10:20:55 +0000	[thread overview]
Message-ID: <ZebyByQnYkaRiudv@ediswmail9.ad.cirrus.com> (raw)
In-Reply-To: <20240305095818.GF5206@google.com>

On Tue, Mar 05, 2024 at 09:58:18AM +0000, Lee Jones wrote:
> On Fri, 01 Mar 2024, James Ogletree wrote:
> > >> +static const struct cs_dsp_client_ops cs40l50_client_ops;
> > > 
> > > What's this for?  Where is it used?
> > > 
> > > In general, I'm not a fan of empty struct definitions like this.
> > 
> > From the same cs_dsp module as mentioned above, it is a structure containing
> > callbacks that gives the client driver an opportunity to respond to certain events
> > during the DSP's lifecycle. It just so happens that this driver does not need to do
> > anything. However, no struct definition will result in a null pointer dereference by
> > cs_dsp when it checks for the callbacks.
> 
> Then check for NULL before dereferencing it?

It would probably make sense to move the cs40l50_stop_core writes
into the pre_run callback, and the CLOCK_ENABLE /
cs40l50_configure_dsp stuff into the post_run callback. Which is
probably a slightly more idiomatic way to use the API of cs_dsp
and would mean some of the callbacks are initialised, thus
dodging this problem.

We could check for there being no client_ops in the cs_dsp core,
but it feels kinda redundant since there really should generally
be client ops.

Thanks,
Charles

  reply	other threads:[~2024-03-05 10:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21  0:36 [PATCH v8 0/5] Add support for CS40L50 James Ogletree
2024-02-21  0:36 ` [PATCH v8 1/5] firmware: cs_dsp: Add write sequencer interface James Ogletree
2024-02-21  9:22   ` Charles Keepax
2024-02-21  0:36 ` [PATCH v8 2/5] dt-bindings: input: cirrus,cs40l50: Add initial DT binding James Ogletree
2024-02-21  0:36 ` [PATCH v8 3/5] mfd: cs40l50: Add support for CS40L50 core driver James Ogletree
2024-03-01  9:17   ` Lee Jones
2024-03-01 16:36     ` James Ogletree
2024-03-05  9:58       ` Lee Jones
2024-03-05 10:20         ` Charles Keepax [this message]
2024-03-05 20:55           ` James Ogletree
2024-02-21  0:36 ` [PATCH v8 4/5] Input: cs40l50 - Add support for the CS40L50 haptic driver James Ogletree
2024-02-21  0:36 ` [PATCH v8 5/5] ASoC: cs40l50: Support I2S streaming to CS40L50 James Ogletree

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=ZebyByQnYkaRiudv@ediswmail9.ad.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=James.Ogletree@cirrus.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jeff@labundy.com \
    --cc=jogletre@opensource.cirrus.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=robh+dt@kernel.org \
    /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