From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Subject: Re: [PATCH 11/14] mtd: maps: Merge physmap_of.c into physmap-core.c Date: Tue, 9 Oct 2018 09:06:54 +0200 Message-ID: <20181009090654.44e54b3e@bbrezillon> References: <20181008201027.17952-1-boris.brezillon@bootlin.com> <20181008201027.17952-12-boris.brezillon@bootlin.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+gldm-linux-mtd-36=gmane.org@lists.infradead.org To: Ricardo Ribalda Delgado Cc: Mark Rutland , devicetree@vger.kernel.org, Pawel Moll , Ian Campbell , Richard Weinberger , Marek Vasut , Rob Herring , linux-mtd@lists.infradead.org, Kumar Gala , Brian Norris , David Woodhouse List-Id: devicetree@vger.kernel.org Hi Ricardo, On Tue, 9 Oct 2018 08:58:40 +0200 Ricardo Ribalda Delgado 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 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/