提交 329f2237 编写于 作者: T Tanmay Upadhyay 提交者: Chris Ball

mmc: sdhci-pxa: Check pdata before using its members

Signed-off-by: NTanmay Upadhyay <tanmay.upadhyay@einfochips.com>
Acked-by: NZhangfei Gao <zhangfei.gao@marvell.com>
Signed-off-by: NChris Ball <cjb@laptop.org>
上级 7f7e4129
无相关合并请求
...@@ -59,7 +59,7 @@ static void pxav2_set_private_registers(struct sdhci_host *host, u8 mask) ...@@ -59,7 +59,7 @@ static void pxav2_set_private_registers(struct sdhci_host *host, u8 mask)
* tune timing of read data/command when crc error happen * tune timing of read data/command when crc error happen
* no performance impact * no performance impact
*/ */
if (pdata->clk_delay_sel == 1) { if (pdata && pdata->clk_delay_sel == 1) {
tmp = readw(host->ioaddr + SD_CLOCK_BURST_SIZE_SETUP); tmp = readw(host->ioaddr + SD_CLOCK_BURST_SIZE_SETUP);
tmp &= ~(SDCLK_DELAY_MASK << SDCLK_DELAY_SHIFT); tmp &= ~(SDCLK_DELAY_MASK << SDCLK_DELAY_SHIFT);
...@@ -71,7 +71,7 @@ static void pxav2_set_private_registers(struct sdhci_host *host, u8 mask) ...@@ -71,7 +71,7 @@ static void pxav2_set_private_registers(struct sdhci_host *host, u8 mask)
writew(tmp, host->ioaddr + SD_CLOCK_BURST_SIZE_SETUP); writew(tmp, host->ioaddr + SD_CLOCK_BURST_SIZE_SETUP);
} }
if (pdata->flags & PXA_FLAG_ENABLE_CLOCK_GATING) { if (pdata && (pdata->flags & PXA_FLAG_ENABLE_CLOCK_GATING)) {
tmp = readw(host->ioaddr + SD_FIFO_PARAM); tmp = readw(host->ioaddr + SD_FIFO_PARAM);
tmp &= ~CLK_GATE_SETTING_BITS; tmp &= ~CLK_GATE_SETTING_BITS;
writew(tmp, host->ioaddr + SD_FIFO_PARAM); writew(tmp, host->ioaddr + SD_FIFO_PARAM);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部