[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140402121440.GF18518@lee--X1>
Date: Wed, 2 Apr 2014 13:14:40 +0100
From: Lee Jones <lee.jones@...aro.org>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Samuel Ortiz <sameo@...ux.intel.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Russell King <linux@....linux.org.uk>,
Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
Alessandro Gardich <gremlin@...mlin.it>,
Dmitry Artamonow <mad_soft@...ox.ru>
Subject: Re: [PATCH] RFC: MFD: driver for Atmel Microcontroller on iPaq h3xxx
> > Does it matter that you're using:
> >
> > module_platform_driver();
> >
> > ... yet you can't build this as a module?
>
> I think it's a conceptual thing. Module means two things (IIUC):
> (a) it is a run-time loadable module
> (b) it's a piece of compartmentalized code
>
> In this case the macro refers to (b). module_platform_driver()
> resolves to module_driver() from <linux/device.h>
> and it's clearly a core part of the device core and available
> no matter whether the file is used as module at runtime or not.
> It just simplifies the initcalls and that's no different depending
> on whether the code is compiled-in or used as module.
Fair enough.
> >> + case MSG_KEYBOARD:
> >> + if (micro->key != NULL)
> >
> > !micro->key
>
> I guess you mean if (micro->key) {} rather than the !invert,
> but I get it, changed everywhere we check for != NULL like this.
Yes sorry, I'm so used to seeing (thing == NULL), but you knew what I
meant.
[...]
> >> +static int micro_suspend(struct device *dev)
> >> +{
> >> + return 0;
> >> +}
> >
> > Doesn't the PM framework check for NULL .suspend?
>
> No it's just like:
>
> #ifdef CONFIG_SUSPEND
> case PM_EVENT_SUSPEND:
> return ops->suspend;
> case PM_EVENT_RESUME:
> return ops->resume;
> #endif /* CONFIG_SUSPEND */
>
> (drivers/power/main.c)
base/ ---^
Right, but a NULL return _is_ valid from here and is subsequently dealt
with in the correct way.
[...]
callback = pm_op(dev->type->pm, state);
goto Driver;
[...]
Driver:
if (!callback && dev->driver && dev->driver->pm) {
info = "driver ";
callback = pm_op(dev->driver->pm, state);
}
[...]
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists