From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Fri, 01 Apr 2016 18:31:24 -0500 Subject: [U-Boot] [PATCH 4/9] drivers: nand: implement a NAND uclass In-Reply-To: <1459553139.32510.49.camel@buserror.net> References: <1459510190-26306-1-git-send-email-mugunthanvnm@ti.com> <1459510190-26306-5-git-send-email-mugunthanvnm@ti.com> <1459553139.32510.49.camel@buserror.net> Message-ID: <1459553484.32510.54.camel@buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 2016-04-01 at 18:25 -0500, Scott Wood wrote: > On Fri, 2016-04-01 at 16:59 +0530, Mugunthan V N wrote: > > +static int nand_child_pre_probe(struct udevice *dev) > > +{ > > + nand_info_t *nand = dev_get_uclass_priv(dev); > > + void *priv = dev_get_priv(dev); > > + > > + /* > > + * Store nand device priv pointer in nand_info so that > > + * it can be used by nand command > > + */ > > + nand->priv = priv; > > Wouldn't it make more sense to have a pointer to the device in the NAND > struct, and let the driver manage both privs as it chooses? This makes even less sense after seeing patch 5/9, which assumes dev priv is nand_info_t, and stores its own data in nand->priv. Won't this overwrite that? -Scott