linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.ml.walleij-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Subject: Re: [PATCH] i2c: driver for the Synopsys DesignWare I2C controller
Date: Sun, 31 May 2009 20:47:31 +0200	[thread overview]
Message-ID: <63386a3d0905311147h5a92bb3cy6659db914acd476e@mail.gmail.com> (raw)
In-Reply-To: <20090531052345.GB14148@tarshish>

2009/5/31 Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>:
> On Thu, May 28, 2009 at 09:32:37AM +0200, Linus Walleij wrote:
>> 2009/5/28 Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>:
>>
>> >> > +static int dw_i2c_probe(struct platform_device *pdev)
>> >>
>> >> Can you tag this with __init?
>> >
>> > OK. __devinit is probably better.
>>
>> I don't think any platform_device tagged with __devinit is
>> correct really, platform_device:s cannot  be hotplugged that's
>> against the definition of a platform_device.
>
> Doesn't this __devinit have something to do with the ability to compile the
> driver as a module (as is the case here)? See for example
> drivers/watchdog/omap_wdt.c and commit
> 0e3912c75f42986c17d955542247bf04c6eef738

In that case I doubt that even module_init() could be __init, as it is.

The linkage handling of these symbols is defined in:
include/asm-generic/vmlinux.lds.h

As you can see:

#ifdef CONFIG_HOTPLUG
#define DEV_KEEP(sec)    *(.dev##sec)
#define DEV_DISCARD(sec)
#else
#define DEV_KEEP(sec)
#define DEV_DISCARD(sec) *(.dev##sec)
#endif

Further down the file you can see how this is handled in different
kinds of symbols. It is kept if CONFIG_HOTPLUG is set, it is moved
into the DATA_DATA section and kept in memory (so that it can be
reused when devices are plugged/unplugged) else it is discarded
after init.

In practice this means that if you device is _NOT_ hot-pluggable, the
kernel will still nevertheless keep all the code in __devinit and
__devexit around which means that __devinit code cannot be
free:ed after init and it increases the footprint of your kernel for no
good reason.

Linus

  reply	other threads:[~2009-05-31 18:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19  9:23 [PATCH] i2c: driver for the Synopsys DesignWare I2C controller Baruch Siach
     [not found] ` <1242725005-6431-1-git-send-email-baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2009-05-26 21:39   ` Ben Dooks
     [not found]     ` <20090526213917.GH23114-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2009-05-27  4:26       ` Baruch Siach
     [not found]         ` <1243398392-1516-1-git-send-email-baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2009-06-13  9:28           ` Ben Dooks
2009-05-27 19:23   ` Linus Walleij
     [not found]     ` <63386a3d0905271223k470bb89elbbb566b68c0d7cd7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-28  4:10       ` Baruch Siach
2009-05-28  7:32         ` Linus Walleij
     [not found]           ` <63386a3d0905280032x7f427213t2b9b027d5be2a472-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-31  5:23             ` Baruch Siach
2009-05-31 18:47               ` Linus Walleij [this message]
     [not found]                 ` <63386a3d0905311147h5a92bb3cy6659db914acd476e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-06-01  3:43                   ` Baruch Siach
2009-06-01 22:53               ` Ben Dooks
     [not found]                 ` <20090601225354.GB18453-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2009-06-02  6:57                   ` Linus Walleij

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=63386a3d0905311147h5a92bb3cy6659db914acd476e@mail.gmail.com \
    --to=linus.ml.walleij-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org \
    --cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).