public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/2] TWL4030: mark init functions __init, fix kerneldoc
@ 2008-08-04 20:56 Paul Walmsley
  2008-08-04 20:56 ` [PATCHv2 1/2] TWL4030: mark init-only functions as __init Paul Walmsley
  2008-08-04 20:56 ` [PATCHv2 2/2] TWL4030: convert old-style function documentation to current kerneldoc Paul Walmsley
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Walmsley @ 2008-08-04 20:56 UTC (permalink / raw)
  To: linux-omap; +Cc: felipe.balbi

This second revision incorporates a documentation fix from Felipe Balbi 
<felipe.balbi@nokia.com>.

---

Mark most of the functions in twl4030-core.c as __init.  Fix the
old-style kerneldoc in several functions.

Frees up an extra 4kB page after kernel init on 3430SDP.  Not sure why
there is such a large kernel image size difference; no new code or
data has been added.

Boot-tested on 3430SDP ES2.


- Paul

---

size:

  text    data     bss     dec     hex filename
3391251  157104  107136 3655491  37c743 vmlinux.3430sdp.orig
3394259  157104  107136 3658499  37d303 vmlinux.3430sdp

 drivers/i2c/chips/twl4030-core.c |   71 +++++++++++++++++++-------------------
 1 files changed, 35 insertions(+), 36 deletions(-)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCHv2 1/2] TWL4030: mark init-only functions as __init
  2008-08-04 20:56 [PATCHv2 0/2] TWL4030: mark init functions __init, fix kerneldoc Paul Walmsley
@ 2008-08-04 20:56 ` Paul Walmsley
  2008-08-05  8:48   ` Tony Lindgren
  2008-08-04 20:56 ` [PATCHv2 2/2] TWL4030: convert old-style function documentation to current kerneldoc Paul Walmsley
  1 sibling, 1 reply; 6+ messages in thread
From: Paul Walmsley @ 2008-08-04 20:56 UTC (permalink / raw)
  To: linux-omap; +Cc: Paul Walmsley

Mark many functions in twl4030-core.c as __init.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---

 drivers/i2c/chips/twl4030-core.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c
index 47d547d..54e392b 100644
--- a/drivers/i2c/chips/twl4030-core.c
+++ b/drivers/i2c/chips/twl4030-core.c
@@ -681,7 +681,8 @@ static void do_twl4030_irq(unsigned int irq, irq_desc_t *desc)
 }
 
 /* attach a client to the adapter */
-static int twl4030_detect_client(struct i2c_adapter *adapter, unsigned char sid)
+static int __init twl4030_detect_client(struct i2c_adapter *adapter,
+					unsigned char sid)
 {
 	int err = 0;
 	struct twl4030_client *twl;
@@ -730,7 +731,7 @@ static int twl4030_detect_client(struct i2c_adapter *adapter, unsigned char sid)
 }
 
 /* adapter callback */
-static int twl4030_attach_adapter(struct i2c_adapter *adapter)
+static int __init twl4030_attach_adapter(struct i2c_adapter *adapter)
 {
 	int i;
 	int ret = 0;
@@ -783,7 +784,7 @@ static int twl4030_detach_client(struct i2c_client *client)
 	return 0;
 }
 
-static struct task_struct *start_twl4030_irq_thread(int irq)
+static struct task_struct * __init start_twl4030_irq_thread(int irq)
 {
 	struct task_struct *thread;
 
@@ -801,7 +802,7 @@ static struct task_struct *start_twl4030_irq_thread(int irq)
  * These three functions should be part of Voltage frame work
  * added here to complete the functionality for now.
  */
-static int protect_pm_master(void)
+static int __init protect_pm_master(void)
 {
 	int e = 0;
 
@@ -810,7 +811,7 @@ static int protect_pm_master(void)
 	return e;
 }
 
-static int unprotect_pm_master(void)
+static int __init unprotect_pm_master(void)
 {
 	int e = 0;
 
@@ -821,7 +822,7 @@ static int unprotect_pm_master(void)
 	return e;
 }
 
-static int power_companion_init(void)
+static int __init power_companion_init(void)
 {
 	struct clk *osc;
 	u32 rate;
@@ -866,7 +867,7 @@ static int power_companion_init(void)
  * don't know whether the COR bit is set in <module>_SIH_CTRL.  Returns
  * the status from the I2C read operation.
  */
-static int twl4030_i2c_clear_isr(u8 mod_no, u8 reg)
+static int __init twl4030_i2c_clear_isr(u8 mod_no, u8 reg)
 {
 	int res;
 	u8 tmp;
@@ -878,7 +879,7 @@ static int twl4030_i2c_clear_isr(u8 mod_no, u8 reg)
 	return twl4030_i2c_write_u8(mod_no, 0xff, reg);
 }
 
-static void twl_init_irq(void)
+static void __init twl_init_irq(void)
 {
 	int	i, j;
 	int	res = 0;



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCHv2 2/2] TWL4030: convert old-style function documentation to current kerneldoc
  2008-08-04 20:56 [PATCHv2 0/2] TWL4030: mark init functions __init, fix kerneldoc Paul Walmsley
  2008-08-04 20:56 ` [PATCHv2 1/2] TWL4030: mark init-only functions as __init Paul Walmsley
@ 2008-08-04 20:56 ` Paul Walmsley
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Walmsley @ 2008-08-04 20:56 UTC (permalink / raw)
  To: linux-omap; +Cc: Paul Walmsley, felipe.balbi

Several functions use old-style function documentation; convert those to
use the current kerneldoc style.

Thanks to Felipe Balbi <felipe.balbi@nokia.com> for catching an error.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---

 drivers/i2c/chips/twl4030-core.c |   54 ++++++++++++++++++--------------------
 1 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c
index 54e392b..88447f1 100644
--- a/drivers/i2c/chips/twl4030-core.c
+++ b/drivers/i2c/chips/twl4030-core.c
@@ -389,17 +389,18 @@ static struct irq_chip twl4030_irq_chip = {
 };
 
 /* Global Functions */
-/*
- * @brief twl4030_i2c_write - Writes a n bit register in TWL4030
+
+/**
+ * twl4030_i2c_write - Writes a n bit register in TWL4030
+ * @mod_no: module number
+ * @value: an array of num_bytes+1 containing data to write
+ * @reg: register address (just offset will do)
+ * @num_bytes: number of bytes to transfer
  *
- * @param mod_no - module number
- * @param *value - an array of num_bytes+1 containing data to write
- * IMPORTANT - Allocate value num_bytes+1 and valid data starts at
- *		 Offset 1.
- * @param reg - register address (just offset will do)
- * @param num_bytes - number of bytes to transfer
+ * IMPORTANT: for 'value' parameter: Allocate value num_bytes+1 and
+ * valid data starts at Offset 1.
  *
- * @return result of operation - 0 is success
+ * Returns the result of operation - 0 is success
  */
 int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes)
 {
@@ -443,14 +444,13 @@ int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes)
 EXPORT_SYMBOL(twl4030_i2c_write);
 
 /**
- * @brief twl4030_i2c_read - Reads a n bit register in TWL4030
+ * twl4030_i2c_read - Reads a n bit register in TWL4030
+ * @mod_no: module number
+ * @value: an array of num_bytes containing data to be read
+ * @reg: register address (just offset will do)
+ * @num_bytes: number of bytes to transfer
  *
- * @param mod_no - module number
- * @param *value - an array of num_bytes containing data to be read
- * @param reg - register address (just offset will do)
- * @param num_bytes - number of bytes to transfer
- *
- * @return result of operation - num_bytes is success else failure.
+ * Returns result of operation - num_bytes is success else failure.
  */
 int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes)
 {
@@ -497,13 +497,12 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes)
 EXPORT_SYMBOL(twl4030_i2c_read);
 
 /**
- * @brief twl4030_i2c_write_u8 - Writes a 8 bit register in TWL4030
- *
- * @param mod_no - module number
- * @param value - the value to be written 8 bit
- * @param reg - register address (just offset will do)
+ * twl4030_i2c_write_u8 - Writes a 8 bit register in TWL4030
+ * @mod_no: module number
+ * @value: the value to be written 8 bit
+ * @reg: register address (just offset will do)
  *
- * @return result of operation - 0 is success
+ * Returns result of operation - 0 is success
  */
 int twl4030_i2c_write_u8(u8 mod_no, u8 value, u8 reg)
 {
@@ -517,13 +516,12 @@ int twl4030_i2c_write_u8(u8 mod_no, u8 value, u8 reg)
 EXPORT_SYMBOL(twl4030_i2c_write_u8);
 
 /**
- * @brief twl4030_i2c_read_u8 - Reads a 8 bit register from TWL4030
- *
- * @param mod_no - module number
- * @param *value - the value read 8 bit
- * @param reg - register address (just offset will do)
+ * twl4030_i2c_read_u8 - Reads a 8 bit register from TWL4030
+ * @mod_no: module number
+ * @value: the value read 8 bit
+ * @reg: register address (just offset will do)
  *
- * @return result of operation - 0 is success
+ * Returns result of operation - 0 is success
  */
 int twl4030_i2c_read_u8(u8 mod_no, u8 *value, u8 reg)
 {



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCHv2 1/2] TWL4030: mark init-only functions as __init
  2008-08-04 20:56 ` [PATCHv2 1/2] TWL4030: mark init-only functions as __init Paul Walmsley
@ 2008-08-05  8:48   ` Tony Lindgren
  2008-08-06  6:43     ` [PATCHv3] " Paul Walmsley
  0 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2008-08-05  8:48 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap

* Paul Walmsley <paul@pwsan.com> [080805 00:17]:
> Mark many functions in twl4030-core.c as __init.

This does not apply cleanly, maybe there's still some other twl patch
missing? Can you check and refresh as needed. The second patch applies,
so I'll push that today.

Tony


> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> ---
> 
>  drivers/i2c/chips/twl4030-core.c |   17 +++++++++--------
>  1 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c
> index 47d547d..54e392b 100644
> --- a/drivers/i2c/chips/twl4030-core.c
> +++ b/drivers/i2c/chips/twl4030-core.c
> @@ -681,7 +681,8 @@ static void do_twl4030_irq(unsigned int irq, irq_desc_t *desc)
>  }
>  
>  /* attach a client to the adapter */
> -static int twl4030_detect_client(struct i2c_adapter *adapter, unsigned char sid)
> +static int __init twl4030_detect_client(struct i2c_adapter *adapter,
> +					unsigned char sid)
>  {
>  	int err = 0;
>  	struct twl4030_client *twl;
> @@ -730,7 +731,7 @@ static int twl4030_detect_client(struct i2c_adapter *adapter, unsigned char sid)
>  }
>  
>  /* adapter callback */
> -static int twl4030_attach_adapter(struct i2c_adapter *adapter)
> +static int __init twl4030_attach_adapter(struct i2c_adapter *adapter)
>  {
>  	int i;
>  	int ret = 0;
> @@ -783,7 +784,7 @@ static int twl4030_detach_client(struct i2c_client *client)
>  	return 0;
>  }
>  
> -static struct task_struct *start_twl4030_irq_thread(int irq)
> +static struct task_struct * __init start_twl4030_irq_thread(int irq)
>  {
>  	struct task_struct *thread;
>  
> @@ -801,7 +802,7 @@ static struct task_struct *start_twl4030_irq_thread(int irq)
>   * These three functions should be part of Voltage frame work
>   * added here to complete the functionality for now.
>   */
> -static int protect_pm_master(void)
> +static int __init protect_pm_master(void)
>  {
>  	int e = 0;
>  
> @@ -810,7 +811,7 @@ static int protect_pm_master(void)
>  	return e;
>  }
>  
> -static int unprotect_pm_master(void)
> +static int __init unprotect_pm_master(void)
>  {
>  	int e = 0;
>  
> @@ -821,7 +822,7 @@ static int unprotect_pm_master(void)
>  	return e;
>  }
>  
> -static int power_companion_init(void)
> +static int __init power_companion_init(void)
>  {
>  	struct clk *osc;
>  	u32 rate;
> @@ -866,7 +867,7 @@ static int power_companion_init(void)
>   * don't know whether the COR bit is set in <module>_SIH_CTRL.  Returns
>   * the status from the I2C read operation.
>   */
> -static int twl4030_i2c_clear_isr(u8 mod_no, u8 reg)
> +static int __init twl4030_i2c_clear_isr(u8 mod_no, u8 reg)
>  {
>  	int res;
>  	u8 tmp;
> @@ -878,7 +879,7 @@ static int twl4030_i2c_clear_isr(u8 mod_no, u8 reg)
>  	return twl4030_i2c_write_u8(mod_no, 0xff, reg);
>  }
>  
> -static void twl_init_irq(void)
> +static void __init twl_init_irq(void)
>  {
>  	int	i, j;
>  	int	res = 0;
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCHv3] TWL4030: mark init-only functions as __init
  2008-08-05  8:48   ` Tony Lindgren
@ 2008-08-06  6:43     ` Paul Walmsley
  2008-08-06  8:48       ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Walmsley @ 2008-08-06  6:43 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap


Mark many functions in twl4030-core.c as __init.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---

 drivers/i2c/chips/twl4030-core.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c
index 58ac7f5..205245d 100644
--- a/drivers/i2c/chips/twl4030-core.c
+++ b/drivers/i2c/chips/twl4030-core.c
@@ -693,7 +693,8 @@ static void do_twl4030_irq(unsigned int irq, irq_desc_t *desc)
 }
 
 /* attach a client to the adapter */
-static int twl4030_detect_client(struct i2c_adapter *adapter, unsigned char sid)
+static int __init twl4030_detect_client(struct i2c_adapter *adapter,
+					unsigned char sid)
 {
 	int err = 0;
 	struct twl4030_client *twl;
@@ -742,7 +743,7 @@ static int twl4030_detect_client(struct i2c_adapter *adapter, unsigned char sid)
 }
 
 /* adapter callback */
-static int twl4030_attach_adapter(struct i2c_adapter *adapter)
+static int __init twl4030_attach_adapter(struct i2c_adapter *adapter)
 {
 	int i;
 	int ret = 0;
@@ -795,7 +796,7 @@ static int twl4030_detach_client(struct i2c_client *client)
 	return 0;
 }
 
-static struct task_struct *start_twl4030_irq_thread(int irq)
+static struct task_struct * __init start_twl4030_irq_thread(int irq)
 {
 	struct task_struct *thread;
 
@@ -813,7 +814,7 @@ static struct task_struct *start_twl4030_irq_thread(int irq)
  * These three functions should be part of Voltage frame work
  * added here to complete the functionality for now.
  */
-static int protect_pm_master(void)
+static int __init protect_pm_master(void)
 {
 	int e = 0;
 
@@ -822,7 +823,7 @@ static int protect_pm_master(void)
 	return e;
 }
 
-static int unprotect_pm_master(void)
+static int __init unprotect_pm_master(void)
 {
 	int e = 0;
 
@@ -833,7 +834,7 @@ static int unprotect_pm_master(void)
 	return e;
 }
 
-static int power_companion_init(void)
+static int __init power_companion_init(void)
 {
 	struct clk *osc;
 	u32 rate;
@@ -878,7 +879,7 @@ static int power_companion_init(void)
  * status register to ensure that any prior interrupts are cleared.
  * Returns the status from the I2C read operation.
  */
-static int twl4030_i2c_clear_isr(u8 mod_no, u8 reg, u8 cor)
+static int __init twl4030_i2c_clear_isr(u8 mod_no, u8 reg)
 {
 	u8 tmp;
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCHv3] TWL4030: mark init-only functions as __init
  2008-08-06  6:43     ` [PATCHv3] " Paul Walmsley
@ 2008-08-06  8:48       ` Tony Lindgren
  0 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2008-08-06  8:48 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap

* Paul Walmsley <paul@pwsan.com> [080806 09:43]:
> 
> Mark many functions in twl4030-core.c as __init.

Thanks, pushing today.

Tony

> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> ---
> 
>  drivers/i2c/chips/twl4030-core.c |   15 ++++++++-------
>  1 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c
> index 58ac7f5..205245d 100644
> --- a/drivers/i2c/chips/twl4030-core.c
> +++ b/drivers/i2c/chips/twl4030-core.c
> @@ -693,7 +693,8 @@ static void do_twl4030_irq(unsigned int irq, irq_desc_t *desc)
>  }
>  
>  /* attach a client to the adapter */
> -static int twl4030_detect_client(struct i2c_adapter *adapter, unsigned char sid)
> +static int __init twl4030_detect_client(struct i2c_adapter *adapter,
> +					unsigned char sid)
>  {
>  	int err = 0;
>  	struct twl4030_client *twl;
> @@ -742,7 +743,7 @@ static int twl4030_detect_client(struct i2c_adapter *adapter, unsigned char sid)
>  }
>  
>  /* adapter callback */
> -static int twl4030_attach_adapter(struct i2c_adapter *adapter)
> +static int __init twl4030_attach_adapter(struct i2c_adapter *adapter)
>  {
>  	int i;
>  	int ret = 0;
> @@ -795,7 +796,7 @@ static int twl4030_detach_client(struct i2c_client *client)
>  	return 0;
>  }
>  
> -static struct task_struct *start_twl4030_irq_thread(int irq)
> +static struct task_struct * __init start_twl4030_irq_thread(int irq)
>  {
>  	struct task_struct *thread;
>  
> @@ -813,7 +814,7 @@ static struct task_struct *start_twl4030_irq_thread(int irq)
>   * These three functions should be part of Voltage frame work
>   * added here to complete the functionality for now.
>   */
> -static int protect_pm_master(void)
> +static int __init protect_pm_master(void)
>  {
>  	int e = 0;
>  
> @@ -822,7 +823,7 @@ static int protect_pm_master(void)
>  	return e;
>  }
>  
> -static int unprotect_pm_master(void)
> +static int __init unprotect_pm_master(void)
>  {
>  	int e = 0;
>  
> @@ -833,7 +834,7 @@ static int unprotect_pm_master(void)
>  	return e;
>  }
>  
> -static int power_companion_init(void)
> +static int __init power_companion_init(void)
>  {
>  	struct clk *osc;
>  	u32 rate;
> @@ -878,7 +879,7 @@ static int power_companion_init(void)
>   * status register to ensure that any prior interrupts are cleared.
>   * Returns the status from the I2C read operation.
>   */
> -static int twl4030_i2c_clear_isr(u8 mod_no, u8 reg, u8 cor)
> +static int __init twl4030_i2c_clear_isr(u8 mod_no, u8 reg)
>  {
>  	u8 tmp;
>  

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-08-06  8:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-04 20:56 [PATCHv2 0/2] TWL4030: mark init functions __init, fix kerneldoc Paul Walmsley
2008-08-04 20:56 ` [PATCHv2 1/2] TWL4030: mark init-only functions as __init Paul Walmsley
2008-08-05  8:48   ` Tony Lindgren
2008-08-06  6:43     ` [PATCHv3] " Paul Walmsley
2008-08-06  8:48       ` Tony Lindgren
2008-08-04 20:56 ` [PATCHv2 2/2] TWL4030: convert old-style function documentation to current kerneldoc Paul Walmsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox