From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: loic pallardy <loic.pallardy@st.com>
Cc: Matt Redfearn <matt.redfearn@imgtec.com>,
Ohad Ben-Cohen <ohad@wizery.com>,
linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] remoteproc: Add a sysfs interface for firmware and state
Date: Thu, 13 Oct 2016 22:14:17 -0700 [thread overview]
Message-ID: <20161014051417.GD8247@tuxbot> (raw)
In-Reply-To: <45167a9c-80ee-2af1-2ec5-db1eb1eef883@st.com>
On Thu 13 Oct 07:39 PDT 2016, loic pallardy wrote:
>
>
> On 10/13/2016 04:25 PM, Matt Redfearn wrote:
> >Hi Loic,
> >
> >
> >On 13/10/16 14:56, loic pallardy wrote:
> >>
> >>
> >>On 10/11/2016 03:39 PM, Matt Redfearn wrote:
[..]
> >>>diff --git a/drivers/remoteproc/remoteproc_internal.h
> >>>b/drivers/remoteproc/remoteproc_internal.h
> >>>index 837faf2677a6..2beb86ddfacc 100644
> >>>--- a/drivers/remoteproc/remoteproc_internal.h
> >>>+++ b/drivers/remoteproc/remoteproc_internal.h
> >>>@@ -64,6 +64,11 @@ void rproc_create_debug_dir(struct rproc *rproc);
> >>> void rproc_init_debugfs(void);
> >>> void rproc_exit_debugfs(void);
> >>>
> >>>+/* from remoteproc_sysfs.c */
> >>>+extern struct class rproc_class;
> >>struct class rproc_class should be static to remoteproc_sysfs.c file.
> >>It will be better to create a new interface like rproc_register_sysfs
> >>to associate rproc_class to rproc device.
> >
> >It would be nice if that were possible, but since the class has to
> >associated with the devices created within remoteproc_core, as it stands
> >we must have visibility of this symbol there, see above the change to
> >drivers/remoteproc/remoteproc_core.c line 1455.
> >The alternative would be a utility function in remoteproc_sysfs.c to
> >associate the class with an rproc device, it depends what the preference
> >would be.
>
> Yes it will be my preference. remoteproc_sysfs.c file to provide a new
> service like:
> void rproc_register_sysfs(struct rproc *rproc) {
> rproc->dev.class = &rproc_class;
> }
>
> and to call this function from rproc_alloc
>
Compare:
rproc->dev.class = &rproc_class;
to:
rproc_register_sysfs(rproc);
The meaning of the prior is obvious, the latter require the jump to a
different file to follow. And we would only be trading one global
variable for a global function.
A viable alternative would be to keep a local pointer to the class in
core.c, that we assign during the call to rproc_init_sysfs().
But I'm fine with the way it's written.
Regards,
Bjorn
next prev parent reply other threads:[~2016-10-14 5:14 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-11 13:39 [PATCH 0/4] remoteproc: Add sysfs interface Matt Redfearn
2016-10-11 13:39 ` Matt Redfearn
2016-10-11 13:39 ` [PATCH 1/4] remoteproc: Use fixed length field for firmware name Matt Redfearn
2016-10-11 13:39 ` Matt Redfearn
2016-10-13 13:22 ` loic pallardy
2016-10-13 13:22 ` loic pallardy
2016-10-13 14:18 ` Matt Redfearn
2016-10-13 14:18 ` Matt Redfearn
2016-10-14 4:31 ` Bjorn Andersson
2016-10-11 13:39 ` [PATCH 2/4] remoteproc: Introduce rproc_change_firmware Matt Redfearn
2016-10-11 13:39 ` Matt Redfearn
2016-10-14 4:37 ` Bjorn Andersson
2016-10-11 13:39 ` [PATCH 3/4] remoteproc: Add a sysfs interface for firmware and state Matt Redfearn
2016-10-11 13:39 ` Matt Redfearn
2016-10-13 13:56 ` loic pallardy
2016-10-13 13:56 ` loic pallardy
2016-10-13 14:25 ` Matt Redfearn
2016-10-13 14:25 ` Matt Redfearn
2016-10-13 14:39 ` loic pallardy
2016-10-13 14:39 ` loic pallardy
2016-10-13 15:00 ` Matt Redfearn
2016-10-13 15:00 ` Matt Redfearn
2016-10-14 5:14 ` Bjorn Andersson [this message]
2016-10-14 5:02 ` Bjorn Andersson
2016-10-11 13:39 ` [PATCH 4/4] remoteproc: debugfs: Remove state entry which is duplicated is sysfs Matt Redfearn
2016-10-11 13:39 ` Matt Redfearn
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=20161014051417.GD8247@tuxbot \
--to=bjorn.andersson@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=loic.pallardy@st.com \
--cc=matt.redfearn@imgtec.com \
--cc=ohad@wizery.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.