Skip to content

Commit

Permalink
mmc: sdhci-pxa: Check pdata before using its members
Browse files Browse the repository at this point in the history
Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
Acked-by: Zhangfei Gao <zhangfei.gao@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Tanmay Upadhyay authored and Chris Ball committed Oct 26, 2011
1 parent 7f7e412 commit 329f223
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mmc/host/sdhci-pxav2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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 &= ~(SDCLK_DELAY_MASK << SDCLK_DELAY_SHIFT);
Expand All @@ -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);
}

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 &= ~CLK_GATE_SETTING_BITS;
writew(tmp, host->ioaddr + SD_FIFO_PARAM);
Expand Down

0 comments on commit 329f223

Please sign in to comment.