From: kevin.morfitt at fearnside-systems.co.uk <kevin.morfitt@fearnside-systems.co.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] U-Boot][PATCH] ARM Clean-up of ARM920T S3C24x0 drivers code
Date: Sat, 04 Jul 2009 12:25:15 +0100 [thread overview]
Message-ID: <4A4F3C1B.8020200@fearnside-systems.co.uk> (raw)
In-Reply-To: <20090704102725.GA7164@game.jcrosoft.org>
Hi Jean-Christophe
On 04/07/2009 11:27, Jean-Christophe PLAGNIOL-VILLARD wrote:
> 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();
This patch, and the others associated with adding the SBC2440-II Board,
have been replaced by the series of patches "Add support for Embest
SBC2440-II Board" 1 to 7. Patches 1 to 3 use lower case for var and type
name, and replace typedef struct by struct, but they still have the
function name as S3C24X0_GetBase_GPIO() instead of s3c24x0_getbase_gpio().
I'm happy to make the function name lower case and re-issue the "Add
support for Embest SBC2440-II Board" patches 1 to 7 but it might be better
if I waited for you to review them first in case you have any other
comments.
Also, these patches rely on one other patch that hasn't been reviewed yet -
"[U-Boot] [PATCH-ARM] CONFIG_SYS_HZ fix for ARM920T S3C24X0 Boards".
Best Regards
Kevin
>
> Best Regards,
> J.
>
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4216 (20090704) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
prev parent reply other threads:[~2009-07-04 11:25 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
2009-07-04 11:25 ` kevin.morfitt at fearnside-systems.co.uk [this message]
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=4A4F3C1B.8020200@fearnside-systems.co.uk \
--to=kevin.morfitt@fearnside-systems.co.uk \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.