From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] U-Boot][PATCH] ARM Clean-up of ARM920T S3C24x0 drivers code
Date: Sat, 4 Jul 2009 12:27:25 +0200 [thread overview]
Message-ID: <20090704102725.GA7164@game.jcrosoft.org> (raw)
In-Reply-To: <4A296BE0.1030408@fearnside-systems.co.uk>
On 20:02 Fri 05 Jun , kevin.morfitt at fearnside-systems.co.uk wrote:
> This re-formats the S3C24x0 drivers code to meet the coding style requirements
> and to make it always use the proper I/O accessor functions when accessing
> registers. It was done using 'Lindent -kr -i8 -l80' followed by manual
> inspection of the output. checkpatch.pl reports no problems with the patch
> and I've run MAKEALL for all ARM9 boards with no problems.
>
> This has been done to create a good starting point for me to add support for
> a new board, the Embest SBC2440-II. Another patch does the same for the
> ARM920 S3C24x0 CPU and headers code.
>
> Signed-off-by: Kevin Morfitt <kevin.morfitt@fearnside-systems.co.uk>
> ---
> drivers/i2c/s3c24x0_i2c.c | 269 ++++++++++++++++++++-------------------
> drivers/mtd/nand/s3c2410_nand.c | 97 +++++++--------
> drivers/rtc/s3c24x0_rtc.c | 126 +++++++++---------
> drivers/serial/serial_s3c24x0.c | 143 ++++++++++++---------
> 4 files changed, 324 insertions(+), 311 deletions(-)
>
> diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
> index f0c1aa3..33cd3d4 100644
> --- a/drivers/i2c/s3c24x0_i2c.c
> +++ b/drivers/i2c/s3c24x0_i2c.c
> @@ -32,6 +32,8 @@
> #elif defined(CONFIG_S3C2410)
> #include <s3c2410.h>
> #endif
> +
> +#include <asm/io.h>
> #include <i2c.h>
>
> #ifdef CONFIG_HARD_I2C
> @@ -42,36 +44,35 @@
> #define I2C_OK 0
> #define I2C_NOK 1
> #define I2C_NACK 2
> -#define I2C_NOK_LA 3 /* Lost arbitration */
> -#define I2C_NOK_TOUT 4 /* time out */
> -
> -#define I2CSTAT_BSY 0x20 /* Busy bit */
> -#define I2CSTAT_NACK 0x01 /* Nack bit */
> -#define I2CCON_IRPND 0x10 /* Interrupt pending bit */
> -#define I2C_MODE_MT 0xC0 /* Master Transmit Mode */
> -#define I2C_MODE_MR 0x80 /* Master Receive Mode */
> -#define I2C_START_STOP 0x20 /* START / STOP */
> -#define I2C_TXRX_ENA 0x10 /* I2C Tx/Rx enable */
> +#define I2C_NOK_LA 3 /* Lost arbitration */
> +#define I2C_NOK_TOUT 4 /* time out */
>
> -#define I2C_TIMEOUT 1 /* 1 second */
> +#define I2CSTAT_BSY 0x20 /* Busy bit */
> +#define I2CSTAT_NACK 0x01 /* Nack bit */
> +#define I2CCON_IRPND 0x10 /* Interrupt pending bit */
> +#define I2C_MODE_MT 0xC0 /* Master Transmit Mode */
> +#define I2C_MODE_MR 0x80 /* Master Receive Mode */
> +#define I2C_START_STOP 0x20 /* START / STOP */
> +#define I2C_TXRX_ENA 0x10 /* I2C Tx/Rx enable */
>
> +#define I2C_TIMEOUT 1 /* 1 second */
>
> static int GetI2CSDA(void)
> {
> S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
const make not so much sense here
please replace by
type *name
when you are at cleaning it please use lowercase for type and function and
var name
and replace typedef struct by struct
as
struct s3c24x0_gpio *gpio = s3c24x0_get_base_gpio();
Best Regards,
J.
next prev parent reply other threads:[~2009-07-04 10:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-05 19:02 [U-Boot] U-Boot][PATCH] ARM Clean-up of ARM920T S3C24x0 drivers code kevin.morfitt at fearnside-systems.co.uk
2009-07-04 10:27 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2009-07-04 11:25 ` kevin.morfitt at fearnside-systems.co.uk
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=20090704102725.GA7164@game.jcrosoft.org \
--to=plagnioj@jcrosoft.com \
--cc=u-boot@lists.denx.de \
/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