提交 0ec734c2 编写于 作者: W Wolfgang Ocker 提交者: Ralf Baechle

[MIPS] Alchemy: Fix ids in Alchemy db dma device table

0 is a valid device id (DSCR_CMD0_UART0_TX), so we can't use it to mark
an empty entry in the device table. Use ~0 instead and search for id ~0
when looking for a free entry.
Signed-off-by: NWolfgang Ocker <weo@reccoware.de>
Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 baadac8b
...@@ -161,22 +161,22 @@ static dbdev_tab_t dbdev_tab[] = { ...@@ -161,22 +161,22 @@ static dbdev_tab_t dbdev_tab[] = {
{ DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
/* Provide 16 user definable device types */ /* Provide 16 user definable device types */
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 }, { ~0, 0, 0, 0, 0, 0, 0 },
}; };
#define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab) #define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab)
...@@ -209,7 +209,7 @@ au1xxx_ddma_add_device(dbdev_tab_t *dev) ...@@ -209,7 +209,7 @@ au1xxx_ddma_add_device(dbdev_tab_t *dev)
dbdev_tab_t *p=NULL; dbdev_tab_t *p=NULL;
static u16 new_id=0x1000; static u16 new_id=0x1000;
p = find_dbdev_id(0); p = find_dbdev_id(~0);
if ( NULL != p ) if ( NULL != p )
{ {
memcpy(p, dev, sizeof(dbdev_tab_t)); memcpy(p, dev, sizeof(dbdev_tab_t));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册