All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin@rock-chips.com>
To: Ulf Hansson <ulf.hansson@linaro.org>, linux-mmc@vger.kernel.org
Cc: shawn.lin@rock-chips.com, Jaehoon Chung <jh80.chung@samsung.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH v3 07/15] mmc: core: Move public functions from core.h to private headers
Date: Mon, 16 Jan 2017 11:01:11 +0800	[thread overview]
Message-ID: <87e14348-b6fa-4962-ef3b-ac9a35d37da3@rock-chips.com> (raw)
In-Reply-To: <1484313256-25993-8-git-send-email-ulf.hansson@linaro.org>

On 2017/1/13 21:14, Ulf Hansson wrote:
> A significant amount of functions are available through the public mmc
> core.h header file. Let's slim down this public mmc interface, as to
> prevent users from abusing it, by moving some of the functions to private
> mmc header files.
>
> This change concentrates on moving the functions into private mmc headers,
> following changes may continue with additional clean-ups, as an example
> some functions can be turned into static.
>

[...]

> @@ -16,6 +16,7 @@
>  #include <linux/mmc/sdio_func.h>
>
>  #include "sdio_ops.h"
> +#include "core.h"
>

Should we need move it before sdio_ops.h to
slightly keep the order? The same for sdio_orq.c change :)

Otherwise,

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

>  /**
>   *	sdio_claim_host - exclusively claim a bus for a certain SDIO function
> diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
> index f1faf9a..d084635 100644
> --- a/drivers/mmc/core/sdio_irq.c
> +++ b/drivers/mmc/core/sdio_irq.c
> @@ -27,6 +27,7 @@
>  #include <linux/mmc/sdio_func.h>
>
>  #include "sdio_ops.h"
> +#include "core.h"
>
>  static int process_sdio_pending_irqs(struct mmc_host *host)
>  {
> diff --git a/drivers/mmc/core/sdio_ops.h b/drivers/mmc/core/sdio_ops.h
> index e1c36d6..bed8a83 100644
> --- a/drivers/mmc/core/sdio_ops.h
> +++ b/drivers/mmc/core/sdio_ops.h
> @@ -24,6 +24,7 @@ int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
>  int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn,
>  	unsigned addr, int incr_addr, u8 *buf, unsigned blocks, unsigned blksz);
>  int sdio_reset(struct mmc_host *host);
> +unsigned int mmc_align_data_size(struct mmc_card *card, unsigned int sz);
>
>  static inline bool mmc_is_io_op(u32 opcode)
>  {
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index 64e2ddf..e679a86 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -158,25 +158,13 @@ struct mmc_request {
>  struct mmc_card;
>  struct mmc_async_req;
>
> -extern int mmc_stop_bkops(struct mmc_card *);
> -extern int mmc_read_bkops_status(struct mmc_card *);
>  extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
>  					   struct mmc_async_req *,
>  					   enum mmc_blk_status *);
> -extern int mmc_interrupt_hpi(struct mmc_card *);
>  extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
> -extern void mmc_wait_for_req_done(struct mmc_host *host,
> -				  struct mmc_request *mrq);
> -extern bool mmc_is_req_done(struct mmc_host *host, struct mmc_request *mrq);
>  extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
> -extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *);
> -extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
> -	struct mmc_command *, int);
> -extern void mmc_start_bkops(struct mmc_card *card, bool from_exception);
> -extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int);
>  extern int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error);
>  extern int mmc_abort_tuning(struct mmc_host *host, u32 opcode);
> -extern int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd);
>
>  #define MMC_ERASE_ARG		0x00000000
>  #define MMC_SECURE_ERASE_ARG	0x80000000
> @@ -188,46 +176,8 @@ extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
>  #define MMC_SECURE_ARGS		0x80000000
>  #define MMC_TRIM_ARGS		0x00008001
>
> -extern int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr,
> -		     unsigned int arg);
> -extern int mmc_can_erase(struct mmc_card *card);
> -extern int mmc_can_trim(struct mmc_card *card);
> -extern int mmc_can_discard(struct mmc_card *card);
> -extern int mmc_can_sanitize(struct mmc_card *card);
> -extern int mmc_can_secure_erase_trim(struct mmc_card *card);
> -extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
> -				   unsigned int nr);
> -extern unsigned int mmc_calc_max_discard(struct mmc_card *card);
> -
> -extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
> -extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount,
> -			      bool is_rel_write);
>  extern int mmc_hw_reset(struct mmc_host *host);
> -extern int mmc_can_reset(struct mmc_card *card);
> -
>  extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
> -extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
> -
> -extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort);
> -extern void mmc_release_host(struct mmc_host *host);
> -
> -extern void mmc_get_card(struct mmc_card *card);
> -extern void mmc_put_card(struct mmc_card *card);
> -
> -extern int mmc_flush_cache(struct mmc_card *);
> -
> -extern int mmc_detect_card_removed(struct mmc_host *host);
> -
> -/**
> - *	mmc_claim_host - exclusively claim a host
> - *	@host: mmc host to claim
> - *
> - *	Claim a host for a set of operations.
> - */
> -static inline void mmc_claim_host(struct mmc_host *host)
> -{
> -	__mmc_claim_host(host, NULL);
> -}
>
>  struct device_node;
>  extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
>


-- 
Best Regards
Shawn Lin


  reply	other threads:[~2017-01-16  3:01 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
2017-01-13 13:14 ` [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h Ulf Hansson
2017-01-13 13:14   ` Ulf Hansson
2017-01-20  8:01   ` Robert Jarzmik
2017-01-20  8:01     ` Robert Jarzmik
2017-01-20  8:27     ` Ulf Hansson
2017-01-20  8:27       ` Ulf Hansson
2017-01-20 19:34       ` Robert Jarzmik
2017-01-20 19:34         ` Robert Jarzmik
2017-01-22 10:25         ` Robert Jarzmik
2017-01-22 10:25           ` Robert Jarzmik
2017-01-24  7:57           ` Ulf Hansson
2017-01-24  7:57             ` Ulf Hansson
2017-01-24 16:34             ` Robert Jarzmik
2017-01-24 16:34               ` Robert Jarzmik
2017-01-13 13:14 ` [PATCH v3 02/15] ARM: davinci: " Ulf Hansson
2017-01-13 13:14   ` Ulf Hansson
2017-01-13 13:26   ` Sekhar Nori
2017-01-13 13:26     ` Sekhar Nori
2017-01-13 13:14 ` [PATCH v3 03/15] ARM: davinci: Don't rely on public mmc header to include interrupt.h Ulf Hansson
2017-01-13 13:14   ` Ulf Hansson
2017-01-13 13:38   ` Sekhar Nori
2017-01-13 13:38     ` Sekhar Nori
2017-01-13 13:14 ` [PATCH v3 04/15] MIPS: Alchemy: " Ulf Hansson
2017-01-13 13:14   ` Ulf Hansson
2017-01-17 14:50   ` Ralf Baechle
2017-01-13 13:14 ` [PATCH v3 05/15] mmc: core: First step in cleaning up public mmc header files Ulf Hansson
2017-01-16  2:54   ` Shawn Lin
2017-01-13 13:14 ` [PATCH v3 06/15] mmc: core: First step in cleaning up private " Ulf Hansson
2017-01-16  2:56   ` Shawn Lin
2017-01-13 13:14 ` [PATCH v3 07/15] mmc: core: Move public functions from core.h to private headers Ulf Hansson
2017-01-16  3:01   ` Shawn Lin [this message]
2017-01-17 15:07     ` Ulf Hansson
2017-01-13 13:14 ` [PATCH v3 08/15] mmc: core: Move some host specific public functions to host.h Ulf Hansson
2017-01-16  3:02   ` Shawn Lin
2017-01-13 13:14 ` [PATCH v3 09/15] mmc: core: Move erase/trim/discard defines from public core.h to mmc.h Ulf Hansson
2017-01-16  3:05   ` Shawn Lin
2017-01-17 15:06     ` Ulf Hansson
2017-01-13 13:14 ` [PATCH v3 10/15] mmc: core: Remove unused struct _mmc_csd from public mmc.h header Ulf Hansson
2017-01-16  3:07   ` Shawn Lin
2017-01-17 15:07     ` Ulf Hansson
2017-01-13 13:14 ` [PATCH v3 11/15] mmc: omap: Don't use mmc_card_present() when validating for inserted card Ulf Hansson
2017-01-13 13:14 ` [PATCH v3 12/15] mmc: vub300: " Ulf Hansson
2017-01-13 13:14 ` [PATCH v3 13/15] mmc: core: Move public functions from card.h to private headers Ulf Hansson
2017-01-16  3:10   ` Shawn Lin
2017-01-13 13:14 ` [PATCH v3 14/15] mmc: core: Move public functions from host.h " Ulf Hansson
2017-01-16  3:14   ` Shawn Lin
2017-01-13 13:14 ` [PATCH v3 15/15] mmc: core: Don't use extern declarations of public mmc functions Ulf Hansson
2017-01-16  3:16   ` Shawn Lin
2017-01-17 15:08 ` [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson

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=87e14348-b6fa-4962-ef3b-ac9a35d37da3@rock-chips.com \
    --to=shawn.lin@rock-chips.com \
    --cc=adrian.hunter@intel.com \
    --cc=jh80.chung@samsung.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.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 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.