Hi Arnd,
On 28 August 2014 04:39, Arnd Bergmann arnd@arndb.de wrote:
On Wednesday 27 August 2014 20:09:02 Mark Brown wrote:
On Wed, Aug 27, 2014 at 09:07:15AM -0400, Ashwin Chaugule wrote:
On 27 August 2014 06:27, Mark Brown broonie@kernel.org wrote:
On Tue, Aug 26, 2014 at 03:35:36PM -0400, Ashwin Chaugule wrote:
+static struct mbox_controller * +mbox_find_pcc_controller(char *name) +{
struct mbox_controller *mbox;
list_for_each_entry(mbox, &mbox_cons, node) {
if (mbox->name)
if (!strcmp(mbox->name, name))
return mbox;
}
return NULL;
+}
This doesn't look particularly PCC specific?
Call this mbox_find_controller_by_name() instead?
That certainly looks like what it's doing. Probably also make the name that gets passed in const while you're at it.
The mailbox API intentionally does not have an interface for that: you are supposed to get a reference to an mbox controller from a phandle or similar, not by knowing the name of the controller.
This snippet is based off of your suggestions. [1] [2] :)
Unfortunately, the three patches that Ashwin posted don't have a caller for this function,
mbox_find_pcc_controller() is called from pcc_mbox_request_channel() which is in this patch.
so I don't know what it's actually used for. Why do we need this function for pcc, and what are the names that can be passed here?
Arnd
[1] - http://lists.infradead.org/pipermail/linux-arm-kernel/2014-June/265395.html [2] - http://lists.infradead.org/pipermail/linux-arm-kernel/2014-June/266528.html