From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Subject: Re: [PATCH v4 19/35] mtd: rawnand: sh_flctl: move all NAND chip related setup in one function Date: Sat, 21 Jul 2018 19:48:29 +0200 Message-ID: <20180721194829.44e9b29f@bbrezillon> References: <20180720151527.16038-1-miquel.raynal@bootlin.com> <20180720151527.16038-20-miquel.raynal@bootlin.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20180720151527.16038-20-miquel.raynal@bootlin.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Miquel Raynal Cc: Alexandre Belloni , Mans Rullgard , Maxime Ripard , Stefan Agner , linux-kernel@vger.kernel.org, Masahiro Yamada , linux-mtd@lists.infradead.org, Kamal Dasu , Josh Wu , Marc Gonzalez , Marek Vasut , Chen-Yu Tsai , bcm-kernel-feedback-list@broadcom.com, Sylvain Lemieux , Wenyou Yang , Tudor Ambarus , Vladimir Zapolskiy , Harvey Hunt , linux-mediatek@lists.infradead.org, Matthias Brugger , Han Xu , Xiaolei Li , linux-arm-kernel@lists.infradead.org, Richard List-Id: linux-mediatek@lists.infradead.org On Fri, 20 Jul 2018 17:15:11 +0200 Miquel Raynal wrote: > @@ -1007,6 +1007,16 @@ static int flctl_chip_init_tail(struct mtd_info *mtd) > struct sh_flctl *flctl = mtd_to_flctl(mtd); > struct nand_chip *chip = &flctl->chip; > > + if (chip->options & NAND_BUSWIDTH_16) { > + /* > + * NAND_BUSWIDTH_16 may have been set by nand_scan_ident(). > + * Add the SEL_16BIT flag in pdata->flcmncr_val and re-assign > + * flctl->flcmncr_base to pdata->flcmncr_val. > + */ > + flctl->pdata->flcmncr_val |= SEL_16BIT; > + flctl->flcmncr_base = flctl->pdata->flcmncr_val; pdata->flcmncr_val is not used after this point. I think you can just do flctl->flcmncr_base |= SEL_16BIT; and get rid of the ftcl->pdata field you add in this patch. > + } > +