> >> > >> 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��������+%������w��{.n����z�{��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f