public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
To: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Cc: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org,
	Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Subject: Re: [patch 2/8] I2C: S3C2410: Add MODULE_ALIAS() for s3c2440 device.
Date: Sun, 1 Jun 2008 22:51:02 +0100	[thread overview]
Message-ID: <20080601215102.GJ7334@trinity.fluff.org> (raw)
In-Reply-To: <20080530215452.2ee3d4a7-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>

On Fri, May 30, 2008 at 09:54:52PM +0200, Jean Delvare wrote:
> Hi Ben,
> 
> On Thu, 29 May 2008 14:22:46 +0100, Ben Dooks wrote:
> > Add a MODULE_ALIAS() statement for the i2c-s3c2410 controller
> > to ensure that it can be autoloaded on the S3C2440 systems that
> > we support.
> > 
> > Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
> > 
> > Index: linux-2.6.26-rc4-quilt1/drivers/i2c/busses/i2c-s3c2410.c
> > ===================================================================
> > --- linux-2.6.26-rc4-quilt1.orig/drivers/i2c/busses/i2c-s3c2410.c	2008-05-28 11:56:54.000000000 +0100
> > +++ linux-2.6.26-rc4-quilt1/drivers/i2c/busses/i2c-s3c2410.c	2008-05-28 11:57:12.000000000 +0100
> > @@ -947,3 +947,4 @@ MODULE_DESCRIPTION("S3C24XX I2C Bus driv
> >  MODULE_AUTHOR("Ben Dooks, <ben-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>");
> >  MODULE_LICENSE("GPL");
> >  MODULE_ALIAS("platform:s3c2410-i2c");
> > +MODULE_ALIAS("platform:s3c2440-i2c");
> 
> With the current driver code, that's correct.
> 
> Acked-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> 
> That being said, I think the approach is wrong. You shouldn't register
> two different platform drivers just to be able to differentiate between
> device types. You have platform_data for that, it's cleaner and cheaper.

Actually, there are down sides to doing it via platform data, and a few
upsides to using the driver model. I do agree that >1 driver does mean
that you end up allocating more space to the drivers, but I hope that
I can convince you that this isn't without merit. 

The following are downsides:

1) using platform data means that not only do all the boards that have
   i2c busses on (or other peripherals using this method) need to carry[1]
   and register platform data even if they do not need to.

2) We currently change the name of the platform device in the cpu specific
   architecture initialisation, which would mean either moving this to each
   machine or have some form of sharing between the arch code and the board
   init. 

3) Some boards can have more than one cpu type on them, which makes life
   even worse for the above.

The advantage of changing the name of the platform device means that the
type of device is shown in the /sys/devices/platform heirachy without any
need for code to add a new attribute to show it within the device itself.


[1] Even if this is __initdata, it means the kernel has to carry it to
    load it even if it gets dumped at startup, and we have a number of
    boards that are available.

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.


_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

  parent reply	other threads:[~2008-06-01 21:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-29 13:22 [patch 0/8] I2C fixes and -next from Ben Dooks Ben Dooks
2008-05-29 13:22 ` [patch 1/8] I2C: S3C2410: Check ACK on byte transmission Ben Dooks
     [not found]   ` <20080529132405.971048345-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-05-30 19:45     ` Jean Delvare
     [not found]       ` <20080530214540.638008b7-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-06-02 19:29         ` Ben Dooks
2008-05-29 13:22 ` [patch 2/8] I2C: S3C2410: Add MODULE_ALIAS() for s3c2440 device Ben Dooks
     [not found]   ` <20080529132406.186957190-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-05-30 19:54     ` Jean Delvare
     [not found]       ` <20080530215452.2ee3d4a7-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-06-01 21:51         ` Ben Dooks [this message]
     [not found]           ` <20080601215102.GJ7334-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2008-06-02  6:59             ` Jean Delvare
2008-05-29 13:22 ` [patch 3/8] I2C: S3C2410: Pass the I2C bus number via drivers platform data Ben Dooks
     [not found]   ` <20080529132406.387873305-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-06-01  7:07     ` Jean Delvare
     [not found]       ` <20080601090706.0e29a76d-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-06-01 21:53         ` Ben Dooks
     [not found]           ` <20080601215335.GK7334-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2008-06-02  6:38             ` Jean Delvare
2008-05-29 13:22 ` [patch 4/8] I2C: S3C2410: Add a option of reducing the bus busy waiting time Ben Dooks
     [not found]   ` <20080529132406.586501777-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-06-01  7:16     ` Jean Delvare
2008-05-29 13:22 ` [patch 5/8] OSIRIS: Add i2c device list to Simtec Osiris Ben Dooks
     [not found]   ` <20080529132406.837870894-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-06-01  7:21     ` Jean Delvare
     [not found]       ` <20080601092116.63c4808e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-06-01 21:35         ` Ben Dooks
     [not found]           ` <20080601213509.GH7334-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2008-06-02  6:31             ` Jean Delvare
2008-05-29 13:22 ` [patch 6/8] BAST: Add i2c device list on Simtec Bast Ben Dooks
2008-05-29 13:22 ` [patch 7/8] VR1000: Add i2c device list to Thorcom VR1000 Ben Dooks
     [not found]   ` <20080529132407.211335410-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-06-01  7:32     ` Jean Delvare
     [not found]       ` <20080601093215.67a1ac41-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-06-01 21:38         ` Ben Dooks
     [not found]           ` <20080601213855.GI7334-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2008-06-02  6:35             ` Jean Delvare
2008-05-29 13:22 ` [patch 8/8] ANUBIS: Add i2c device list to Simtec Anubis Ben Dooks

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=20080601215102.GJ7334@trinity.fluff.org \
    --to=ben-linux-elnmno+kys3ytjvyw6ydsg@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@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