From: Thierry Reding <thierry.reding@gmail.com>
To: Jean-Francois Moine <moinejf@free.fr>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>,
devel@driverdev.osuosl.org, alsa-devel@alsa-project.org,
Takashi Iwai <tiwai@suse.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
dri-devel@lists.freedesktop.org,
Sascha Hauer <kernel@pengutronix.de>,
linux-arm-kernel@lists.infradead.org,
linux-media@vger.kernel.org
Subject: Re: [PATCH v3 1/2] drivers/base: permit base components to omit the bind/unbind ops
Date: Mon, 10 Feb 2014 13:53:08 +0100 [thread overview]
Message-ID: <20140210125307.GG20143@ulmo.nvidia.com> (raw)
In-Reply-To: <9b3c3c2c982f31b026fd1516a2b608026d55b1e9.1391792986.git.moinejf@free.fr>
[-- Attachment #1: Type: text/plain, Size: 1592 bytes --]
On Fri, Feb 07, 2014 at 04:55:00PM +0100, Jean-Francois Moine wrote:
> Some simple components don't need to do any specific action on
> bind to / unbind from a master component.
>
> This patch permits such components to omit the bind/unbind
> operations.
>
> Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
> ---
> drivers/base/component.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/component.c b/drivers/base/component.c
> index c53efe6..0a39d7a 100644
> --- a/drivers/base/component.c
> +++ b/drivers/base/component.c
> @@ -225,7 +225,8 @@ static void component_unbind(struct component *component,
> {
> WARN_ON(!component->bound);
>
> - component->ops->unbind(component->dev, master->dev, data);
> + if (component->ops)
> + component->ops->unbind(component->dev, master->dev, data);
This doesn't actually do what the commit message says. This makes
component->ops optional, not component->ops->unbind().
A more correct check would be:
if (component->ops && component->ops->unbind)
> component->bound = false;
>
> /* Release all resources claimed in the binding of this component */
> @@ -274,7 +275,11 @@ static int component_bind(struct component *component, struct master *master,
> dev_dbg(master->dev, "binding %s (ops %ps)\n",
> dev_name(component->dev), component->ops);
>
> - ret = component->ops->bind(component->dev, master->dev, data);
> + if (component->ops)
> + ret = component->ops->bind(component->dev, master->dev, data);
Same here.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-02-10 12:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-07 17:09 [PATCH v3 0/2] *** SUBJECT HERE *** Jean-Francois Moine
2014-02-07 15:55 ` [PATCH v3 1/2] drivers/base: permit base components to omit the bind/unbind ops Jean-Francois Moine
2014-02-10 12:53 ` Thierry Reding [this message]
2014-02-10 13:12 ` Russell King - ARM Linux
2014-02-10 14:35 ` Jean-Francois Moine
2014-02-10 15:14 ` Russell King - ARM Linux
2014-02-07 16:53 ` [PATCH v3 2/2] drivers/base: declare phandle DT nodes as components Jean-Francois Moine
2014-02-07 17:30 ` [PATCH v3 0/2] *** SUBJECT HERE *** Greg Kroah-Hartman
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=20140210125307.GG20143@ulmo.nvidia.com \
--to=thierry.reding@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=devel@driverdev.osuosl.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-media@vger.kernel.org \
--cc=moinejf@free.fr \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=tiwai@suse.de \
/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