Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854AbbKQI03 (ORCPT ); Tue, 17 Nov 2015 03:26:29 -0500 Received: from down.free-electrons.com ([37.187.137.238]:38128 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751452AbbKQI00 (ORCPT ); Tue, 17 Nov 2015 03:26:26 -0500 Date: Tue, 17 Nov 2015 09:26:16 +0100 From: Boris Brezillon To: Brian Norris Cc: David Woodhouse , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Hartley Sweeten , Ryan Mallon , Shawn Guo , Sascha Hauer , Imre Kaloz , Krzysztof Halasa , Tony Lindgren , linux-omap@vger.kernel.org, Alexander Clouter , Thomas Petazzoni , Gregory CLEMENT , Jason Cooper , Sebastian Hesselbarth , Andrew Lunn , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Marek Vasut , Steven Miao , adi-buildroot-devel@lists.sourceforge.net, Mikael Starvik , Jesper Nilsson , linux-cris-kernel@axis.com, Josh Wu , Wan ZongShun , Ezequiel Garcia , Maxim Levitsky , Kukjin Kim , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, Maxime Ripard , Chen-Yu Tsai , linux-sunxi@googlegroups.com, Stefan Agner , Greg Kroah-Hartman , devel@driverdev.osuosl.org Subject: Re: [PATCH 18/27] mtd: nand: update mtd_to_nand() Message-ID: <20151117092616.0e33d2f3@bbrezillon> In-Reply-To: <20151117030353.GZ8456@google.com> References: <1447681080-31232-1-git-send-email-boris.brezillon@free-electrons.com> <1447681080-31232-19-git-send-email-boris.brezillon@free-electrons.com> <20151117030353.GZ8456@google.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; 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: 1931 Lines: 58 On Mon, 16 Nov 2015 19:03:53 -0800 Brian Norris wrote: > On Mon, Nov 16, 2015 at 02:37:51PM +0100, Boris Brezillon wrote: > > Now that all drivers are using the mtd instance embedded in the nand_chip > > Do you have a script that verifies this? I thought you did at some > point, and it'd be nice to note it, so I can also use it to verify > things once it gets applied. No, didn't write that script, but it should probably look like the one I used to remove the mtd field from driver private struct. > > > struct we can safely update the mtd_to_nand_chip() implementation to use > > Nit: s/mtd_to_nand_chip/mtd_to_nand/ Yep, I'll fix that. > > > the container_of macro instead of returning the content of mtd->priv. > > This will allow us to remove mtd->priv = chip assignments done in all > > NAND controller drivers. > > > > Signed-off-by: Boris Brezillon > > --- > > include/linux/mtd/nand.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h > > index 8ec071e..873646d 100644 > > --- a/include/linux/mtd/nand.h > > +++ b/include/linux/mtd/nand.h > > @@ -734,7 +734,7 @@ static inline struct device_node *nand_get_flash_node(struct nand_chip *chip) > > > > static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd) > > { > > - return mtd->priv; > > + return container_of(mtd, struct nand_chip, mtd); > > } > > > > static inline struct mtd_info *nand_to_mtd(struct nand_chip *chip) > > -- > > 2.1.4 > > -- 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/