All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: nandsim: use nand_get_controller_data()
@ 2016-01-07 19:06 Brian Norris
  2016-01-07 19:36 ` Boris Brezillon
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Norris @ 2016-01-07 19:06 UTC (permalink / raw)
  To: linux-mtd; +Cc: Boris Brezillon, Brian Norris

Commit d699ed250c07 ("mtd: nand: make use of
nand_set/get_controller_data() helpers") overlooked some uses of
nand_chip::priv.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/nand/nandsim.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index f57f461b5d72..1fd519503bb1 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -1908,7 +1908,8 @@ static void switch_state(struct nandsim *ns)
 
 static u_char ns_nand_read_byte(struct mtd_info *mtd)
 {
-	struct nandsim *ns = mtd_to_nand(mtd)->priv;
+	struct nand_chip *chip = mtd_to_nand(mtd);
+	struct nandsim *ns = nand_get_controller_data(chip);
 	u_char outb = 0x00;
 
 	/* Sanity and correctness checks */
@@ -1969,7 +1970,8 @@ static u_char ns_nand_read_byte(struct mtd_info *mtd)
 
 static void ns_nand_write_byte(struct mtd_info *mtd, u_char byte)
 {
-	struct nandsim *ns = mtd_to_nand(mtd)->priv;
+	struct nand_chip *chip = mtd_to_nand(mtd);
+	struct nandsim *ns = nand_get_controller_data(chip);
 
 	/* Sanity and correctness checks */
 	if (!ns->lines.ce) {
@@ -2123,7 +2125,8 @@ static void ns_nand_write_byte(struct mtd_info *mtd, u_char byte)
 
 static void ns_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int bitmask)
 {
-	struct nandsim *ns = mtd_to_nand(mtd)->priv;
+	struct nand_chip *chip = mtd_to_nand(mtd);
+	struct nandsim *ns = nand_get_controller_data(chip);
 
 	ns->lines.cle = bitmask & NAND_CLE ? 1 : 0;
 	ns->lines.ale = bitmask & NAND_ALE ? 1 : 0;
@@ -2150,7 +2153,8 @@ static uint16_t ns_nand_read_word(struct mtd_info *mtd)
 
 static void ns_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
 {
-	struct nandsim *ns = mtd_to_nand(mtd)->priv;
+	struct nand_chip *chip = mtd_to_nand(mtd);
+	struct nandsim *ns = nand_get_controller_data(chip);
 
 	/* Check that chip is expecting data input */
 	if (!(ns->state & STATE_DATAIN_MASK)) {
@@ -2177,7 +2181,8 @@ static void ns_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
 
 static void ns_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
 {
-	struct nandsim *ns = mtd_to_nand(mtd)->priv;
+	struct nand_chip *chip = mtd_to_nand(mtd);
+	struct nandsim *ns = nand_get_controller_data(chip);
 
 	/* Sanity and correctness checks */
 	if (!ns->lines.ce) {
@@ -2404,7 +2409,8 @@ module_init(ns_init_module);
  */
 static void __exit ns_cleanup_module(void)
 {
-	struct nandsim *ns = mtd_to_nand(nsmtd)->priv;
+	struct nand_chip *chip = mtd_to_nand(nsmtd);
+	struct nandsim *ns = nand_get_controller_data(chip);
 	int i;
 
 	nandsim_debugfs_remove(ns);
-- 
2.6.0.rc2.230.g3dd15c0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: nandsim: use nand_get_controller_data()
  2016-01-07 19:06 [PATCH] mtd: nandsim: use nand_get_controller_data() Brian Norris
@ 2016-01-07 19:36 ` Boris Brezillon
  2016-01-07 20:27   ` Brian Norris
  0 siblings, 1 reply; 3+ messages in thread
From: Boris Brezillon @ 2016-01-07 19:36 UTC (permalink / raw)
  To: Brian Norris; +Cc: linux-mtd

On Thu,  7 Jan 2016 11:06:46 -0800
Brian Norris <computersforpeace@gmail.com> wrote:

> Commit d699ed250c07 ("mtd: nand: make use of
> nand_set/get_controller_data() helpers") overlooked some uses of
> nand_chip::priv.

Oops. Apparently my coccinelle script is not detecting those
mtd_to_nand(mtd)->priv statements.

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>

Thanks,

Boris

> 
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> ---
>  drivers/mtd/nand/nandsim.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
> index f57f461b5d72..1fd519503bb1 100644
> --- a/drivers/mtd/nand/nandsim.c
> +++ b/drivers/mtd/nand/nandsim.c
> @@ -1908,7 +1908,8 @@ static void switch_state(struct nandsim *ns)
>  
>  static u_char ns_nand_read_byte(struct mtd_info *mtd)
>  {
> -	struct nandsim *ns = mtd_to_nand(mtd)->priv;
> +	struct nand_chip *chip = mtd_to_nand(mtd);
> +	struct nandsim *ns = nand_get_controller_data(chip);
>  	u_char outb = 0x00;
>  
>  	/* Sanity and correctness checks */
> @@ -1969,7 +1970,8 @@ static u_char ns_nand_read_byte(struct mtd_info *mtd)
>  
>  static void ns_nand_write_byte(struct mtd_info *mtd, u_char byte)
>  {
> -	struct nandsim *ns = mtd_to_nand(mtd)->priv;
> +	struct nand_chip *chip = mtd_to_nand(mtd);
> +	struct nandsim *ns = nand_get_controller_data(chip);
>  
>  	/* Sanity and correctness checks */
>  	if (!ns->lines.ce) {
> @@ -2123,7 +2125,8 @@ static void ns_nand_write_byte(struct mtd_info *mtd, u_char byte)
>  
>  static void ns_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int bitmask)
>  {
> -	struct nandsim *ns = mtd_to_nand(mtd)->priv;
> +	struct nand_chip *chip = mtd_to_nand(mtd);
> +	struct nandsim *ns = nand_get_controller_data(chip);
>  
>  	ns->lines.cle = bitmask & NAND_CLE ? 1 : 0;
>  	ns->lines.ale = bitmask & NAND_ALE ? 1 : 0;
> @@ -2150,7 +2153,8 @@ static uint16_t ns_nand_read_word(struct mtd_info *mtd)
>  
>  static void ns_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
>  {
> -	struct nandsim *ns = mtd_to_nand(mtd)->priv;
> +	struct nand_chip *chip = mtd_to_nand(mtd);
> +	struct nandsim *ns = nand_get_controller_data(chip);
>  
>  	/* Check that chip is expecting data input */
>  	if (!(ns->state & STATE_DATAIN_MASK)) {
> @@ -2177,7 +2181,8 @@ static void ns_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
>  
>  static void ns_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
>  {
> -	struct nandsim *ns = mtd_to_nand(mtd)->priv;
> +	struct nand_chip *chip = mtd_to_nand(mtd);
> +	struct nandsim *ns = nand_get_controller_data(chip);
>  
>  	/* Sanity and correctness checks */
>  	if (!ns->lines.ce) {
> @@ -2404,7 +2409,8 @@ module_init(ns_init_module);
>   */
>  static void __exit ns_cleanup_module(void)
>  {
> -	struct nandsim *ns = mtd_to_nand(nsmtd)->priv;
> +	struct nand_chip *chip = mtd_to_nand(nsmtd);
> +	struct nandsim *ns = nand_get_controller_data(chip);
>  	int i;
>  
>  	nandsim_debugfs_remove(ns);



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: nandsim: use nand_get_controller_data()
  2016-01-07 19:36 ` Boris Brezillon
@ 2016-01-07 20:27   ` Brian Norris
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Norris @ 2016-01-07 20:27 UTC (permalink / raw)
  To: Boris Brezillon; +Cc: linux-mtd

On Thu, Jan 07, 2016 at 08:36:14PM +0100, Boris Brezillon wrote:
> On Thu,  7 Jan 2016 11:06:46 -0800
> Brian Norris <computersforpeace@gmail.com> wrote:
> 
> > Commit d699ed250c07 ("mtd: nand: make use of
> > nand_set/get_controller_data() helpers") overlooked some uses of
> > nand_chip::priv.
> 
> Oops. Apparently my coccinelle script is not detecting those
> mtd_to_nand(mtd)->priv statements.
> 
> Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>

Thanks! Applied to l2-mtd.git

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-07 20:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-07 19:06 [PATCH] mtd: nandsim: use nand_get_controller_data() Brian Norris
2016-01-07 19:36 ` Boris Brezillon
2016-01-07 20:27   ` Brian Norris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.