Re: [PATCH 11/14] mtd: maps: Merge physmap_of.c into physmap-core.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ricardo,

On Tue, 9 Oct 2018 08:58:40 +0200
Ricardo Ribalda Delgado <ricardo.ribalda@xxxxxxxxx> wrote:


> > +
> > +static int physmap_flash_probe(struct platform_device *dev)
> > +{
> >         struct physmap_flash_info *info;
> >         const char * const *probe_type;
> > -       const char * const *part_types;
> >         int err = 0;
> >         int i;
> >
> > -       physmap_data = dev_get_platdata(&dev->dev);
> > -       if (!physmap_data)
> > -               return -ENODEV;
> > +       if (!dev->dev.of_node && dev_get_platdata(&dev->dev))
> > +               return -EINVAL;  
> 
> Maybe you want:
>             if (!dev->dev.of_node && !dev_get_platdata(&dev->dev))

Yes, I'll fix that.

> >
> >         info = devm_kzalloc(&dev->dev, sizeof(*info), GFP_KERNEL);
> >         if (!info)
> > @@ -132,14 +341,15 @@ static int physmap_flash_probe(struct platform_device *dev)
> >         if (!info->mtds)
> >                 return -ENOMEM;
> >
> > -       if (physmap_data->init) {
> > -               err = physmap_data->init(dev);
> > -               if (err)
> > -                       goto err_out;
> > -       }
> > -
> >         platform_set_drvdata(dev, info);
> >
> > +       err = physmap_flash_of_init(dev);
> > +       if (err)
> > +               err = physmap_flash_pdata_init(dev);
> > +  
> 
> Maybe replace this with:
>   if (dev->dev.of_node)
>      err = physmap_flash_of_init(dev);
>  else
>     err = physmap_flash_pdata_init(dev);
> 
> Otherwise we are hiding the returncode from  of_init, which might be
> defered probing.

Will fix that one too.

Thanks for your review.

Boris



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux