public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Cc: <linux-mtd@lists.infradead.org>, <linux-leds@vger.kernel.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Jacek Anaszewski <j.anaszewski@samsung.com>
Subject: Re: [PATCH 1/2] mtd: Uninline mtd_write_oob and move it to mtdcore.c
Date: Tue, 12 Apr 2016 20:15:24 +0200	[thread overview]
Message-ID: <20160412201524.1549b844@bbrezillon> (raw)
In-Reply-To: <1460478395-25925-2-git-send-email-ezequiel@vanguardiasur.com.ar>

On Tue, 12 Apr 2016 13:26:34 -0300
Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote:

> There's no reason for having mtd_write_oob inlined in mtd.h header.
> Move it to mtdcore.c where it belongs.

I guess the real motivation here is to avoid including leds.h in
mtd.h :).

> 
> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>

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

> ---
>  drivers/mtd/mtdcore.c   | 12 ++++++++++++
>  include/linux/mtd/mtd.h | 12 +-----------
>  2 files changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index 309625130b21..99d83f3331b0 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -997,6 +997,18 @@ int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops)
>  }
>  EXPORT_SYMBOL_GPL(mtd_read_oob);
>  
> +int mtd_write_oob(struct mtd_info *mtd, loff_t to,
> +				struct mtd_oob_ops *ops)
> +{
> +	ops->retlen = ops->oobretlen = 0;
> +	if (!mtd->_write_oob)
> +		return -EOPNOTSUPP;
> +	if (!(mtd->flags & MTD_WRITEABLE))
> +		return -EROFS;
> +	return mtd->_write_oob(mtd, to, ops);
> +}
> +EXPORT_SYMBOL_GPL(mtd_write_oob);
> +
>  /*
>   * Method to access the protection register area, present in some flash
>   * devices. The user data is one time programmable but the factory data is read
> diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
> index 771272187316..ef9fea4fc400 100644
> --- a/include/linux/mtd/mtd.h
> +++ b/include/linux/mtd/mtd.h
> @@ -283,17 +283,7 @@ int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
>  		    const u_char *buf);
>  
>  int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops);
> -
> -static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to,
> -				struct mtd_oob_ops *ops)
> -{
> -	ops->retlen = ops->oobretlen = 0;
> -	if (!mtd->_write_oob)
> -		return -EOPNOTSUPP;
> -	if (!(mtd->flags & MTD_WRITEABLE))
> -		return -EROFS;
> -	return mtd->_write_oob(mtd, to, ops);
> -}
> +int mtd_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops);
>  
>  int mtd_get_fact_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
>  			   struct otp_info *buf);



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

  reply	other threads:[~2016-04-12 18:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12 16:26 [PATCH 0/2] LED trigger on MTD activity Ezequiel Garcia
2016-04-12 16:26 ` [PATCH 1/2] mtd: Uninline mtd_write_oob and move it to mtdcore.c Ezequiel Garcia
2016-04-12 18:15   ` Boris Brezillon [this message]
2016-04-12 18:35     ` Ezequiel Garcia
2016-04-12 16:26 ` [PATCH 2/2] leds: trigger: Introduce a MTD (NAND/NOR) trigger Ezequiel Garcia
2016-04-12 18:27   ` Boris Brezillon
2016-04-12 18:40     ` Ezequiel Garcia
2016-04-12 19:11       ` Boris Brezillon
2016-04-12 19:35       ` Ezequiel Garcia
2016-04-12 19:46         ` 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=20160412201524.1549b844@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=j.anaszewski@samsung.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.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