* [PATCH] mfd: wm97xx-core: platform data can be NULL
@ 2018-06-03 20:16 Robert Jarzmik
2018-06-04 8:59 ` Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Robert Jarzmik @ 2018-06-03 20:16 UTC (permalink / raw)
To: Lee Jones; +Cc: patches, linux-kernel, Robert Jarzmik
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: a5c6951c49fb ("mfd: wm97xx-core: core support for wm97xx Codec")
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
drivers/mfd/wm97xx-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/wm97xx-core.c b/drivers/mfd/wm97xx-core.c
index 4141ee52a70b..f5a8347f837f 100644
--- a/drivers/mfd/wm97xx-core.c
+++ b/drivers/mfd/wm97xx-core.c
@@ -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:
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mfd: wm97xx-core: platform data can be NULL
2018-06-03 20:16 [PATCH] mfd: wm97xx-core: platform data can be NULL Robert Jarzmik
@ 2018-06-04 8:59 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2018-06-04 8:59 UTC (permalink / raw)
To: Robert Jarzmik; +Cc: patches, linux-kernel
On Sun, 03 Jun 2018, Robert Jarzmik wrote:
> 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: a5c6951c49fb ("mfd: wm97xx-core: core support for wm97xx Codec")
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
> drivers/mfd/wm97xx-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-04 9:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-03 20:16 [PATCH] mfd: wm97xx-core: platform data can be NULL Robert Jarzmik
2018-06-04 8:59 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).