Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161174AbbKSTTb (ORCPT ); Thu, 19 Nov 2015 14:19:31 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:34464 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751465AbbKSTT2 (ORCPT ); Thu, 19 Nov 2015 14:19:28 -0500 Date: Thu, 19 Nov 2015 11:19:24 -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 02/27] mtd: nand: add an mtd_to_nand() helper Message-ID: <20151119191924.GF64635@google.com> References: <1447681080-31232-1-git-send-email-boris.brezillon@free-electrons.com> <1447681080-31232-3-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-3-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: 1532 Lines: 40 On Mon, Nov 16, 2015 at 02:37:35PM +0100, Boris Brezillon wrote: > Some drivers are retrieving the nand_chip pointer using the container_of > macro on a struct wrapping both the nand_chip and the mtd_info struct while > the standard way of retrieving this pointer is through mtd->priv. > Provide an helper to do that. > > Signed-off-by: Boris Brezillon > --- > include/linux/mtd/nand.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h > index 4f7c9b9..056d165 100644 > --- a/include/linux/mtd/nand.h > +++ b/include/linux/mtd/nand.h > @@ -730,6 +730,11 @@ static inline struct device_node *nand_get_flash_node(struct nand_chip *chip) > return chip->flash_node; > } > > +static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd) > +{ > + return mtd->priv; > +} > + Pushed this patch to l2-mtd.git, though I rebased it directly onto 4.4-rc1 and then merged it in. That way, if any other subsystems want to start using this in the 4.5 -next cycle (e.g., for patches 4-8), they can pull it in without taking the rest of MTD. I can push this to a separate branch or signed tag, if anyone wants. Or, I can take the arch/ patches via MTD, if that's a better option. Brian -- 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/