linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jonathan Corbet <corbet-T1hC0tSOHrs@public.gmane.org>,
	linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Hartley Sweeten
	<hsweeten-3FF4nKcrg1dE2c76skzGb0EOCMrvLtNR@public.gmane.org>,
	Ryan Mallon <rmallon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Shawn Guo <shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Sascha Hauer <kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Imre Kaloz <kaloz-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>,
	Krzysztof Halasa <khalasa-NlWvg49iv0c@public.gmane.org>,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Alexander Clouter <alex-L4GPcECwBoDe9xe1eoZjHA@public.gmane.org>,
	Thomas Petazzoni
	<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Gregory CLEMENT
	<gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
	Sebastian Hesselbarth
	<sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>,
	Daniel Mack <daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org>,
	Haojian Zhuang
	<haojian.zhuang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Robert Jarzmik <robert.jarzmik-GANU6spQydw@public.gmane.org>,
	Marek
Subject: Re: [PATCH 18/27] mtd: nand: update mtd_to_nand()
Date: Tue, 17 Nov 2015 09:26:16 +0100	[thread overview]
Message-ID: <20151117092616.0e33d2f3@bbrezillon> (raw)
In-Reply-To: <20151117030353.GZ8456-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

On Mon, 16 Nov 2015 19:03:53 -0800
Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> > ---
> >  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

  parent reply	other threads:[~2015-11-17  8:26 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 13:37 [PATCH 00/27] mtd: nand: refactor the NAND subsystem (part 1) Boris Brezillon
2015-11-16 13:37 ` [PATCH 02/27] mtd: nand: add an mtd_to_nand() helper Boris Brezillon
     [not found]   ` <1447681080-31232-3-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2015-11-19 19:19     ` Brian Norris
2015-11-16 13:37 ` [PATCH 03/27] mtd: nand: update examples in the documentation to use mtd_to_nand() Boris Brezillon
2015-11-19 19:22   ` Brian Norris
2015-11-16 13:37 ` [PATCH 05/27] blackfin: nand: make use of mtd_to_nand() where appropriate Boris Brezillon
2015-11-16 13:37 ` [PATCH 06/27] cris: " Boris Brezillon
2015-11-16 13:37 ` [PATCH 07/27] mips: " Boris Brezillon
2015-11-16 13:37 ` [PATCH 09/27] mtd: nand: make use of mtd_to_nand() in NAND core code Boris Brezillon
2015-11-16 13:37 ` [PATCH 10/27] mtd: nand: make use of mtd_to_nand() in NAND drivers Boris Brezillon
2015-11-16 13:37 ` [PATCH 13/27] mtd: nand: add nand_to_mtd() helper Boris Brezillon
2015-11-16 13:37 ` [PATCH 17/27] cris: nand: use the mtd instance embedded in struct nand_chip Boris Brezillon
2015-11-16 13:37 ` [PATCH 18/27] mtd: nand: update mtd_to_nand() Boris Brezillon
2015-11-17  3:03   ` Brian Norris
     [not found]     ` <20151117030353.GZ8456-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-11-17  8:26       ` Boris Brezillon [this message]
     [not found] ` <1447681080-31232-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2015-11-16 13:37   ` [PATCH 01/27] mtd: nand: fix drivers abusing mtd->priv Boris Brezillon
2015-11-19 19:07     ` Brian Norris
2015-11-16 13:37   ` [PATCH 04/27] ARM: nand: make use of mtd_to_nand() where appropriate Boris Brezillon
2015-11-16 13:37   ` [PATCH 08/27] sh: " Boris Brezillon
2015-11-16 13:37   ` [PATCH 11/27] staging: mt29f_spinand: make use of mtd_to_nand() Boris Brezillon
2015-11-16 13:37   ` [PATCH 12/27] mtd: nand: embed an mtd_info structure into nand_chip Boris Brezillon
2015-11-16 13:37   ` [PATCH 14/27] mtd: nand: use the mtd instance embedded in struct nand_chip Boris Brezillon
     [not found]     ` <1447681080-31232-15-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2015-11-17  3:00       ` Brian Norris
     [not found]         ` <20151117030019.GY8456-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-11-17  8:38           ` Boris Brezillon
2015-11-17  9:05             ` Julia Lawall
2015-11-17 14:22               ` Boris Brezillon
2015-11-17 15:32                 ` Julia Lawall
2015-11-16 13:37   ` [PATCH 15/27] mtd: nand: update the documentation to reflect framework changes Boris Brezillon
2015-11-16 13:37   ` [PATCH 16/27] staging: mt29f_spinand: use the mtd instance embedded in struct nand_chip Boris Brezillon
2015-11-16 13:37   ` [PATCH 19/27] mtd: nand: remove useless mtd->priv = chip assignments Boris Brezillon
2015-11-16 13:37   ` [PATCH 20/27] cris: " Boris Brezillon
2015-11-16 13:37   ` [PATCH 21/27] staging: mt29f_spinand: remove useless mtd->priv = chip assignment Boris Brezillon
2015-11-16 13:37   ` [PATCH 23/27] mtd: nand: kill the chip->flash_node field Boris Brezillon
2015-11-16 13:37   ` [PATCH 24/27] mtd: nand: add helpers to access ->priv Boris Brezillon
2015-11-16 13:37   ` [PATCH 26/27] mtd: nand: make use of nand_set/get_controller_data() helpers Boris Brezillon
2015-11-16 13:38   ` [PATCH 27/27] staging: mt29f_spinand: " Boris Brezillon
2015-11-16 13:37 ` [PATCH 22/27] mtd: nand: simplify nand_dt_init() usage Boris Brezillon
2015-11-16 13:37 ` [PATCH 25/27] ARM: make use of nand_set/get_controller_data() helpers Boris Brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151117092616.0e33d2f3@bbrezillon \
    --to=boris.brezillon-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
    --cc=alex-L4GPcECwBoDe9xe1eoZjHA@public.gmane.org \
    --cc=andrew-g2DYL2Zd6BY@public.gmane.org \
    --cc=computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=corbet-T1hC0tSOHrs@public.gmane.org \
    --cc=daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=haojian.zhuang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=hsweeten-3FF4nKcrg1dE2c76skzGb0EOCMrvLtNR@public.gmane.org \
    --cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
    --cc=kaloz-p3rKhJxN3npAfugRpC6u6w@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=khalasa-NlWvg49iv0c@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rmallon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=robert.jarzmik-GANU6spQydw@public.gmane.org \
    --cc=sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).