Skip to contentSkip to conversation

i2c-omap: reduce bloat

PATCH In review Paul Walmsley 2 participants 4 messages Jul 18, 2008 – Aug 4, 2008

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover i2c-omap: reduce bloat

Don't compile the OMAP15xx I2C ISR for non-OMAP15xx builds. Also, mark init-only functions in i2c-omap as __init.

Boot-tested on OMAP3430SDP ES2.

---

size:

3391587  157104  107136 3655827  37c893 vmlinux.3430sdp.orig
3390339  157104  107136 3654579  37c3b3 vmlinux.3430sdp
 drivers/i2c/busses/i2c-omap.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
#1 lore raw

PATCH 1/2 i2c-omap: mark init-only functions as __init

Mark functions called only at init time as __init.

---

 drivers/i2c/busses/i2c-omap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-omap.c +2 -2
index 55779f5..ed60693 100644
@@ -160,7 +160,7 @@ static inline u16 omap_i2c_read_reg(struct omap_i2c_dev *i2c_dev, int reg)
 	return __raw_readw(i2c_dev->base + reg);
 }
 
-static int omap_i2c_get_clocks(struct omap_i2c_dev *dev)
+static int __init omap_i2c_get_clocks(struct omap_i2c_dev *dev)
 {
 	if (cpu_is_omap16xx() || cpu_class_is_omap2()) {
 		dev->iclk = clk_get(dev->dev, "i2c_ick");
@@ -701,7 +701,7 @@ static const struct i2c_algorithm omap_i2c_algo = {
 	.functionality	= omap_i2c_func,
 };
 
-static int
+static int __init
 omap_i2c_probe(struct platform_device *pdev)
 {
 	struct omap_i2c_dev	*dev;
#2 lore raw

PATCH 2/2 i2c-omap: don't compile in OMAP15xx I2C ISR for non-OMAP15xx builds

In reply to Paul Walmsley

Skip compiling OMAP15xx I2C ISR for non-OMAP15xx builds. Saves 400 bytes of text for most OMAP builds.

---

 drivers/i2c/busses/i2c-omap.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-omap.c +8 -2
index ed60693..1bf0ad6 100644
@@ -529,6 +529,9 @@ omap_i2c_ack_stat(struct omap_i2c_dev *dev, u16 stat)
 	omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat);
 }
 
+/* rev1 devices are apparently only on some 15xx */
+#ifdef CONFIG_ARCH_OMAP15XX
+
 static irqreturn_t
 omap_i2c_rev1_isr(int this_irq, void *dev_id)
 {
@@ -583,6 +586,9 @@ omap_i2c_rev1_isr(int this_irq, void *dev_id)
 
 	return IRQ_HANDLED;
 }
+#else
+#define omap_i2c_rev1_isr		0
+#endif
 
 static irqreturn_t
 omap_i2c_isr(int this_irq, void *dev_id)
@@ -844,14 +850,14 @@ static struct platform_driver omap_i2c_driver = {
 };
 
 /* I2C may be needed to bring up other drivers */
-static int __init
+static int __devinit
 omap_i2c_init_driver(void)
 {
 	return platform_driver_register(&omap_i2c_driver);
 }
 subsys_initcall(omap_i2c_init_driver);
 
-static void __exit omap_i2c_exit_driver(void)
+static void __devexit omap_i2c_exit_driver(void)
 {
 	platform_driver_unregister(&omap_i2c_driver);
 }
maintainer
#3 lore raw
In reply to Paul Walmsley
Quoted 4 lines · Paul Walmsley

Don't compile the OMAP15xx I2C ISR for non-OMAP15xx builds. Also, mark init-only functions in i2c-omap as __init.

Boot-tested on OMAP3430SDP ES2.

Pushing these today.

Tony

Quoted 17 lines

---

size:

3391587  157104  107136 3655827  37c893 vmlinux.3430sdp.orig
3390339  157104  107136 3654579  37c3b3 vmlinux.3430sdp
 drivers/i2c/busses/i2c-omap.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html