RE: [PATCH 3/3] GPIO: gpio-dwapb: Suspend & Resume PM enabling
From: Chen, Alvin
Date: Fri Sep 05 2014 - 04:21:01 EST
> >>
> >> Insert this into the dynamically allocated per-port or chip struct instead.
> >>
> > How about the following?
> >
> > static struct dwapb_context {
> > u32 data[DWAPB_MAX_PORTS];
> > u32 dir[DWAPB_MAX_PORTS];
> > u32 ext[DWAPB_MAX_PORTS];
> > u32 int_en;
> > u32 int_mask;
> > u32 int_type;
> > u32 int_pol;
> > u32 int_deb;
> > } dwapb_context;
>
> NO because this is still a singleton variable. Put it into the dynamically allocated
> structs.
>
> > Comparing to allocate for each port
> > dynamically, it is more directly and easy to understand.
>
> No, I disagree. The overall design pattern in the kernel is to allocate all state
> containers dynamically.
>
OK. Please also help review the v2 I just sent out, and after getting more feedbacks, I will improve this part in the next version together.
N§²æ¸yú²X¬¶ÇvØ)Þ{.nÇ·¥{±êX§¶¡Ü}©²ÆzÚj:+v¨¾«êZ+Êzf£¢·h§~Ûÿû®w¥¢¸?¨è&¢)ßfùy§m
á«a¶Úÿ0¶ìå