提交 46f107d0 编写于 作者: R Robert Jarzmik 提交者: Lee Jones

mfd: wm97xx-core: Platform data can be NULL

It is not mandatory that platform data is passed along the ac97
codec. Actually there are configuration without a battery connected to
the ADC of the codec.

This is for example the case for the PXA zylonite platform, so fix the
NULL dereferencing by adding a test.

Fixes: a5c6951c ("mfd: wm97xx-core: core support for wm97xx Codec")
Signed-off-by: NRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 df7c3bf2
......@@ -278,7 +278,7 @@ static int wm97xx_ac97_probe(struct ac97_codec_device *adev)
codec_pdata = &wm97xx->codec_pdata;
codec_pdata->ac97 = wm97xx->ac97;
codec_pdata->batt_pdata = pdata->batt_pdata;
codec_pdata->batt_pdata = pdata ? pdata->batt_pdata : NULL;
switch (adev->vendor_id) {
case WM9705_VENDOR_ID:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册