From: Bryan Wu <bryan.wu@analog.com>
To: Joe Perches <joe@perches.com>,
michael.hennerich@analog.com, LKML <linux-kernel@vger.kernel.org>
Cc: bryan.wu@analog.com
Subject: Re: [GIT PULL try#2] Blackfin update
Date: Thu, 26 Jul 2007 14:10:46 +0800 [thread overview]
Message-ID: <1185430246.23987.4.camel@roc-desktop> (raw)
In-Reply-To: <1185382018.1050.152.camel@localhost>
Hi Joe, please reply to all of this email, because some developers need
to consider your review.
Hi Michael, how do you think of Joe's idea as below.
Thanks,
Best Regards,
- Bryan Wu
On Wed, 2007-07-25 at 09:46 -0700, Joe Perches wrote:
> On Wed, 2007-07-25 at 23:26 +0800, Bryan Wu wrote:
> > diff --git a/arch/blackfin/kernel/bfin_gpio.c
> > b/arch/blackfin/kernel/bfin_gpio.c
> > index bafcfa5..979cf79 100644
> > --- a/arch/blackfin/kernel/bfin_gpio.c
> > +++ b/arch/blackfin/kernel/bfin_gpio.c
> > @@ -143,22 +148,100 @@ inline int check_gpio(unsigned short gpio)
>
> []
>
> > +#ifdef BF537_FAMILY
> > +
> > +#define PMUX_LUT_RES 0
> > +#define PMUX_LUT_OFFSET 1
> > +#define PMUX_LUT_ENTRIES 41
> > +#define PMUX_LUT_SIZE 2
> > +
> > +static unsigned short port_mux_lut[PMUX_LUT_ENTRIES][PMUX_LUT_SIZE] = {
> > + {P_PPI0_D13, 11}, {P_PPI0_D14, 11}, {P_PPI0_D15, 11},
> > + {P_SPORT1_TFS, 11}, {P_SPORT1_TSCLK, 11}, {P_SPORT1_DTPRI, 11},
> > + {P_PPI0_D10, 10}, {P_PPI0_D11, 10}, {P_PPI0_D12, 10},
> > + {P_SPORT1_RSCLK, 10}, {P_SPORT1_RFS, 10}, {P_SPORT1_DRPRI, 10},
> > + {P_PPI0_D8, 9}, {P_PPI0_D9, 9}, {P_SPORT1_DRSEC, 9},
> > + {P_SPORT1_DTSEC, 9}, {P_TMR2, 8}, {P_PPI0_FS3, 8}, {P_TMR3, 7},
> > + {P_SPI0_SSEL4, 7}, {P_TMR4, 6}, {P_SPI0_SSEL5, 6}, {P_TMR5, 5},
> > + {P_SPI0_SSEL6, 5}, {P_UART1_RX, 4}, {P_UART1_TX, 4}, {P_TMR6, 4},
> > + {P_TMR7, 4}, {P_UART0_RX, 3}, {P_UART0_TX, 3}, {P_DMAR0, 3},
> > + {P_DMAR1, 3}, {P_SPORT0_DTSEC, 1}, {P_SPORT0_DRSEC, 1},
> > + {P_CAN0_RX, 1}, {P_CAN0_TX, 1}, {P_SPI0_SSEL7, 1},
> > + {P_SPORT0_TFS, 0}, {P_SPORT0_DTPRI, 0}, {P_SPI0_SSEL2, 0},
> > + {P_SPI0_SSEL3, 0}
> > +};
>
> Wouldn't this be better as a struct?
>
> struct PMUX_LUT {
> unsigned short res;
> unsigned short offset;
> }
>
> struct PMUX_LUT port_mux_lut = {
> {.res = P_PPI0_D13, .offset = 11},
> {.res = P_PPi0_D14, .offset = 11},
> etc?
> };
>
> > +
> > +static void portmux_setup(unsigned short per, unsigned short
> > function)
> > +{
> > + u16 y, muxreg, offset;
>
> Shouldn't y be int?
>
> > @@ -179,22 +262,15 @@ static void default_gpio(unsigned short gpio)
> >
> > static int __init bfin_gpio_init(void)
> > {
> > - int i;
> > -
> > - printk(KERN_INFO "Blackfin GPIO Controller\n");
> >
> > - for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE)
> > - reserved_map[gpio_bank(i)] = 0;
> > + str_ident = kzalloc(RESOURCE_LABEL_SIZE * 256, GFP_KERNEL);
>
> 256?
>
> perhaps better to use kcalloc(RESOURCE_LABEL_SIZE, 256, GFP_KERNEL)
> and reference str_ident as an array of char* instead of the
> multiplies in set_label, get_label and cmp_label?
>
> > + if (!str_ident)
> > + return -ENOMEM;
>
> cheers, Joe
next prev parent reply other threads:[~2007-07-26 6:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-25 15:26 Bryan Wu
2007-07-25 18:26 ` Linus Torvalds
2007-07-26 0:41 ` Bryan Wu
[not found] ` <1185382018.1050.152.camel@localhost>
2007-07-26 6:10 ` Bryan Wu [this message]
2007-07-26 8:21 Hennerich, Michael
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=1185430246.23987.4.camel@roc-desktop \
--to=bryan.wu@analog.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hennerich@analog.com \
/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
all inboxes | Powered by JetHome®