All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Russell King <linux@arm.linux.org.uk>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Alessandro Gardich <gremlin@gremlin.it>,
	Dmitry Artamonow <mad_soft@inbox.ru>
Subject: Re: [PATCH] RFC: MFD: driver for Atmel Microcontroller on iPaq h3xxx
Date: Wed, 2 Apr 2014 13:14:40 +0100	[thread overview]
Message-ID: <20140402121440.GF18518@lee--X1> (raw)
In-Reply-To: <CACRpkdZ5YQoV3zxXiF5H-nxf-Kz_YiETvLsbJ9pkT=ueZ=VJSQ@mail.gmail.com>

> > 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-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Russell King <linux@arm.linux.org.uk>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Alessandro Gardich <gremlin@gremlin.it>,
	Dmitry Artamonow <mad_soft@inbox.ru>
Subject: Re: [PATCH] RFC: MFD: driver for Atmel Microcontroller on iPaq h3xxx
Date: Wed, 2 Apr 2014 13:14:40 +0100	[thread overview]
Message-ID: <20140402121440.GF18518@lee--X1> (raw)
In-Reply-To: <CACRpkdZ5YQoV3zxXiF5H-nxf-Kz_YiETvLsbJ9pkT=ueZ=VJSQ@mail.gmail.com>

> > 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

  reply	other threads:[~2014-04-02 12:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31 13:34 [PATCH] RFC: MFD: driver for Atmel Microcontroller on iPaq h3xxx Linus Walleij
2014-02-10  9:02 ` Linus Walleij
2014-02-10 11:53   ` Lee Jones
2014-02-10 11:53     ` Lee Jones
2014-02-15 19:24     ` Greg Kroah-Hartman
2014-02-17  9:21 ` Lee Jones
2014-02-17  9:21   ` Lee Jones
2014-04-02  7:38   ` Linus Walleij
2014-04-02 12:14     ` Lee Jones [this message]
2014-04-02 12:14       ` Lee Jones

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=20140402121440.GF18518@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=dbaryshkov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gremlin@gremlin.it \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mad_soft@inbox.ru \
    --cc=sameo@linux.intel.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.