From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Subject: Re: [PATCH v2 5/5] mtd: ofpart: move ofpart partitions to a dedicated dt node Date: Fri, 31 Jul 2015 19:24:58 +0200 Message-ID: <20150731192458.457c6c9d@bbrezillon> References: <4982216b5cb602c71ade6810cecdb9535e0862fc.1438340815.git.hramrach@gmail.com> <20150731180614.162852ee@bbrezillon> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: devicetree@vger.kernel.org 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