Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753654AbbGaRZI (ORCPT ); Fri, 31 Jul 2015 13:25:08 -0400 Received: from down.free-electrons.com ([37.187.137.238]:50922 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752434AbbGaRZF (ORCPT ); Fri, 31 Jul 2015 13:25:05 -0400 Date: Fri, 31 Jul 2015 19:24:58 +0200 From: Boris Brezillon To: Michal Suchanek Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , David Woodhouse , Brian Norris , devicetree , Linux Kernel Mailing List , MTD Maling List Subject: Re: [PATCH v2 5/5] mtd: ofpart: move ofpart partitions to a dedicated dt node Message-ID: <20150731192458.457c6c9d@bbrezillon> In-Reply-To: References: <4982216b5cb602c71ade6810cecdb9535e0862fc.1438340815.git.hramrach@gmail.com> <20150731180614.162852ee@bbrezillon> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1342 Lines: 44 On Fri, 31 Jul 2015 18:52:01 +0200 Michal Suchanek wrote: > > > >> (*pparts)[i].offset = of_read_number(reg, a_cells); > >> (*pparts)[i].size = of_read_number(reg + a_cells, s_cells); > >> > >> @@ -92,15 +116,15 @@ static int parse_ofpart_partitions(struct mtd_info *master, > >> i++; > >> } > >> > >> - if (!i) { > >> - of_node_put(pp); > >> - pr_err("No valid partition found on %s\n", node->full_name); > >> - kfree(*pparts); > >> - *pparts = NULL; > >> - return -EINVAL; > >> - } > >> - > > > > Are you sure you can safely remove this check? > > Yes. It was incomplete check to reject some partitioning schemes > considered invalid. > > Now there is stricter checking above so this can be removed. Indeed, I was worried about resources deallocation, but this is handle by the caller, and if nr_parts is zero the master MTD device will be exposed. -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/