Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752316AbbKQDD7 (ORCPT ); Mon, 16 Nov 2015 22:03:59 -0500 Received: from mail-pa0-f65.google.com ([209.85.220.65]:36853 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751214AbbKQDD5 (ORCPT ); Mon, 16 Nov 2015 22:03:57 -0500 Date: Mon, 16 Nov 2015 19:03:53 -0800 From: Brian Norris To: Boris Brezillon 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: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1447681080-31232-19-git-send-email-boris.brezillon@free-electrons.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1516 Lines: 41 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. > struct we can safely update the mtd_to_nand_chip() implementation to use Nit: s/mtd_to_nand_chip/mtd_to_nand/ > 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 > -- 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/