From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sat, 3 Aug 2013 18:47:26 +0200 Subject: [U-Boot] [PATCH V3 01/20] Add functions for use with i.mx6 otg udc In-Reply-To: <51FC69C7.2000407@boundarydevices.com> References: <1375399657-25642-1-git-send-email-troy.kisky@boundarydevices.com> <201308030345.24452.marex@denx.de> <51FC69C7.2000407@boundarydevices.com> Message-ID: <201308031847.26751.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Troy Kisky, [...] > >> Why is there a union ? It looks to me like you just want to access the > >> same variable > >> with 2 naming strategies. > > > > That is correct. I can either pass it further into functions as the > > struct mxs_register_32 name_reg or I can directly access it as > > name_set/_clr/_tog . Works just fine. > > I never said it didn't work, obviously it does. > > > Best regards, > > Marek Vasut > > There may be code that you can point at that would make this useful, but > I have > a hard time envisioning it. The code I added, I know doesn't need a > union, and I bet most > of the other variable accesses don't need a union. That's why I asked if > you'd like > me to attempt to clean it up (always access thru struct, ie replace > name_set with name.set). No, I want to keep this as-is. Especially because the MX28 has the registers named exactly by this scheme. > I don't want to change the code I added to use this. Please do, I do not want a duplicit implementation of these register structures in the tree. > I can see a small advantage in consistency with the mx28. THe MX6 uses many IP blocks from MX28 -- APBH DMA, NAND, USB -- to name a few. Keeping mx28 and mx6 aligned is more than helpful. Best regards, Marek Vasut