fsl: serdes: ensure accessing the initialized maps of serdes protocol
authorHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Tue, 2 Aug 2016 11:03:22 +0000 (19:03 +0800)
committerYork Sun <york.sun@nxp.com>
Wed, 14 Sep 2016 21:06:49 +0000 (14:06 -0700)
commit71fe22256cc9eb5decdd98842ec030ba921cd321
tree8b1aa6d21838bf6391d1e7ef1e54a3822fc154ca
parent07806e622963902efa57959a447c1dd6419e126b
fsl: serdes: ensure accessing the initialized maps of serdes protocol

Up to now, the function is_serdes_configed() doesn't check if the map
of serdes protocol is initialized before accessing it. The function
is_serdes_configed() will get wrong result when it was called before
the serdes protocol maps initialized. As the first element of the map
isn't used for any device, so use it as the flag to indicate if the
map has been initialized.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
23 files changed:
arch/arm/cpu/armv7/ls102xa/fsl_ls1_serdes.c
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_serdes.c
arch/arm/include/asm/arch-fsl-layerscape/fsl_serdes.h
arch/arm/include/asm/arch-ls102xa/fsl_serdes.h
arch/powerpc/cpu/mpc85xx/bsc9132_serdes.c
arch/powerpc/cpu/mpc85xx/c29x_serdes.c
arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
arch/powerpc/cpu/mpc85xx/mpc8536_serdes.c
arch/powerpc/cpu/mpc85xx/mpc8544_serdes.c
arch/powerpc/cpu/mpc85xx/mpc8548_serdes.c
arch/powerpc/cpu/mpc85xx/mpc8568_serdes.c
arch/powerpc/cpu/mpc85xx/mpc8569_serdes.c
arch/powerpc/cpu/mpc85xx/mpc8572_serdes.c
arch/powerpc/cpu/mpc85xx/p1010_serdes.c
arch/powerpc/cpu/mpc85xx/p1021_serdes.c
arch/powerpc/cpu/mpc85xx/p1022_serdes.c
arch/powerpc/cpu/mpc85xx/p1023_serdes.c
arch/powerpc/cpu/mpc85xx/p2020_serdes.c
arch/powerpc/cpu/mpc86xx/mpc8610_serdes.c
arch/powerpc/cpu/mpc86xx/mpc8641_serdes.c
arch/powerpc/include/asm/fsl_serdes.h