Re: [PATCH 2/2] POWERPC: Remove global CPM mappings
From: Dan Malek <hidden>
Date: 2007-03-27 22:19:18
On Mar 27, 2007, at 5:01 PM, Vitaly Bordug wrote:
quoted hunk ↗ jump to hunk
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c@@ -52,7 +52,7 @@ void cpm_line_cr_cmd(int line, int cmd) { ushort val; - volatile cpm8xx_t *cp = cpmp; + volatile cpm8xx_t *cp = (cpm8xx_t *)immr_map(im_cpm);
I'd kind of prefer you didn't place function calls or macros up here with the variable declarations. Do the initialization down in the code section, please.
+#ifdef CONFIG_CPM2
#define cpm2_map(member) (&cpm2_immr->member)
#define cpm2_map_size(member, size) (&cpm2_immr->member)
#define cpm2_unmap(addr) do {} while(0)
+#endif
+
+#ifdef CONFIG_8xx
+#define immr_map(member) (&((immap_t *)IMAP_ADDR)->member)
+#define immr_map_size(member, size) (&((immap_t *)IMAP_ADDR)->member)
+#define immr_unmap(addr) do {} while(0)
+#endifWhy is 8xx different? We should be able to devine cpm_immr and use it in both cases here, and hopefully use the same macro names across all drivers, too. Thanks. -- Dan