lkml.org 
[lkml]   [2013]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] extcon: arizona: Get pdata from arizona structure not device
On 09/28/2013 11:34 PM, Charles Keepax wrote:
> In the case of a device tree system there will be no pdata attached to
> the device, causing us to deference a NULL pointer. Better to take the
> pdata from the Arizona structure as this will always exist and we know
> will have been populated since it is populated by the MFD device which
> binds in the extcon driver.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> ---
> drivers/extcon/extcon-arizona.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
> index ec9a14e..178454d 100644
> --- a/drivers/extcon/extcon-arizona.c
> +++ b/drivers/extcon/extcon-arizona.c
> @@ -1079,7 +1079,7 @@ static void arizona_micd_set_level(struct arizona *arizona, int index,
> static int arizona_extcon_probe(struct platform_device *pdev)
> {
> struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
> - struct arizona_pdata *pdata;
> + struct arizona_pdata *pdata = &arizona->pdata;
> struct arizona_extcon_info *info;
> unsigned int val;
> int jack_irq_fall, jack_irq_rise;
> @@ -1088,8 +1088,6 @@ static int arizona_extcon_probe(struct platform_device *pdev)
> if (!arizona->dapm || !arizona->dapm->card)
> return -EPROBE_DEFER;
>
> - pdata = dev_get_platdata(arizona->dev);
> -
> info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
> if (!info) {
> dev_err(&pdev->dev, "Failed to allocate memory\n");
>

No, extcon-arizona driver don't currently support DT to get platform data.
I cannot find some dt function to parse data from dts file.
You have to implement extcon-arizona driver by using DT binding style
to get platform data. I think this patch is not necessary.

Thanks
Chanwoo Choi







\
 
 \ /
  Last update: 2013-09-30 01:41    [W:2.566 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site